Hello. I am really struggling to grasp how instant playback might work with Video API. I am using the “Prepare()” approach, because I’m happy for my game to stall for a few frames while video prepares, but always, I get a blank/black frame flicker on screen as soon as video starts.
Is this just how it works, or am I doing something categorically wrong? I’ll share the code that matters in this case.
My game uses 3D models on 2D pre-rendered backgrounds and sometimes those backgrounds switch into video which is why I need instant with no perceivable delay or flickers.
I am taking this approach
videoPlayer.prepareCompleted += OnPrepareCompleted;
videoPlayer.Prepare();
yield return new WaitUntil(() => hasPrepared);
// Background off
// Video UI RawImage with RenderTexture on
videoPlayer.Play();
OnPrepareCompleted as follows:
private void OnPrepareCompleted(VideoPlayer source) {
hasPrepared = true;
}
Is this just how it works when you use Video? Do I just have to assume delays?