[5.6.0b1] VideoPlayer API go to specific frame

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

Hi!

On Windows (for H.264-based codecs) and for all platforms (for webm), we did find that the seek was broken in a recent test pass. This will be fix in a future beta. Can you let us know what platform you are working on, just so we’re sure this really is the same bug?

Thanks for reporting this!

Dominique

Hi!

I tried on a Windows 10 64bits machine in the Unity Editor and a PC Standalone build and it doesn’t work.

I launched the same project on a Mac and it works so I assume it’s the same bug.

Thanks
Bulwark Studios

It’s been a few months – any update on this? We really, really need this feature, and it’s silly that it works fine on the Mac in development but not at all on our PC builds.

3 Likes