- Home /
Occasional black screen and lock up when using Handheld.PlayFullScreenMovie
I'm using a script to load some videos from my Streaming Assets folder, for playback on iOS. These work fine most of the time, but sometimes will cause the entire app to lock up. This always happens as the video has ended and is presumably trying to close.
Any ideas what could cause this? Or things I should look into to see about fixing it? What code does Handheld.PlayFullScreenMovie load and how can I access it?
Here's the script I'm using:
using UnityEngine;
using System.Collections;
public class PlayMovieScript : MonoBehaviour
{
private static bool finishedPlaying;
private static string videoPath;
public static void Activate(string path)
{
Handheld.PlayFullScreenMovie(path, new Color(0.7529411f, 0.7529411f, 0.7529411f), FullScreenMovieControlMode.Minimal, FullScreenMovieScalingMode.AspectFit);
videoPath = path;
finishedPlaying = true;
}
void Update()
{
if (finishedPlaying)
{
finishedPlaying = false;
if (videoPath == "session02.m4v")
{
Application.LoadLevel ("HierarchyBlocksScene");
}
if (videoPath == "sess4_1k.m4v")
{
Application.LoadLevel ("Options1Scene");
}
}
}
}
Try using this
iPhoneUtils.Play$$anonymous$$ovie(moviePath, Color.black, iPhone$$anonymous$$ovieControl$$anonymous$$ode.CancelOnTouch);
Same issue, plus I get "warning CS0618: `UnityEngine.iPhoneUtils.Play$$anonymous$$ovie(string, UnityEngine.Color, UnityEngine.iPhone$$anonymous$$ovieControl$$anonymous$$ode, UnityEngine.iPhone$$anonymous$$ovieScaling$$anonymous$$ode)' is obsolete: `Play$$anonymous$$ovie method is deprecated. Please use Handheld.PlayFullScreen$$anonymous$$ovie ins$$anonymous$$d.'"
I've managed to remedy this issue slightly by not using async load level right afterwards, but I'm still having a problem if I scrub through the video to the end. Is there a specific way I should be handling the running of code right after a video finishes? Or a way of telling when the video has actually finished? I'll edit my original post to include my script.
Answer by Grislymanor · Dec 23, 2015 at 10:41 PM
I had the same issue on an Android build and resolved it by removing 'Debug.Log ("Intro PLayed");' after my "Handheld.PlayFullScreenMovie" function and before 'Application.LoadLevel ("Menu");' . Weird.
Your answer
Follow this Question
Related Questions
Videoclip codec for mobile devices 0 Answers
Videos don't play in Apple Appstore build 0 Answers
VideoPlayer ios StreamingAssets black render 1 Answer
Knowing the position 1 Answer
3.4 iOS play movie ending 0 Answers