Page 1 of 1

Play video embedded in the app ?

Posted: 26 Mar 2014 11:48
by Fradow
Hello,

I'm trying to play a video embedded in the app, using this code :

Code: Select all

Media m = new Media(vlc, LibVLC.PathToURI(videoFile.getPath())); list.add(m); vlc.setMediaList(list); vlc.playIndex(0);
It works well when playing video outside the app, but when I'm trying to get a video embedded in the app, it doesn't.

I also tried :
- passing the entire URI, with : Uri.parse("android.resource://" + getPackageName() + "/" + R.raw.tutorial).toString();
- passing the entire URI through LibVLC.PathToUri (which doesn't change the string anyway) : LibVLC.PathToURI((Uri.parse("android.resource://" + getPackageName() + "/" + R.raw.tutorial).toString());

Here is the log :

Code: Select all

03-26 11:32:58.525: E/VLC(3797): core input: open of `android.resource://com.mycompany.myapp/2130903040' failed 03-26 11:32:58.526: E/VLC(3797): core input: Your input can't be opened 03-26 11:32:58.526: E/VLC(3797): core input: VLC is unable to open the MRL 'android.resource://com.mycompany.myapp/2130903040'. Check the log for details.
Is LibVLC able to play a video embedded in the app ? If yes, how do you specify the path ? Else, I guess I just have to copy the video in the SD card before playing it.

Thanks.

Re: Play video embedded in the app ?

Posted: 27 Mar 2014 14:40
by edwardw
Probably you should read it with getResource and copy it to the SD.

Re: Play video embedded in the app ?

Posted: 27 Mar 2014 14:41
by Fradow
Ok, not supported I guess, it's understandable.

I'll do just that, thanks Edward.