+ 14
why autoplay is not working in the SOLOLEARN
This is my code here is not want to show the controls on want want audio to play automatically as a background music Thanks
14 Antworten
+ 3
<script src="https://cdnjs.cloudflare.com/ajax/libs/howler/2.1.2/howler.min.js"></script>
Use howler J's becoz it play music without any event listener
+ 2
ok ok I removed .mp3 and now link is correct but I have the problem of autoplay please suggest me
+ 2
ok ok after removing .mp3 my audio is playing, but by using controls, i want to use audio as background music and start it automatically.
So please help me with autoplay
+ 1
autoplay is deprecated because it was abused for malicious intent.
+ 1
So what I use in place of autoplay
+ 1
autoplay is not working friend
+ 1
okkkkkkkkkkkkkkkkkkkkk
+ 1
Gordon can u help me with this.
+ 1
Thanks Gordon, i like it but is there any other way
0
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<audio controls autoplay loop> <source src="https://www.dropbox.com/s/yk22zaqbxnimrej/none?dl=0&raw=1.mp3" type="audio/mpeg">
</audio>
</body>
</html>
<!-- use this code and check if the audio link is correct or not -->
0
You have to add .mp3 because it is extension of it.
In simple words .mp3 defines that the file type is an audio and not text.
0
Use this code to auto play once.
This code is made by solo learn in it tutorials in HTML.
<audio controls autoplay>
<source src="http://www.sololearn.com/uploads/audio.mp3" type="audio/mpeg">
Audio element not supported by your browser.
</audio>
--------------------------------------
To make you audio run again after it gets finished then add "loop" in it.
<audio controls autoplay loop>
<source src="http://www.sololearn.com/uploads/audio.mp3" type="audio/mpeg">
Audio element not supported by your browser.
</audio>
May this help you
0
Sorry, I can't help you more but you can see Html5 audio tutorials on YouTube.