Closed Bug 1708123 Opened 6 months ago Closed 6 months ago

Confusing error message when recording audio with unrecognized media type

Categories

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

Firefox 90
defect

Tracking

()

RESOLVED FIXED
90 Branch
Tracking Status
firefox90 --- fixed

People

(Reporter: dominique.hazael-massieux, Assigned: karlt)

References

Details

Attachments

(2 files)

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:90.0) Gecko/20100101 Firefox/90.0

Steps to reproduce:

Quoting from https://github.com/mdn/content/issues/3317#issue-836807601, the following code
navigator.mediaDevices.getUserMedia({audio: true}).then((stream) => {

var mediaRecorder = new MediaRecorder(stream, {mimeType: 'audio/mp4'});

mediaRecorder.ondataavailable = function(event) {
    var blob = event.data;
    if (blob && blob.size > 0) {
        sendBlobToServer(blob);
    }
};

mediaRecorder.start(5000);

})

Actual results:

It raises an error saying "Video cannot be recorded with audio/mp4 as it is an audio type" (from https://github.com/mozilla/gecko-dev/blob/be413c29deeb86be6cdac22445e0d0b035cb9e04/dom/media/MediaRecorder.cpp#L225)

Expected results:

The problem is actually that audio/mp4 is not accepted by Firefox as a coded for MediaRecorder, since replacing "audio/mp4" with "audio/webm" works.

The error message should be fixed in that situation to say that audio/mp4 is not available to record audio.

The Bugbug bot thinks this bug should belong to the 'Core::Audio/Video: Recording' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.

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

Guessing this is during MediaRecorder construction and comes from IsTypeSupportedImpl(), which may be able to do a better job of merging the two TypeSupports.

Severity: -- → S3
Status: UNCONFIRMED → NEW
Ever confirmed: true
See Also: → 1512175
Assignee: nobody → karlt
Status: NEW → ASSIGNED
Pushed by ktomlinson@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/0ba3efcd5023
choose the better message on lack of MIME type support in MediaRecorder constructor r=jib
https://hg.mozilla.org/integration/autoland/rev/3a418c38c3e4
test MediaRecorder constructor error messages r=jib
Status: ASSIGNED → RESOLVED
Closed: 6 months ago
Resolution: --- → FIXED
Target Milestone: --- → 90 Branch
You need to log in before you can comment on or make changes to this bug.