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");
}
}
}
}