I am currently utilizing a JavaScript utility to stream mp3 content. Unfortunately, there are instances where I direct users to a file that cannot be played due to external factors. In such cases, Firebug displays an error message indicating that the file could not be decoded.
The media resource https://example.com/bad_file.mp3 was unable to be decoded.
https://i.stack.imgur.com/Sfwz7.png
Check out the issue in action on jsfiddle by clicking here
Considering that replacing the files is not within my scope of control, I am seeking a method to determine whether a file is playable or not. Although the framework supplies an onerror()
function for handling script loading failures, it lacks a solution for identifying unplayable files.
While a response tailored to SoundManager2 would be acceptable, I am more interested in a resolution independent from any specific library or platform.