Closed bramvbilsen closed 10 months ago
I close the issue as this cannot be reproduced.
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
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 = [];
});
});
Very similar to this issue https://github.com/sindresorhus/file-type/issues/488.
I am using the MediaRecorder API to record audio in the
audio/mpeg
format. Upon checking the mimetype usingfile-type
, I get eithervideo/mp4
on Safari andvideo/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?