HTML5 audio problems - html

I have a HTML5 audio player on my website, it is not working, however it works in all browsers except chrome.
<audio controls>
<source src="http://www.mywebsite.com/path/2015-09-27.mp3" type="audio/mpeg">
</audio>
However a week or more ago the audio files did work, and I didn't change anything, they just stopped being able to be played.

I had the same problem with a mp3 file. I converted the *.mp3 file to *.ogg (e.g. with Audacity) and added a second source to the audio tag:
<audio controls>
<source src="file.mp3" type="audio/mpeg">
<source src="file.ogg" type="audio/ogg">
Your browser does not support the audio element.
</audio>
Now everything works fine.
(found at W3Schools)

Related

How to add audio to ios

In my website I have audio and I use the audio tag and controls and all that but the thing is when I try to play audio on my iphone (im using chrome), it doesn't play and it just says the length of the audio is 0:00... The audio file is 40megabytes so idk if that may be an issue...
Here is my code:
<audio controls>
<source src="audio/example4-17.m4a" type="audio/mpeg">
<source src="audio/example-4-17.mp3" type="audio/mpeg">
</audio>

HTML audio won't play file but download works

I feel like I have tried everything.
I have the following:
<audio controls ng-src="https://myS3routeToFile" class="w-full"></audio>
I have also tried the following variation:
<audio controls>
<source src="https://myS3routeToFile" type="audio/mpeg">
Your browser does not support the audio element.
</audio>
I am able to press download it does download the file correctly.
What am I doing wrong?
Use the second version and add an ogg version of your audio file to make it complatble with all browsers.
<audio controls>
<source src="your_file.ogg" type="audio/ogg">
<source src="your_file.mp3" type="audio/mpeg">
</audio>

No mouse responce on html audio (windows app ionic)

I build an app for android and windows (universal app) but i can't figure out why the audio doesn't work for windows app, it work perfectly on browser and android.
<audio controls="true">
<source src="/www/audio/FRCath.mp3" type="audio/mpeg">
</audio>
With the code above i got the player but nothing happen if i hit the play button. The player display the correct duration of the file, so the path must be good.
And this code work perfectly on edge.
edit: it work when i use my keyboard but the player doesn't respond to the mouse.
<ion-view cache-view="false" view-title="audio">
<ion-content sroll="false">
<audio controls>
<source src="/www/audio/FRCath.mp3" type="audio/mpeg">
</audio>
<audio controls>
<source src="http://www.scricciolo.com/eurosongs/Phylloscopus.inornatus.wav" type="audio/mpeg">
</audio>
</ion-content>
</ion-view>
You can do like this...you can remove the true attribute from the audio tag. And i don't know whether i am correct or not but i think your sound file is wrong somewhere, that's why i have used a different sound file.
<audio controls>
<source src="http://www.scricciolo.com/eurosongs/Phylloscopus.inornatus.wav" type="audio/mpeg">
</audio>

Playing audio from an internal location on iPhone

I have a simple site which I want to play audio on iPhone safari. It has only the following code:
<audio style="height:77px;" controls>
<source src="horse.mp3" type="audio/mpeg">
Your browser does not support the audio element.
</audio>
Note the src is local. This does not play the audio
However if I change the source to something external such as this...
<audio style="height:77px;" controls>
<source src="http://www.w3schools.com/html/horse.mp3" type="audio/mpeg">
Your browser does not support the audio element.
</audio>
It works perfectly.
It's worth pointing out both methods work fine on desktop, on iPhone only the external src works.
Any ideas for why this may be happening?

IE9 and the <audio> tag

I have a 100% valid html5 document, on every other browser on every OS, there are no problems, but on IE9, I always just get the black rectangle with a red cross on it instead of audio player. I thought that it might be conflicting somehow with the activeX.
Thanks.
<audio controls="controls">
<source src="/files/NRUPPLYSNINGEN_XTRA.mp3" type="audio/mp3">
<source src="/files/NRUPPLYSNINGEN_XTRA.wav" type="audio/wav">
<source src="/files/NRUPPLYSNINGEN_XTRA.ogg" type="audio/ogg">
Your browser does not support this audio format.
</audio>
Maybe a silly question, but could it be that the path to the audio files are not correct?
Chrome renders the audio player nicely even if the audio files cannot be found. However, IE9 does not seem to do that.
If I replace the audio file with a working one then the cross goes away and everything works fine.
<audio controls="controls">
<source src="http://open.is/jQueryMusicPlayer/betty.mp3" type="audio/mp3">
Your browser does not support this audio format.
</audio>​
Try it: http://jsfiddle.net/PFTaN/