Bug 174152 - loadedmetadata is not emitted when video plays stream with disabled video track
Summary: loadedmetadata is not emitted when video plays stream with disabled video track
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebRTC (show other bugs)
Version: Safari Technology Preview
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
: 174408 (view as bug list)
Depends on:
Blocks:
 
Reported: 2017-07-04 23:52 PDT by Andrew Morris
Modified: 2017-08-29 17:02 PDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Morris 2017-07-04 23:52:05 PDT
Using this code in the console:

(async function() {
  const vid = document.createElement('video');
  const stream = await navigator.mediaDevices.getUserMedia({ video: true, audio: true });
  stream.getVideoTracks()[0].enabled = false;
  ['timeupdate', 'loadedmetadata'].forEach(evtName => vid.addEventListener(evtName, () => console.log(evtName)));
  document.body.appendChild(vid);
  vid.srcObject = stream;
})();

I expect that loadedmetadata should still occur for a stream with a disabled video track. 'loadedmetadata' is printed to the console in Chrome, Firefox, and Edge for this code (Edge code modified to not use await).

I'd also expect this to work when the <video> is muted as well, although I discovered that part was not necessary to repro loadedmetadata not getting emitted.
Comment 1 Radar WebKit Bug Importer 2017-07-07 13:27:06 PDT
<rdar://problem/33188613>
Comment 2 Eric Carlson 2017-07-12 11:19:18 PDT
*** Bug 174408 has been marked as a duplicate of this bug. ***