<html>
    <head>
      <base href="https://bugs.webkit.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - videoWidth and videoHeight are 0 when using Mock Capture Devices and a muted video track"
   href="https://bugs.webkit.org/show_bug.cgi?id=174810">174810</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>videoWidth and videoHeight are 0 when using Mock Capture Devices and a muted video track
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>WebKit
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>Safari Technology Preview
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Macintosh
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>macOS 10.12.4
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>Normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P2
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Media Elements
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>webkit-unassigned@lists.webkit.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>adam@tokbox.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>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: <a href="https://output.jsbin.com/kokeqob">https://output.jsbin.com/kokeqob</a>

navigator.mediaDevices.getUserMedia({
  audio: true,
  video: true
}).then(stream => {
  stream.getVideoTracks()[0].enabled = false;
  const vid = document.createElement('video');
  vid.srcObject = stream;
  document.body.appendChild(vid);
  checkVideoDimensions(vid);
  vid.play();
}).catch(err => {
  console.error(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.</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>