Log in or register to post comments

unresponsive for a few seconds after calling iPhoneUtils.PlayMovie()

August 26, 2011 - 3:15pm #1

Hello, just wondering if someone could help me with this since I code mostly in javascript and struggle with the syntax and peculiarities of C#.

When I call "iPhoneUtils.PlayMovie()" after detecting a marker, and playing the video successfully. The app will show a still of any objects attached to the marker on a blank background and hang for a few seconds (about 5-10 I estimate) before starting up back to normal.

I used the provided script "TrackableEventHandler.cs" and basically appended "iPhoneUtils.PlayMovie()" as the last line in OnTrackingFound().

Looking at the output in Xcode, It seems to be stopping QCAR when the video launches but not reinitialising it straight after the video ends.

Hope Ive explained my problem well enough, I tend to waffle hehe.

Re: unresponsive for a few seconds after calling iPhoneUtils.Pla

August 28, 2011 - 2:05pm #2

The problem seems to be that OnTrackingFound is called immediately when returning to the AR view, causing the tracker to stop again. We'll look into this issue, but there are a variety of ways to temporarily fix it. Something like this might work for you:

bool skip = false;

private void OnTrackingFound()
    Renderer[] rendererComponents = GetComponentsInChildren<Renderer>();

    // Enable rendering:
    foreach (Renderer component in rendererComponents) {
        component.enabled = true;

    Debug.Log("Trackable " + mTrackableBehaviour.TrackableName + " found");
    if (!skip)
        iPhoneUtils.PlayMovie("myvideo.mp4", Color.black, iPhoneMovieControlMode.Full);
    skip = !skip;

- Kim

Log in or register to post comments