The support for MediaRecorder is well established across browsers since 2021 (according to MDN) but if you record Audio / Video with it then the resulted binary might have no duration metadata in the container or even if it has the duration, sometimes it is not accurate
How so? because browser doesn’t know how much the duration would be in the first place and container metadata is placed in the first binary, so browser skip that part or leave it undefined and might not rewrite that part at the end (depending on the container type that you choose & how you start MediaRecorder) because the spec does not say explicitly about how container metadata (such as duration) behave for MediaRecorder, so it is not reliable
Furthermore in the newer version of Safari & Chrome, they tend to output Fragmented MP4 (fMP4) instead of normal MP4, thus in some media player sometimes it display 0 duration and the media might not be playable
If you want the output to be reliable, compatible and playable across all media player available on earth then you should always do post-processing on the Audio / Video binary to fix and standardize the media output
You can do post-processing on the browser with ffmpeg-wasm, or simply use fix-webm-duration if you always use webm container or you can reliably fix it with ffmpeg in the server without bloating the Front-End code
![]()