Closed fabiotnt closed 8 years ago
@fabiotnt Your video is a DOME video? It's different form a sphere video.
I have the same problem (trying to load an internal file). I went to the link which ashqal said, but responses are in chinese or japanese and I can't understand it. I tried to use yangkai3 solution, but I don't know if I'm doing it wrong but it doesn't works. Could someone explain me a little more how to make it work?
1.ensure the sdcard read permission 2.use target sdk below 22 or deal with the permission request in sdk 23. 3.Uri.parse("file:///mnt/sdcard/demo.mp4")
I'm trying to load the file from res/raw not SDcard, points 1 and 2 are ok. But I'm trying to load the file by: Uri.parse("android.resource://" + getPackageName() + "/" + R.raw.video) and it doesn't works. Any sugestion?
@electmk It just a demo class, you can change any function... For example, if the URI is start with assert, then dispatch to another function to deal with the input URI.
I've tried to play some local videos, but I can't. The error that returns to me is Protocol not Found.
I've tried a lot of combinations to use android.resource:// protocol, but no luck. My final version is this:
private Uri getRawResourceUri(@RawRes int resId){ Resources resources = getResources(); Uri uri = Uri.parse(ContentResolver.SCHEME_ANDROID_RESOURCE + "://" + resources.getResourcePackageName(resId) + '/' + resources.getResourceTypeName(resId) + '/' + resources.getResourceEntryName(resId) ); return uri; }
When I try a remote video, the app runs like a charm.
My video file has been placed on resources/raw folder and called default_movie.mp4.
Thanks a lot.