- Home /
Handheld.PlayFullScreenMovie not working on Android since unity upgrade?
This works for me on iOS:
Handheld.PlayFullScreenMovie ("movie.mp4", Color.black, FullScreenMovieControlMode.Hidden);
but not on Android i get this error and the player briefly opens and closes:
E/MediaPlayer(24820): pause called in
state 1 E/MediaPlayer(24820): error (-38, 0)
so i tried
Handheld.PlayFullScreenMovie (Application.streamingAssetsPath + "/movie.mp4", Color.black, FullScreenMovieControlMode.Hidden);
and now instead get this error:
I/AwesomePlayer( 128): setDataSource_l(URL suppressed) E/ ( 128): Failed to open file 'jar:file:///data/app/com.mycompany.myapp-1.apk!/assets/movie.mp4'. (No such file or directory) E/MediaPlayer(26492): error (1, -2147483648) E/MediaPlayer(26492): pause called in state 0 E/MediaPlayer(26492): error (-38, 0)
I've unzipped the APK and confirmed that the movie.mp4 file is in fact where it's supposed to be.
The worst of it is that this used to work. When I was prototyping we had to ensure video would work, and it did, back in unity 3.5.6. So I'm wondering if something broke in the move to Unity4? Has anybody else run into this issue and solved it?
The first method (ie. just "movie.mp4") is working for me in Unity 4.3.2f1 on my Android device (Galaxy Nexus, Android 4.4.2). I tried your second method first and could not get it to work. $$anonymous$$y current problem is that I can't load any video from a subfolder, such as "/videos". This function only seems to recognize a file name without any sort of path in the name. This means I can put my videos only in the /assets/strea$$anonymous$$gassets folder, which ends up in the apk as the /assets folder.
I've also learned that Android playback can be finicky about format. You could try looking here for guidance: http://developer.android.com/guide/appendix/media-formats.html
Did you ever manage to solve this issue? I have tried about 15 different rtsp stream urls and i always get the same error(same as you on different devices). I'm starting to think it's a Unity issue.
Answer by krubba · Mar 13, 2015 at 08:49 PM
Sorry, it's been a while, but if I remember correctly I think it had something to with the format of the video itself, ie the encoding used. Someone else was supplying us the video and we went back and forth a bunch before we found a format that worked.
Your answer
Follow this Question
Related Questions
Android - Play movie with Handheld skips it 0 Answers
Download video and put it into StreamingAssets folder 0 Answers
PlayFullScreenMovie on Android shows black frames at start and end of video 2 Answers
Need help with Handeld.PlayFullScreenMovie for Android 1 Answer
Streaming assets android 0 Answers