Reading the basic error signal
When a <video> or <audio> element fails to play, the first place to look is the MediaError object exposed via the element's error attribute. Its code property returns a numeric constant that groups the failure into a broad category, and message may carry a browser-provided diagnostic string.
These two fields are primarily useful for telemetry. Because decoder implementations differ in what they classify as an error—hardware decoders tend to be the most strict, especially when a stream relies on less common codec features—the high-level code is often too coarse to pinpoint the actual problem. For privacy reasons, browsers may also deliberately omit parts of the error text.
Getting the full log in DevTools
For complete failure details, open Chrome DevTools' Media Panel. It logs the full sequence of media events, warnings, and error messages during playback, giving you a much clearer view of what went wrong than the MediaError attribute alone.
Verifying file integrity with FFmpeg
If the stream itself is suspect, the open-source FFmpeg tool can check the integrity of a media file using its error-detection flags:
ffmpeg -err_detect explode -i input.mp4 -f null -
Running this against a file with an invalid codec produces diagnostic output such as:
[h264 @ 0x...] error while decoding MB 12 4
[h264 @ 0x...] concealing 320 DC, 320 AC, 320 MV errors
Inspecting the container structure
For bitstream-level problems, MP4Box.js offers an online ISOBMFF box structure viewer that renders the internal layout of an MP4 file. Using it effectively requires prior knowledge of the MP4 container format, but it can reveal structural corruption that decoders reject.
For professional production work, commercial stream analyzers such as VQAnalyzer, Elecard StreamEye, and Codecian CodecVisa provide deeper inspection and are commonly used in video engineering workflows.



