+ 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

4th Jun 2020, 3:27 PM
ツSampriya😘ツ
ツSampriya😘ツ - avatar
14 RĂ©ponses
+ 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
6th Jun 2020, 2:22 AM
Coder
Coder - avatar
+ 2
ok ok I removed .mp3 and now link is correct but I have the problem of autoplay please suggest me
4th Jun 2020, 3:48 PM
ツSampriya😘ツ
ツSampriya😘ツ - avatar
+ 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
4th Jun 2020, 3:59 PM
ツSampriya😘ツ
ツSampriya😘ツ - avatar
+ 1
autoplay is deprecated because it was abused for malicious intent.
4th Jun 2020, 3:36 PM
Gordon
Gordon - avatar
+ 1
So what I use in place of autoplay
4th Jun 2020, 3:37 PM
ツSampriya😘ツ
ツSampriya😘ツ - avatar
+ 1
autoplay is not working friend
4th Jun 2020, 4:10 PM
ツSampriya😘ツ
ツSampriya😘ツ - avatar
+ 1
okkkkkkkkkkkkkkkkkkkkk
4th Jun 2020, 4:16 PM
ツSampriya😘ツ
ツSampriya😘ツ - avatar
+ 1
Gordon can u help me with this.
4th Jun 2020, 4:16 PM
ツSampriya😘ツ
ツSampriya😘ツ - avatar
+ 1
Thanks Gordon, i like it but is there any other way
5th Jun 2020, 8:31 AM
ツSampriya😘ツ
ツSampriya😘ツ - avatar
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 -->
4th Jun 2020, 3:45 PM
Omkar Kamat
Omkar Kamat - avatar
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.
4th Jun 2020, 3:51 PM
Omkar Kamat
Omkar Kamat - avatar
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
4th Jun 2020, 4:06 PM
Omkar Kamat
Omkar Kamat - avatar
0
Sorry, I can't help you more but you can see Html5 audio tutorials on YouTube.
4th Jun 2020, 4:15 PM
Omkar Kamat
Omkar Kamat - avatar