MediaRecorder records blob with wrong mimeType
Categories
(Core :: Audio/Video: Recording, defect)
Tracking
()
People
(Reporter: chrisguttandin, Unassigned)
Details
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36
Steps to reproduce:
const canvasElement = document.createElement('canvas');
canvasElement.getContext('2d');
const mediaStream = canvasElement.captureStream();
const mediaRecorder = new MediaRecorder(mediaStream, { mimeType: 'audio/webm' });
mediaRecorder.addEventListener('dataavailable', ({ data }) => console.log(data));
mediaRecorder.start();
setTimeout(() => mediaRecorder.stop(), 1000);
Actual results:
The code above will log a blob of type 'video/webm' to the console.
Expected results:
Calling mediaRecorder.start() should throw an error. The MediaRecorder is setup with a MediaStream that only contains a video track but is asked to encode 'audio/webm'. If I understand the spec correctly that should throw an error.
"For each track in tracks, if the User Agent cannot record the track using the current configuration, then throw a NotSupportedError DOMException and abort all steps."
This is step 8.2. of the algorithm which describes the start method of a MediaRecorder. https://w3c.github.io/mediacapture-record/#dom-mediarecorder-start
Comment 1•6 years ago
|
||
Bugbug thinks this bug should belong to this component, but please revert this change in case of error.
Comment 2•6 years ago
|
||
The spec was just updated with the throwing bit, and our implementation is not there yet. It will be implemented in bug 1512175.
Reporter | ||
Comment 3•6 years ago
|
||
Thanks for letting me know. And sorry for being so impatient. :-)
Description
•