Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

audio/mpeg detected as video/webm or video/mp4 #599

Closed
bramvbilsen opened this issue May 16, 2023 · 2 comments
Closed

audio/mpeg detected as video/webm or video/mp4 #599

bramvbilsen opened this issue May 16, 2023 · 2 comments
Labels
cannot reproduce The issue described cannot be reproduced

Comments

@bramvbilsen
Copy link

Very similar to this issue #488.

I am using the MediaRecorder API to record audio in the audio/mpeg format. Upon checking the mimetype using file-type, I get either video/mp4 on Safari and video/webm on all other browsers.

As I do not support video uploads, it is an easy workaround. But a workaround nonetheless.
Is this something others can reproduce as well?

@Borewit Borewit added the cannot reproduce The issue described cannot be reproduced label Oct 23, 2023
@Borewit
Copy link
Collaborator

Borewit commented Nov 10, 2023

I close the issue as this cannot be reproduced.

@Borewit Borewit closed this as completed Nov 10, 2023
@ThePendulum
Copy link

ThePendulum commented Dec 12, 2023

Same issue here. I initially thought it had to do with using 16.5.4 for CommonJS compatability, but 18.x still seems to identify them as video/webm

chrome.webm
firefox.webm

The Magic-Bytes.js demo does come up with audio/webm for these files, but instead of video/webm, it seems to be struggling to distinguish it from Matroska instead.

This is the code I used to record it:

navigator.mediaDevices.getUserMedia({ audio: true }).then((stream) => {
    let chunks = [];

    mediaRecorder.value = new MediaRecorder(stream, {
        mimeType: 'audio/webm',
    });

    mediaRecorder.value.addEventListener('dataavailable', (event) => chunks.push(event.data));

    mediaRecorder.value.addEventListener('stop', () => {
        const blob = new Blob(chunks, { type: 'audio/webm' });
        const audioUrl = URL.createObjectURL(blob);

        console.log(audioUrl); // save or set as player src

        chunks = [];
    });
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cannot reproduce The issue described cannot be reproduced
Projects
None yet
Development

No branches or pull requests

3 participants