I have an audio source like so:
<audio>
<source crossorigin="anonymous" src="https://c5.rbxcdn.com/978fe05256c23450b0c55c271ff9df58" type="audio/mpeg">
</audio>
But it never loads, and this is shown in the console:
GET https://c5.rbxcdn.com/978fe05256c23450b0c55c271ff9df58 net::ERR_CONTENT_DECODING_FAILED
Any idea? Doing a normal fetch() works fine with no cors errors or such.
It will work in video tag
<video controls="" autoplay="" name="media">
<source src="https://c5.rbxcdn.com/978fe05256c23450b0c55c271ff9df58" type="audio/mpeg">
</video>
Related
<audio controls autoplay loop >
<source src="media/Will.Smith-ft-Ludacris-Party.Starter.mp3" type="audio/mpeg">
<source src="media/Will.Smith-ft-Ludacris-Party.Starter.aac" type="audio/aac">
<source src="media/Will.Smith-ft-Ludacris-Party.Starter.oga" type="audio/ogg">
Youre Browser Dose Not Support Audio Tag
</audio>
I'm trying with IE, Chrome, Firefox but doesn't work.
what is wrong?
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>
I'm new to this forum and have looked at some previous answers, but can't find any that help.
I thought html5 audio was supposed to be simple?? i can't get it to work in either IE11 or Edge:
<audio controls autoplay>
<source src="music/Aranjuez.ogg" type="audio/mpeg">
<source src="music/Aranjuez.mp3" type="audio/ogg">
Your browser does not support the audio element
</audio>
What am I doing wrong?
You mixed up the file types:
<source src="music/Aranjuez.ogg" type="audio/mpeg">
<source src="music/Aranjuez.mp3" type="audio/ogg">
should be
<source src="music/Aranjuez.ogg" type="audio/ogg">
<source src="music/Aranjuez.mp3" type="audio/mp3">
I'm having a problem with the HTML5 video player, doesn't show the video, in a html file I have:
<video>
<source src="video.mp4" type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"' />
Video tag not supported.
<video>
I even tried without the codec atributte in chrome I gets nothing, only the black square of the reproductor
the file video.mp4 is inside the same folder of the html, it doesn't even show a preview, nothing!
It should work with HTML5 video tag perfectly. I've put an example for your reference.
<video controls="" autoplay name="media">
<source src="http://www.html5rocks.com/en/tutorials/video/basics/devstories.mp4" type="video/mp4;codecs="avc1.42E01E, mp4a.40.2"">
</video>
This should work perfectly:
<video width="300" height="200" controls>
<source src="movie.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>
I have a website and I can't seem to figure out why the audio autoplay is not working.
I do not have errors in the console.
The code seems perfectly fine.
The website is www.galloautocenter.com.br
<audio class="audio" loop autoplay="autoplay" controls>
<source src="1.ogg" type="audio/ogg"/>
<source src="1.mp3" type="audio/mpeg"/>
</audio>
Your code looks fine but try it like this. Also, you don't specify what browser you're using. IE 8 and below do not support the <audio> tag or any attributes.
<audio class="audio" controls autoplay loop>
<source src="1.ogg" type="audio/ogg"/>
<source src="1.mp3" type="audio/mpeg"/>
</audio>
You can use this
<iframe class="audio" loop autoplay controls>
<source src="1.ogg" type="audio/ogg"/>
<source src="1.mp3" type="audio/mpeg"/>
</iframe>
or if you wanna play in background then,
<iframe class="audio" loop autoplay style = "display:none;">
<source src="1.ogg" type="audio/ogg"/>
<source src="1.mp3" type="audio/mpeg"/>
</iframe>
I had proper solution for you. You must do any of this two steps.
Check your browser as shown on images, you had blocked Autoplay in browser.
Auto-Play Policy Changes for macOS
Autoplay policy in Chrome
New Policies for iOS
Allow or block media autoplay in Firefox
Second thing you can add this code to you any button on page
<!-- Html part-->
<audio class="audio" loop autoplay="autoplay" controls id="audioelement">
<source src="1.ogg" type="audio/ogg"/>
<source src="1.mp3" type="audio/mpeg"/>
</audio>
// JavaScript part
var myAudio = document.getElementById("audioelement");
myAudio.play();
It will not work on window.onload = function () { } etc. It will work only on elements where you can interact (Buttons). Or you must allow it in the browser.
<!-- Html part-->
<button onclick="PlayAudio()">PlayAudio</button>
// JavaScript part
function PlayAudio(){
var audio = document.getElementById("audioelement");
audio.play();
}
Third thing you can make player elements visible and user can start or stop music by himself.