5

I've got an m4a file that loads properly in all browsers, except for Internet Explorer (no surprise). The error is: "Invalid source".

My HTML5 code looks like this:

<audio controls>
  <source src="../music/music.m4a" type="audio/aac">
  Your browser does not support the audio element.
</audio>

I have also tried replacing the extension aac with m4a, like so:

<audio controls>
  <source src="../music/lasthymn.m4a" type="audio/m4a">
  Your browser does not support the audio element.
</audio> 

Unfortunately, this still returns the "Invalid source" error... how can we fix this?

1

The problem would seem to be that you are specifying an unsupported/invalid mime-type in the type attribute. (See IE audio object - Scroll down for the supported mime-types.)

If this is AAC in an MP4 container then the correct mime-type should probably be audio/mp4.

Internet Explorer does not appear to be able to handle an incorrect mime-type, whereas other browsers are far more tolerable. In fact Chrome seems to be able to play the media regardless of what "type" you try to say it is.

1

Fixed the issue by using the following HTML5 markup:

<audio src="music.m4a" controls></audio>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.