i have just upgraded my iPhone unity to 1.5 which supports video playback.
As given in the tutes i created a iPhoneStreamingAssets folder in my unity game folder in which i have stored a .mp4 video compressed using H.264 Baseline Profile Level 3.0 video.
and used the below script to play back my video on a button click.
iPhoneUtils.PlayMovie(“StarWars.mp4”, Color.black, iPhoneMovieControlMode.CancelOnTouch);
but my video is not getting played.
can u just help me with dis.
Also does the documentation gets updated with unity upgrade.
yws .mp4 is uspported
file:///Applications/Unity%20iPhone/Documentation/ScriptReference/iPhoneUtils.PlayMovie.html
this link provide the same info.
i think i have made a mistake i have created the foldre inside my unity package which should be actually outside so i ll just correct my mistakes n will try to solve it myself meanwhile if ne1 get it working plz lemme know…
yes i have unit y iPhone advanced 1.5.0f3(26682)
just want an example code for the movieplayback will be of gr8 help…
Coz itried but doesnt help where i m stuck is that i am playing the movie clip on action of a button click, for a moment 1 sec the unity engine stops and reumes again
i have created a folder named iPhoneStreamingAssets n placed a MC .mp4 compressed with the required compression technique but its not helping me.
PLz provide some help…
thanks in advance…
ya my folder structure is just like the second one
which contains a .mp4 movie file
→ Is there a size limitation for the same.
→ function Start() {
iPhoneUtils.PlayMovie(“Demo.mp4”, Color.black, iPhoneMovieControlMode.CancelOnTouch);
}
function OnGUI(){
if(GUI.Button(Rect(0,0,100,50), “PLAY”)){
iPhoneUtils.PlayMovie(“iPhoneStreamingAssets/Demo.mp4”, Color.black, iPhoneMovieControlMode.CancelOnTouch);
iPhoneUtils.PlayMovie (“Demo.mp4”,Color.red,iPhoneMovieControlMode.CancelOnTouch,iPhoneMovieScalingMode.AspectFit);
}
}
→ Demo.mp4 is in my iPhoneStreamingAssets folder next to my assets folder under the unity project.
still not working.
–>does Bg color affects nething
→ just tell me the whole procedure how xactly i can play a miovie.
Pro-tip for everyone: when you post code here on the forums, use the Code button when typing your reply, or manually wrap it in code tags ([ code ]…[ /code ], without those spaces) for better formatting and easier reading. I’m going to edit the posts above so y’all can see how it’s done for yourselves.
Hey finally i got it to work, i dont know wat mistake i was making ispite of using the proper steps that are provided in the tutorials, but still my video is playing but without sound, i.e i am not getting sound during the playback.ne suggestions
the video itself has sound, it should play automatically when the video is playing…
n i dont have ne code doing nething with the sound files… infact i have created a simple scene which plays the movie.
using UnityEngine;
using System.Collections;
public class MyVideo : MonoBehaviour {
// Use this for initialization
void Start () {
iPhoneUtils.PlayMovie ("Video/Movie.mp4", Color.black, iPhoneMovieControlMode.CancelOnTouch);
}
// Update is called once per frame
void Update () {
}
}
i have Created a “Video” Folder next to “Assets” folderand have added the video.
but still im not able to play anything on the Unity Consule its printing
im not able to understand the problem
can anyone help me out with it???[/code]
Hi there, as mentioned by higgy B in the above post you have to create a folder named iPhoneStreamingAssets just besides your asset folder of ur unity project and then add the video file in it, it will be added to ur iphone bundle, i was getting same problem with my .mp4 file so try changing it to a different format .mov it works for me… hope it helps…