We are working on a project for a high-profile client, and we need to show full-screen videos that are started from the AR view. We are running into several problems however, and hope you can help!
On iOS, general operation of the movieplayer is very good: it opens and closes quickly and without problems. I do set the ARCamera.active to false before starting the movie and back to true after it (it is my experience that if I only disable the QCARBahaviour component, it comes on automatically when control returns to the AR view, and that's not what I want in this case).
However, when the user closes the movie while it is playing by pressing the hardware-button on the front-panel of the iOS-device, and then re-opens the app from the home-screen, Unity continues but the tracking does not!
When I make a benchmark Unity scene (without QCAR) and call iPhoneUtils.PlayMovie using a couple of GUI.Buttons, the behaviour is good: the movie starts and closes promptly.
When I make the same benchmark scene but in a project where the QCARUnityPlayer is used, the application hangs after the movie closes. This is of course an unusual situation (using the QCARUnityPlayer without using QCAR), but maybe it helps in troubleshooting the problem.
When I try to use iPhoneUtils.PlayMovie while the tracking is active, starting the movie is very slow, and closing it + restarting AR is too.
I'm trying to add additional states to my controlling object in the application, so that I can show a 'Starting video' and 'Starting AR' screen while the transition is in progress. But this turns out to be tricky:
- if I set ARCamera.active to false before going to the movie, the application hangs when coming back from the movie
- if I only disable the QCARBehaviour component before going to the movie, the tracking is automatically resumed when we come back into the AR view. This takes a lot of time, and this means I don't get a chance to present the user with a 'Starting AR' screen.
- on some devices, the OS decides that the application has become unresponsive when returning to the AR view, and the user is given a choice between closing and waiting. When Wait is selected, the application resumes normally, but many people will not try this. This happens on my LG Optimus 2X speed, but this may be an exception since very often the camera takes a unsually long time to close. The message "State change started: OMX.Nvidia.jpeg.encoder from 2 to 1" is then shown about a hundred times in LogCat.
So my questions are:
- is there something I can do to have tracking continue on iOS, after the user closes a movie using the front-panel button?
- what is the best way to stop and resume the tracking on Android, so that I (a) get a chance to show some screens to the user about what is happening and (b) the prevent the OS from deciding that the app is not responsive?
The behaviour is the same with PlayMovie as with PlayMovieURL by the way.
Edit: We're using QCAR 1.5.3 beta on Android, 1.5.4 beta on iOS, and Unity 3.4.2f3.
Thanks a lot in advance!