Hello!
Thanks for the new VideoPlayer API.
I’m trying to jump in a video at some specifics frames (forward or backward of the current frame) of a video with an UIButton.
The problem is when I try to set the VideoPlayer.frame or VideoPlayer.time property, the RawImage that display the video is not updated. Only the first frame of the video is displayed.
When I log the player.frame and player.time, their values are correctly updated.
Also I tried to use the StepForward() method and it works great.
Is there a way to update the render when setting a specific frame ?
There is my test script :
public class VideoAPITest : MonoBehaviour {
public VideoPlayer player;
public RawImage rawImage;
void Start () {
player.prepareCompleted += PrepareCompleted;
player.Prepare();
player.playbackSpeed = 1f;
}
void PrepareCompleted(VideoPlayer videoPlayer) {
player.prepareCompleted -= PrepareCompleted;
Debug.Log("frameCount " + player.frameCount);
player.frame = 200;
//player.Play();
player.Pause();
//player.Stop();
}
public void OnBtnClick() {
Debug.Log("frame " + player.frame);
Debug.Log("time " + player.time);
player.frame += 30;
//player.Pause();
//player.time += 1d;
//player.StepForward();
}
}
Thank you!
Bulwark Studios