Bug 225612 - Don't fire 'loadedmetadata' and 'canplay' events when re-attaching a video track to a MediaStream
Summary: Don't fire 'loadedmetadata' and 'canplay' events when re-attaching a video tr...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebRTC (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-05-10 14:12 PDT by Eric Carlson
Modified: 2021-05-17 14:13 PDT (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 Eric Carlson 2021-05-10 14:12:45 PDT
As noted in https://github.com/w3c/mediacapture-main/issues/453#issuecomment-837051373, if a page:

1. Assigns a MediaStream with an audio track and no video track to a video element.
2. Adds a video track to the MediaStream assigned in step 1.
3. Removes the video track from the MediaStream assigned in step 1.
4. Adds the same video track again to the MediaStream assigned in step 1.

WebKit fires "resize", "loadedmetadata" and "canplay" events on step 4.

readyState should not drop below HAVE_METADATA when the video track is removed, so it should not fire "loadedmetadata" when it is re-added.
Comment 1 Radar WebKit Bug Importer 2021-05-17 14:13:18 PDT
<rdar://problem/78121674>