Hi Everyone,
I’m trying to play a full screen video using Handheld.PlayFullScreenMovie in iOs with no success:
-I’m placing the movie file into the StreamingAssets folder (MMIntro.mov)
I’m adding in my Xcode project this movie file as copy bundle resources
xcode → build phases → copy bundle resources
However when it runs in iPhone it shows a white screen for some seconds and then comes back to the Unity Game.
The error log shows : [prepareAsset]Error: The requested URL was not found on this server.
Also, I’m checking if the file exists, and it desn’t. It seems like is not being copied to an iOs accessible folder from the StreamingAsstes one.
Do you have any idea what am I doing wrong?? Do I need to set something else in my Xcode project?
Thanks in advance.
Here is My code
public string movieName = "MMIntro.mov";
IEnumerator loadAndPlayTexture(){
if(System.IO.File.Exists(movieName)){
Debug.Log("<<<<<<<<<<<<<<<<<<<<<<<<<<<<<File exists<" + movieName + ">");
}
else{
Debug.Log("<<<<<<<<<<<<<<<<<<<<<<<<<<<<File Not found<" + movieName + ">");
}
#if !UNITY_EDITOR && (UNITY_IOS || UNITY_ANDROID)
Handheld.PlayFullScreenMovie (movieName, Color.black, FullScreenMovieControlMode.CancelOnInput);
yield return new WaitForSeconds(1);
GetComponentInParent<SequenceManager> ().advance ();
gameObject.SetActive (false);
#else
yield return new WaitForSeconds(1);
MovieTexture texture = null;
try{
texture = (MovieTexture)image.texture;
} catch {
GetComponentInParent<SequenceManager> ().advance ();
gameObject.SetActive (false);
yield break;
}
audio.clip = texture.audioClip;
while (!texture.isReadyToPlay) {
yield return false;
}
image.color = Color.white;
if(!isAudioMuted){
audio.Play ();
}
texture.Play ();
while (texture.isPlaying) {
yield return false;
}
if (audio.isPlaying) {
audio.Stop();
}
texture.Stop ();
GetComponentInParent<SequenceManager> ().advance ();
gameObject.SetActive (false);
#endif
yield return false;
}