I am trying to play a large video on a unity webgl build. Im using VideoPlayer component and video source is a URL. The video plays but is very jittery and keeps getting stuck. My internet speed is decent. Is there a way to pre-buffer the video before playing? And if so, are there delegates or events to notify you when buffering is complete?
Here is what my code is doing:
First I assign event callback to start video when it is prepared. I call Prepare on Start. Then I play the video once prepared.
void Start()
{
video_player.Prepare();
}
void OnEnable ()
{
video_player.prepareCompleted += VideoPrepared;
}
void OnDisable ()
{
video_player.prepareCompleted -= VideoPrepared;
}
void VideoPrepared (VideoPlayer vPlayer)
{
//Code to play video
video_player.Play();
}