How to play an embedded object(video, audio etc.) Automatically when the user opens the web page? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

How to play an embedded object(video, audio etc.) Automatically when the user opens the web page?

11th Jul 2018, 4:44 PM
B.D
B.D - avatar
4 Answers
+ 4
Hello, Bithi D ! For automatic playback, the "autoplay" attribute will help you. With this attribute, the videe/audio automatically starts after the page is loaded. The autoplay attribute overrides the preload action. Syntax <video autoplay="autoplay"> </video> <audio autoplay="autoplay"> </audio> The value is autoplay, and you can not specify any value at all. By default, this attribute is disabled. Also by default the browser blocks autoplay, but you can disable this option in the browser settings
11th Jul 2018, 5:32 PM
Alexander Sokolov
Alexander Sokolov - avatar
+ 2
Autoplaying audios and videos, are some of the quickest ways to make sure users DON'T visit your websites . Most modern browsers have disabled the "autoplay" attribute
11th Jul 2018, 4:48 PM
Dlite
Dlite - avatar
+ 1
Just do this <video autoplay>
11th Jul 2018, 4:48 PM
Janusz Omyliński
Janusz Omyliński - avatar
0
thank you
12th Jul 2018, 6:52 AM
B.D
B.D - avatar