title: Get data URL from video stream?
body: <p>I have a video (webm) capture script that works fine. It records video then offers it as a download. The pertinent part of the code is this:</p>
  
  <pre><code>stopBtn.addEventListener('click', function() {
      recorder.ondataavailable = e =&gt; {
          ul.style.display = 'block';
          var a = document.createElement('a'),
              li = document.createElement('li');
          a.download = ['video_', (new Date() + '').slice(4, 28), '.'+vid_format].join('');
          a.textContent = a.download;
          a.href = URL.createObjectURL(stream); //&lt;-- deprecated usage?
          li.appendChild(a);
          ul.appendChild(li);
      };
      recorder.stop();
      startBtn.removeAttribute('disabled');
      stopBtn.disabled = true;
  }, false);
  </code></pre>
  
  <p>This works, as I say. However, the console says that passing media streams to <code>URL.createObjectURL</code> is deprecated, and I should use HTMLMediaElement <code>srcObject</code> instead.</p>
  
  <p>So I changed it to:</p>
  
  <pre><code>a.href = URL.createObjectURL(video.srcObject);
  </code></pre>
  
  <p>...and although everything still works, I get the same warning.</p>
  
  <p>Does anyone know how I can get a URL or blob data without this deprecated way?</p>
  
  <p>I have also tried reading the <code>src</code> and <code>currentSrc</code> properties from the video element, but they come back empty where a stream is involved.</p>