- Home /
IphoneUtils.PlayMovie for Android
Hi. I have Unity Android Pro 3.2. I'm on a PC. I cut and pasted this script out of Unity Script reference page and I can't seem to get a movie to play on the Android phones. What am I doing wrong? I created an empty game object in my "0" scene of the game and dropped this script on it. I created a "StreamingAssets" folder and placed it in with all of my project files. I Dropped my 264/mp4 movie into the "StreamingAssets" folder. I built the scene, then hit start. Nothing! Blank screen. The movie doesn't play. I move the Streaming Assets folder into my Standart Assets folder. Again nothing! Then I dropped the "StreamingAssets" folder along with the movie file(264 compression mp4) and put it into Standard Assets(Mobile). Nothing! Blank screen. I loaded it on my Android phone. Nothing! no movie plays. I just get a blank screen. Can someone please give me a suggestion? I must be missing something.
function Start() {
iPhoneUtils.PlayMovie("MyMovie44", Color.black, iPhoneMovieControlMode.CancelOnTouch);
}
PS "CancelOnTouch" in the above code is not highlighted in my script editor. It's black. I don't know if this matters. But any suggestions you have would be appreciated.
Thanx
Here is the error message from my editor when I hit the start button.
iPhoneUtils.Play$$anonymous$$ovie($$anonymous$$y$$anonymous$$ovie44) UnityEngine.iPhoneUtils:Play$$anonymous$$ovie(String, Color, iPhone$$anonymous$$ovieControl$$anonymous$$ode) $$anonymous$$ovieScript:Start() (at Assets/$$anonymous$$ovieScript.js:2)
I figured it out. I don't have the extension on the file name. "$$anonymous$$y$$anonymous$$ovie44.3gp" It works fine now.
I'm surprised nobody caught that! Thanx for the comment.
Answer by Dreamora · Dec 27, 2011 at 10:48 AM
On the desktop it will not do anything. As for the movie itself: did you test if it plays on your device? On Android the movie support is such a topic thats not as pleasant as one would like it to be, your device might or might not support the codec and movie size, there is no 'base line granted support' unless you go for the worst possible.
Thanks. I figured it out. I don't have the file extension on "$$anonymous$$y$$anonymous$$ovie44.3gb"
so how did you make it work? make a new scene with nothing in it except a empty gameobject and attached the script on the object?
Your answer
Follow this Question
Related Questions
Android video playback 2 Answers
How to check if Handheld.PlayFullScreenMovie has stopped playing 2 Answers
why cannot build movie texture on android? 4 Answers
how to play video on android 4 Answers
Movies on Android. Is it possible? 2 Answers