Playing Multiple Videos with New Video class

Hello Devs,

As we know with Unity 5.6 there is a Video class to handle video playback in cross platform. We decided to test this new component. We want to play 3 videos in a row and without any break in the middle when changing video. But everytime one video is completing it takes some time to load another.

It’s obvious that it’s taking little time load and prepare the video before playback. Is there any workaround with this new video class to pre-load the next video that we want to play without any delay to make the continuous feeling.

Here is the code currently we are testing with:

============================================

public VideoClip _videoClip; // Holds all the video clips in array

public VideoPlayer videoPlayer ; // This is responsible for playing the clip

public virtual void PlayVideo ()
{

	if (count < _videoClip.Length) 
	{
		videoPlayer.Play ();
		isVideoStarted = true;
	} 
	else 
	{
		count = 0;
		isVideoStarted = false;
		Debug.Log ("Video ended");
	}

}

==============================================

What we are doing - every time a video is completing we are assigning new video clip to the player. Any idea or suggestion will be helpful.

Any Idea?

Hi @niraj_dat, I have the same problem.
I’ve tried various solutions without success:

Added multiple VideoPlayer component to an object (with different clips) and Prepare() all.
It seems a good solution, but when the first video starts to play, all the other players become unprepared. (the video player API is not documented, so from outside it seems like a bug)

What I had to do at the end is to create a large video and seek to different positions. With the I can create loops and jump out of them… obviously this not a solution, but it worked in my case.

Any suggestion appreciated.

Hey Folks,

Same issue here. I’m trying to make “choose your path” type experience but I seem to be running into load time issues, and lag in the footage even once its loaded. I’m event running into a weird issue where the footage will jump to the first shot and then just not display the footage even though the frames are incrementing in the background.

Did either of you have any luck with this? Or learn anything new about the VideoPlayer?

@niraj_dat @samubence

Hi

The way I solved this was creating two identical game objects, each with a video player and while one is playing one clip the other starts preparing the next. Then at the end of the first clip disable the first game object, enable the second one and start playing.

Using a script to switch back and forth between two video players the break is almost imperceptible.

Hope that helps.