[Webkit-unassigned] [Bug 174810] New: videoWidth and videoHeight are 0 when using Mock Capture Devices and a muted video track

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Jul 24 20:33:56 PDT 2017


            Bug ID: 174810
           Summary: videoWidth and videoHeight are 0 when using Mock
                    Capture Devices and a muted video track
           Product: WebKit
           Version: Safari Technology Preview
          Hardware: Macintosh
                OS: macOS 10.12.4
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: Media Elements
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: adam at tokbox.com

If you have a muted video track with real devices you still get the correct videoWidth and videoHeight on the video element. However if you are using the Mock Capture Devices then you get 0x0.

Here is some sample code to reproduce the problem: https://output.jsbin.com/kokeqob

  audio: true,
  video: true
}).then(stream => {
  stream.getVideoTracks()[0].enabled = false;
  const vid = document.createElement('video');
  vid.srcObject = stream;
}).catch(err => {

function checkVideoDimensions(vid) {
  const showDimensions = () => {
    videoWidth.innerHTML = vid.videoWidth;
    videoHeight.innerHTML = vid.videoHeight;

  vid.addEventListener('loadedmetadata', showDimensions);
  vid.addEventListener('timeupdate', showDimensions);
  setInterval(showDimensions, 2000);

If you visit that URL and allow access to your camera using real devices you will see that videoWidth and videoHeight are 640x480. However if you choose the Mock Capture Devices option then you get 0x0.

You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20170725/b2ab36a7/attachment.html>

More information about the webkit-unassigned mailing list