1
\$\begingroup\$

Put an MP4 movie in your StreamingAssets folder and play it with

Handheld.PlayFullScreenMovie("MyMovie.mp4", Color.black, FullScreenMovieControlMode.CancelOnInput);

Then, in the middle of the movie, go to the home screen and then go back to the game. The video is paused.

You can't resume it because upon tapping the screen the video will disappear because of the CancelOnInput parameter (which I want to keep).

So - how can I make it so when the player returns to the game, the video resumes? I don't want to show video controls.

I am using Unity Pro 5.4.2, running on an iPhone 7 with iOS 10.1.

\$\endgroup\$
2
  • \$\begingroup\$ Hi, did you ever find a solution for this issue? We are also encountering it. Thanks. \$\endgroup\$
    – Benzino
    Jul 10, 2017 at 15:13
  • 1
    \$\begingroup\$ @Benzino Hello, Unity has a new component called Video Player. Create a game object with it like this i.imgur.com/J0QzfLK.png, set the audio source property and then set the render mode property to camera far plane or whatever works for you. \$\endgroup\$
    – Oxide
    Jul 11, 2017 at 15:15

1 Answer 1

1
\$\begingroup\$

All I can offer is a workaround.

Use Object.DontDestroyOnLoad to make the object persistent. Pause the video, and after detecting which screen I am in, if it is the main menu:

if (SceneManager.GetActiveScene().buildIndex == 0) //main menu
{
   GetComponent(MeshRenderer).enabled = false; //hide the video.
}
if (SceneManager.GetActiveScene().buildIndex == 1) //game screen
{
   GetComponent(MeshRenderer).enabled = true; //also play the movie
}

You can also keep some Player Preferences and pull it in to other scenes to destroy the persistent video, when you don't need it.

\$\endgroup\$
1
  • \$\begingroup\$ You seem to infer using PlayerPrefs to store the video; you can not store a video via PlayerPrefs, or atleast, not the default PlayerPrefs. You could store the reference (to either local or online) as a string, perhaps that is what you meant? \$\endgroup\$
    – Gnemlock
    Jan 24, 2017 at 9:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .