Closed Bug 1574805 Opened 2 years ago Closed 2 years ago

MediaRecorder records blob with wrong mimeType

Categories

(Core :: Audio/Video: Recording, defect)

68 Branch
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 1512175

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

Bugbug thinks this bug should belong to this component, but please revert this change in case of error.

Component: Untriaged → Audio/Video: Recording
Product: Firefox → Core

The spec was just updated with the throwing bit, and our implementation is not there yet. It will be implemented in bug 1512175.

Status: UNCONFIRMED → RESOLVED
Closed: 2 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 1512175

Thanks for letting me know. And sorry for being so impatient. :-)

You need to log in before you can comment on or make changes to this bug.