+ 2
Audio auto play?
How to add Audio with auto play mood ? Please send me with a code .
16 Réponses
+ 6
autoplay is deprecated in modern browsers. It need a gesture or event to autoplay so you need a javascript support..
try to see these possibilities works or not:
https://developer.mozilla.org/en-US/docs/Web/Media/Autoplay_guide
Hope it helps..
edit:
try these :
<audio loop autoplay controls>
<source src="https://dl.dropbox.com/s/nbt7tqcacl3nob8/IPL%20theme%20RMX?dl=0"> </audio>
<iframe src="https://dl.dropbox.com/s/nbt7tqcacl3nob8/IPL%20theme%20RMX?dl=0" type="audio/mp3" allow="autoplay">
Audio element not supported by your browser.
</iframe>
edit:
https://developers.google.com/web/updates/2017/09/autoplay-policy-changes
https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/play#Usage_notes
+ 2
Only with html
+ 2
ρү૨œdԌ૨ × I've tested the example you provided. It does not work in this code playground. I also tested it in chrome it does not work. However there is a media autoplay in Chrome and If I set that to allow. It will work with out user interaction.
With further testing I have found that it does work in some other code playgrounds. I suspect that those do not follow chromes Browser Policies. And that leads us to the problem with things that are depreciated. Sometimes it works sometimes it don't.
https://code.sololearn.com/WmUMGC0InPuD/?ref=app
+ 2
ρү૨œdԌ૨ × as already told by others, it won't work here.. That's just a example, but not a working example as per OP expectations..
(On reply only with html), I also given possibilities, which are all ways to do previously, so can go on to check now, if those are working or not in their using browers.. But surely it won't work modern browsers.
Details about why, @Mirielle explained in detailed... @Chris provided test example.tqs
+ 1
👍Am also mean the the same pointing..
May be indirect.. 🙂
0
<audio src="" autoplay>
https://www.w3schools.com/tags/tag_audio.asp
0
@ρү૨œdԌ૨ × So why don't you add an example how to write that,
working example of autoplaying pls?
0
Correct me if I'm wrong, but...
Use `autoplay` on a `<video>` or `<audio>` tag for it to autoplay as soon as it's seen on the screen.
0
<!-- Credit - https://dribbble.com/shots/14605167/attachments/6297430?mode=media -->
<!--
<a href="https://www.freepik.com/vectors/creative-illustration">Creative illustration vector created by pikisuperstar - www.freepik.com</a>
<a href="https://www.flaticon.com/free-icons/google" title="google icons">Google icons created by Freepik - Flaticon</a>
<a href="https://www.flaticon.com/free-icons/facebook" title="facebook icons">Facebook icons created by Freepik - Flaticon</a>
-->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Awesome Login Screen</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Raleway:wght@300;400;500;600;700;800&display=swap" rel="stylesheet">
<script
0
By using audio starting tag use:
<audio autoplay>
</audio>
0
Hello
- 1
Not true. Quit peddling jabbascript. Deprecated or not it still works.
- 1
Jayakrishna🇮🇳 I already gave an example. Unless they deprecated the function in the last 2 years it works. There's also other deprecated things in HTML like <table> that still work.
- 2
Loop