Support mp3 on Firefox MediaSourceExtension

I am implementing adaptive and progressive audio streaming in a browser without plugins. MSE is the HTML5 API that I expected, available in FF 42, but it doesn't seem to support audio formats in Firefox? ... mp3 audio does not work when using the MSE APIs.

Here's the code snippet:

var mediaSource = new window.MediaSource();
var audioSourceBuffer;

mediaSource.addEventListener('sourceopen', function (e) {
    try {
        var mimeType = "audio/mpeg";
        audioSourceBuffer = mediaSource.addSourceBuffer(mimeType);
    } catch (e) {
        log('Exception calling addSourceBuffer', e);
        return;
    }
}

I get a NotSupportedError exception when calling addSourceBuffer.

Does Firefox support mp3? from the list of supported MDN formats ( https://developer.mozilla.org/en-US/docs/Web/HTML/Supported_media_formats ) it means that mp3 support should be there if the OS supports this - and the tested OS (OSX) supports it .

Any help appreciated!

+4
2

, Mozilla, Media Source.

, MSE ( ), , , Audio Element. , Firefox mp3 Audio, mp3 , .

, Firefox MSE? , Firefox 42 fMP4 (Fragmented MP4). webm , , Firefox about: config. FMP4 mimeType Media Source : audio/mp4; = "mp4a.40.2"

, fMP4, , MPEG-4, , 12: "ISO Base Media File Format (ISOBMFF) /". , .

fMP4 - fMP4 .

!

+4

FF42 linux, , , , MDN (https://developer.mozilla.org/fr/docs/Web/API/MediaSource), MediaSource API .

: , , API MediaSource? MP4 webm. , MP3, , , .

0

Source: https://habr.com/ru/post/1616426/


All Articles