How to play a m4a/mp3 file via html file

There is licensing issue playing m4a formats in modern browsers

So your browser’s console will generate something as the following:

Cannot play media. No decoders for requested formats: audio/m4a

Just use mp3, here is example:

Download mp3 sample and insert it into your html file:

wget https://file-examples.com/wp-content/uploads/2017/11/file_example_MP3_700KB.mp3
cat test.html
<audio controls="controls">
<source src="file_example_MP3_700KB.mp3" type="audio/mp3" />
</audio>

 

 

Source: https://stackoverflow.com/questions/43792396/firefox-plays-no-m4a-audio-file-from-the-internet-localhost-is-working
Source: https://file-examples.com/index.php/sample-audio-files/sample-mp3-download/

Similar Posts:

Leave a Reply

Your email address will not be published. Required fields are marked *