From 2b52f52e24d58350729fcd9e58fe5ad2ad28f645 Mon Sep 17 00:00:00 2001 From: SupinePandora43 Date: Thu, 28 Nov 2024 04:52:27 +0500 Subject: [PATCH] Open fd from content:// uri --- .../java/software/solid/fluttervlcplayer/FlutterVlcPlayer.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/flutter_vlc_player/android/src/main/java/software/solid/fluttervlcplayer/FlutterVlcPlayer.java b/flutter_vlc_player/android/src/main/java/software/solid/fluttervlcplayer/FlutterVlcPlayer.java index e4850791..e5fc3d94 100644 --- a/flutter_vlc_player/android/src/main/java/software/solid/fluttervlcplayer/FlutterVlcPlayer.java +++ b/flutter_vlc_player/android/src/main/java/software/solid/fluttervlcplayer/FlutterVlcPlayer.java @@ -281,6 +281,8 @@ void setStreamUrl(String url, boolean isAssetUrl, boolean autoPlay, long hwAcc) Media media; if (isAssetUrl) media = new Media(libVLC, context.getAssets().openFd(url)); + else if(url.startsWith("content://")) + media = new Media(libVLC, context.getContentResolver().openFileDescriptor(Uri.parse(url), "r").getFileDescriptor()); else media = new Media(libVLC, Uri.parse(url)); final HwAcc hwAccValue = HwAcc.values()[(int) hwAcc];