Bug 219399 - [Media] Play promise rejection in HTMLMediaElement
Summary: [Media] Play promise rejection in HTMLMediaElement
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-12-01 08:23 PST by ArekW
Modified: 2021-02-09 22:09 PST (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ArekW 2020-12-01 08:23:04 PST
The HTMLMediaElement rejects play promise when the webpage's playback call sequence is:

1) create a video element
2) call video.play()
3) sets the src attribute

That sequence in WPEWebkit is not handled correctly. Setting the src attribute results in play promise rejection. I have compared that with chromium and it handles that situation in a different way.

The algorithm is described here:
https://html.spec.whatwg.org/multipage/media.html#media-element-load-algorithm

In the chromium the HTMLMediaElement cancels events, resolve promises that are scheduled to be resolved and rejects play promises that are scheduled to be rejected (Step 3 and 4). The rest of the play promises are not touched (unless step 6 takes place).

In webkit's step 3: all events and promises are rejected. It is done by cancelPendingEventsAndCallbacks.
Comment 1 Radar WebKit Bug Importer 2020-12-07 11:19:27 PST
<rdar://problem/72055839>