VLC for Android can't open media using Content URIs
VLC for Android can't play media when it receives an Intent with a Content URI for the media address. The UI presents a dialog "Playback error VLC encountered an error with this media. Please try refreshing the media library."
I've attached an excerpt from logcat showing this.
In this case, the sending app is running under an Android for Work profile and VLC is running under the personal profile, so it has to use Content URIs - file URIs in the work profile aren't accessible from outside.
The URI in the Intent is:
content://10@com.example.myapp.fileprovider/attachments/2791c674-ba24-4eab-8e81-9dcba5ab4735/88e5af58-5f7c-4451-8a6e-7390b2b49f922015-04-21T19_51_58.831Z40bd2e1c-5482-4175-941f-edd0d1cc7ebb/VIDEO_20150421_155147.mp4
but when VLC tries to open it, it has assumed this is a file URI:
which won't work.
VLC needs to look for the URI scheme content:, and in that case, use Android's ContentResolver API to access the underlying file.