","upvoteCount":4},{"@type":"Answer","text":"Simba worked","upvoteCount":3},{"@type":"Answer","text":"Shahid Gul I suggest you to look at the Excellent answer by [user id=\"4354920\"]Calviղ[/user]","upvoteCount":3},{"@type":"Answer","text":"https://code.sololearn.com/WHQmb1R2Zt4J/?ref=app","upvoteCount":2},{"@type":"Answer","text":"https://www.sololearn.com/Discuss/159891/?ref=app","upvoteCount":2},{"@type":"Answer","text":"Do a simple thing using audio tag play you music without controls . Using loop and autoplay","upvoteCount":2},{"@type":"Answer","text":"ironman not working bro","upvoteCount":2},{"@type":"Answer","text":"F҉R҉O҉N҉T҉ 🔚& 🔙🔚/ 𝔸𝕣𝕕𝕦𝕚𝕟𝕠 Lover it doesn't work for me","upvoteCount":1},{"@type":"Answer","text":"please inform me if it doesn't work and the audio enter your own audio with the appropriate file extension","upvoteCount":1},{"@type":"Answer","text":"follow me for more!","upvoteCount":1},{"@type":"Answer","text":"moses sure..","upvoteCount":1},{"@type":"Answer","text":"audio tag","upvoteCount":1},{"@type":"Answer","text":"","upvoteCount":1},{"@type":"Answer","text":"Pranjal Gupta autoplay is not working.. autoplay is disabled in chrome Firefox browsers.. we need to add j.s to enable autoplay","upvoteCount":1}]}
}
Shahid Gul try this👇
HTML:
<audio id = "Any name">
<source src = "audio link ">
</audio>
JS:
window.addEventListener('click', function () {
var audio = document.getElementById("Any name");
audio.play();
}
click screen to hear the music👍
16th Jun 2020, 12:37 PM
Simba
+ 12
I think this code check
<embed name="myMusic" src="Masgon.mp3" type="audio/midi" autostart="false" Hidden="true" loop="true"></embed>
16th Jun 2020, 2:43 AM
IRONMAN
+ 6
I hope this help , kindly up-vote if it does;
<audio autoplay loop>
<Source src="you audio source on your comp.mp3" type="audio/mp3>
Your browser does not support audio file!
</audio>
Ps: you can use the source tag for different audio type , so if one doesn't load on the website another type will load
15th Jun 2020, 12:51 PM
AKANDE OLUWATOSIN TEMITOPE
+ 6
Like this👇
<audio autoplay>
<source src="horse.ogg" type="audio/ogg">
<source src="horse.mp3" type="audio/mpeg">
</audio>
If you want to add controls for audio, add "controls" into audio tag.
16th Jun 2020, 1:45 PM
Sahan Dakshitha
+ 5
make sure your audio is supported by the browser and don't use internet explorer for your projects because it does not support alot of web programming features I suggest using google chrome because it has the fastest javascript engine V8.
<audio controls>
<source src="audio.mp3" type="audio/mpeg">
<source src="audio.ogg" type="audio/ogg">
Audio element not supported by your browser.
</audio>
17th Jun 2020, 1:07 AM
Richard Rodríguez
+ 1
Pranjal Gupta autoplay is not working.. autoplay is disabled in chrome Firefox browsers.. we need to add j.s to enable autoplay