I embedded an audio on my web page with <embed> but there is a black background behind the player.
Why does this happen and how should I remove it? Or is there any other better way to embed the audio?
[<embed src="../audio/introduction.mp3" autostart="true" loop="true" bgcolor="" >]
This is how the audio player looks like:
https://i.stack.imgur.com/Ktr1P.png
If you are using HTML5 then <audio> tag is the best choice for you:
https://www.w3schools.com/tags/tag_audio.asp
<audio controls>
<source src="horse.ogg" type="audio/ogg">
<source src="horse.mp3" type="audio/mpeg">
Your browser does not support the audio element.
</audio>
We can use HTML5 Audio tag for this purpose instead of embed
<audio controls>
<source src="horse.ogg" type="audio/ogg">
<source src="horse.mp3" type="audio/mpeg">
Your browser does not support the audio element.
</audio>
Related
I am working with HTML5 audio. I have a question. Is it possible to play more than one audio on the same page, same time using HTML5 audio player ?
yes it's possible with multiple <audio> tags for example
<audio controls>
<source src="horse.ogg" type="audio/ogg">
<source src="horse.mp3" type="audio/mpeg">
</audio>
<audio controls>
<source src="horse.ogg" type="audio/ogg">
<source src="horse.mp3" type="audio/mpeg">
</audio>
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>
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 am using audio tag to play mp3 file in HTML 5 , rather i want to use video tag for HTML 5.
Is that possible and how can i do that?
<audio class="audio" id="c_step_1_audio" controls preload="none" style="display: none">
<source src="test.mp3" type="audio/mpeg">
</audio>
I want to do as follows
<video class="audio" id="c_step_1_audio" controls preload="none" style="display: none">
<source src="test.mp3" type="audio/mpeg">
</video>
This is neither recommended nor approved in any browser or W3C. But try it, might work some where if you are lucky.
<video width="320" height="240" controls>
<source src="test.mp3" type="audio/mpeg">
Your browser does not support audio in video tag.
</video>