Bug 219490 - [GStreamer] Seek on loadedmetadata is ignored
Summary: [GStreamer] Seek on loadedmetadata is ignored
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-12-03 08:04 PST by Alicia Boya García
Modified: 2021-02-15 10:26 PST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alicia Boya García 2020-12-03 08:04:12 PST
I was writing a test for an unrelated bug when I found this.

        const eventWatcher = new EventWatcher(test, video, ["loadedmetadata", "seeked", "ended"]);
        await eventWatcher.wait_for("loadedmetadata");
        assert_equals(video.videoWidth, 320, "width when the video is loaded");
        assert_equals(video.videoHeight, 240, "height when the video is loaded");
        video.currentTime = 5;
        video.play();
        await eventWatcher.wait_for(["seeked", "ended"]);

You would expect the video to start playing on t=5, but it starts on t=0 instead. That's a bug.
Comment 1 Alicia Boya García 2020-12-03 08:05:00 PST
This is in regular playback from an HTTP resource (not MSE).
Comment 2 Fernando Jiménez Moreno 2021-02-15 10:26:22 PST
I am not sure if this is exactly what you meant, but a test like this works for me:

```
        const video = document.querySelector('video');
        video.addEventListener('loadedmetadata', event => {
            console.log('onloadedmetadata received');
            console.log('Seeking to t=15');
            video.currentTime = 15;
            video.play();
        });
        video.addEventListener('seeked', event => {
            console.log('Seek received');
        });
```

The logs are properly shown and video starts at t=15 (if autoplay is allowed)