Search completed in 1.23 seconds.
Recording a media element - Web APIs
corder now let's look at the most intricate piece of code in this example: our event handler for clicks on the start button: startbutton.addeventlistener("click", function() { navigator.mediadevices.getusermedia({ video: true, audio: true }).then(stream => { preview.srcobject = stream; downloadbutton.href = stream; preview.capturestream = preview.capturestream || preview.
mozcapturestream; return new promise(resolve => preview.onplaying = resolve); }).then(() => startrecording(preview.capturestream(), recordingtimems)) .then (recordedchunks => { let recordedblob = new blob(recordedchunks, { type: "video/webm" }); recording.src = url.createobjecturl(recordedblob); downloadbutton.href = recording.src; downloadbutton.download = "recordedvideo.webm"; log("...
...then, in line 8, we arrange for preview.capturestream() to call preview.
mozcapturestream() so that our code will work on firefox, on which the mediarecorder.capturestream() method is prefixed.
HTMLMediaElement - Web APIs
htmlmediaelement.
mozcapturestream() [enter description] htmlmediaelement.
mozcapturestreamuntilended() [enter description] htmlmediaelement.mozgetmetadata() returns object, which contains properties that represent metadata from the playing media resource as {key: value} pairs.