Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to use MediaStream Recording
    primarykey
    data
    text
    <p>Ok, I'm going to try and make my question as clear as possible, but I'm pretty confused, so let me know if I'm not getting the message across. </p> <p>I'm trying to use getUserMedia to use the webcam, and then use this</p> <p><a href="http://www.w3.org/TR/mediastream-recording/" rel="nofollow noreferrer">http://www.w3.org/TR/mediastream-recording/</a></p> <p>to record a brief captured video. Problem is, when I try to define new MediaRecorder(stream), I'm told that it is undefined. I haven't used this api before, so I don't really know what I'm missing. Here is the relevant code:</p> <pre><code>function onVideoFail(e) { console.log('webcam fail!', e); }; function hasGetUserMedia() { return !!(navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia); } if (hasGetUserMedia()) { window.URL = window.URL || window.webkitURL; navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia; if (navigator.getUserMedia) { navigator.getUserMedia({video: true, audio: false}, function(stream){ var video = document.querySelector('video'); var recorder = new MediaRecorder(stream); &lt;&lt;&lt;&lt;&lt;&lt; THIS IS MY PROBLEM SPOT video.src = window.URL.createObjectURL(stream); video.play(); // webcamstream = stream; // streamrecorder = webcamstream.record(); }, onVideoFail); } else { alert('failed'); } } else { alert('getUserMedia() is not supported by this browser!!'); } </code></pre> <p>I've been trying to look at this for reference:</p> <p><a href="https://stackoverflow.com/questions/16319470/html5-getusermedia-record-webcam-both-audio-and-video">HTML5 getUserMedia record webcam, both audio and video</a></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload