- Home /
How can I prevent users from skipping video by leaving the app and coming back?
Our Unity app shows videos to users and asks them questions about the video they just saw. We don’t want users to skip the video, so I turned off the controls like so:
protected IEnumerator CoroutinePlayMovie(string __mediaUrlStr)
{
Handheld.StartActivityIndicator();
yield return new WaitForSeconds(0.1f);
Handheld.PlayFullScreenMovie (__mediaUrlStr, Color.black, FullScreenMovieControlMode.Hidden, FullScreenMovieScalingMode.AspectFit);
yield return new WaitForSeconds(0.1f); //Allow time for Unity to pause execution while the movie plays.
Handheld.StopActivityIndicator();
Debug.Log ("MOVIE COMPLETE!!!");
ViewToMediatorSig.Dispatch(PrefabIdStr, "switchview");
}
The problem is if the user has to switch to another app, the video stops playing even though it's not over and Unity thinks it's done playing so the code moves them along to the questions as if they have viewed the entire video.
What I would like is if the video player behaved like the video player in the Unity Ads where the user cannot skip the ad, and if the user leaves the app and comes back the video is still where they left off, forcing them to finish the video. Is this possible with anything in Unity? Is there anyway we can access the video player being used by Unity ads? Or de we have to write native plugins to do what we need?
I tried the prime31 plugin hoping it would help, and it sort of does. If you leave the video while it's playing but don't go into another app, it works great. The video picks up where you left off. BUT if you did open another app, the video is locked at that frame where you left it and there is no way for the user to close the video because of the hidden controls. I contacted prime31 as well to see if there is a possible solution, and if there is I will post it here.
I also want to say this can be repeated on Android using the back button while the video is playing.
Your answer
Follow this Question
Related Questions
Videoclip codec for mobile devices 0 Answers
Unity Video ads closing when player leaves app. 0 Answers
Unity Camera roll on iOS - access information about photos and videos 0 Answers
Playing a fullscreen movie in iOS without Pro version 1 Answer
Best Paying Interstitial Video Ads with Unity Bindings 1 Answer