VLC should support DocumentsProvider
VLC should be able to play files from the ACTION_VIEW intent which are provided via an DocumentsProvider of the application which created the intent.
Description
EDS Lite is an example application for this scenario. It provides container based encryption and supports showing the files in the container in other applications via the ACTION_VIEW intent. The default is to writeToPipe the content of the file to view and serving the resulting ParcelFileDescriptor
via this DocumentsProvider. The data field of the ACTION_VIEW intent then has a value starting with content://com.sovworks.eds.android.providers.main.lite/content/
followed but some random looking string. The MIME type is properly filled, e.g. video/mp4
.
The advantage of this approach is that the decrypted file content is never stored on a permanent storage. This also means it cannot be referenced by a file:///
URI.
Expected behavior
If VLC is chosen as app to display this file, it should play the video and also be able to search in it.
Instead the following toast message is shown: Ort file:///null kann nicht abgespielt werden
. Via adb, I found the following related lines:
12-29 22:10:49.638 22800 22800 D VLC/medialibrary: [T#515138520312] ../src/MediaLibrary.cpp:651 media Fetching media from mrl: file:///null
12-29 22:10:49.639 22800 22800 D VLC/medialibrary: [T#515138520312] ../src/Device.cpp:288 fromMountpoint Trying to match file:/// with a cached mountpoint
12-29 22:10:49.639 22800 22800 D VLC/medialibrary: [T#515138520312] ../src/Device.cpp:317 fromMountpoint No match
12-29 22:10:49.639 22800 22800 D VLC/medialibrary: [T#515138520312] ../src/File.cpp:445 fromMrl Failed to find folder containing file:///null
12-29 22:10:49.763 22800 23389 E VLC : [000000762a14e260/5b5d] libvlc stream: cannot open file /null (No such file or directory)
Remarks
Simple-Gallery is able to play files served from EDS Lite. This seems to be achieved using the ContentDataSource from exoplayer.
Smartphone Tested with a Samsung Galaxy S7 running LineageOS 18.1 (Android 11).