Bug 252063 - [GStreamer] Don't emit playbackStateChanged() event after a seek
Summary: [GStreamer] Don't emit playbackStateChanged() event after a seek
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Enrique Ocaña
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2023-02-10 10:23 PST by Enrique Ocaña
Modified: 2023-02-15 09:06 PST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Enrique Ocaña 2023-02-10 10:23:47 PST
It is not possible to pause the playback during a seek. Sink elements lose their states entering ASYNC PAUSED->PAUSED transition. Calling HTML video.pause() during a seek doesn't result in pipeline state change call as player reports it's paused already. Forcing gst_element_set_state() doesn't really help in this case as pipeline enters inconsistent state after a seek that everything is playing but sinks are paused.

In addition, triggering playbackStateChanged() at seek end causes HTMLMediaElement::playInternal() that cleans up all signs of previous pause() call.

Don't emit playbackStateChanged() at seek end so HTML won't force playInternal() and HTMLMediaElement will call pauseInternal() again after a seek (from updatePlayState()).

This fixes following scenario:

video.currentTime = x.xx
video.play();
setTimeout(()=>{ video.pause(); }, 1} // ensure async duringn a seek (video didn't pause after initial seek had finished)

See: https://github.com/WebPlatformForEmbedded/WPEWebKit/pull/1013
Comment 1 Enrique Ocaña 2023-02-10 10:36:04 PST
Pull request: https://github.com/WebKit/WebKit/pull/9934
Comment 2 EWS 2023-02-15 09:05:55 PST
Committed 260314@main (5d8787383e48): <https://commits.webkit.org/260314@main>

Reviewed commits have been landed. Closing PR #9934 and removing active labels.
Comment 3 Radar WebKit Bug Importer 2023-02-15 09:06:20 PST
<rdar://problem/105498934>