21 AnswersNew Answer
You can go through this code https://code.sololearn.com/W41UlnPCFNIS/?ref=app
Let me be straightforward. You cannot AUTOPLAY audio, video or any media playable without initialising user event hence it's no more an "AUTOPLAY". Well that's how it is now... All these methods won't work
ρү૨œdԌ૨ × Table is never deprecated unless you mean the type from the furnitures. I will also like to clarify the difference between element/attribute deprecation. Attributes like [AUTOPLAY, disabled] etc are always immediate after deprecation [Marquee] is a deprecated element, they are to be translated directly by the browser, they always give some time so older programs using them can switch to the alternative
Only with html
ρү૨œ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
Chi Zu your quote is right 2-3yrs back but AUTOPLAY doesn't work anymore. Just me being straightforward here so you won't be going around the internet trying to add buggy codes to your program. iOS has even add more restrictions, you can't preload or play more than a single media file simultaneously. That's just how it is
ρү૨œ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
https://www.sololearn.com/discuss/2576523/?ref=app https://www.sololearn.com/discuss/1921932/?ref=app https://www.sololearn.com/discuss/2059721/?ref=app https://www.sololearn.com/discuss/2330298/?ref=app edit https://www.sololearn.com/Discuss/2853634/?ref=app
👍Am also mean the the same pointing.. May be indirect.. 🙂
<audio src="" autoplay> https://www.w3schools.com/tags/tag_audio.asp
@ρү૨œdԌ૨ × So why don't you add an example how to write that, working example of autoplaying pls?
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.
<!-- 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:[email protected];400;500;600;700;800&display=swap" rel="stylesheet"> <script
By using audio starting tag use: <audio autoplay> </audio>
Not true. Quit peddling jabbascript. Deprecated or not it still works.
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.