How to use autoplay and mute attribute with < video > tag in HTML for youtube ? with example

 How to use autoplay and mute attribute with < video > tag in HTML for youtube ? with example 


When you add or use autoplay attribute for your website development by adding value autoplay=1 to the YouTube URL.then video is automatically started when any unknown or unique visitor are visiting in your website . However, automatically starting a video is annoying for your visitors


<html>

<body>

<iframe width="420" height="315"

src="https://www.youtube.com/embed/tgbNymZ7vqY?

autoplay=1&mute=1">

</iframe>

</body>

</html>


When you apply both attribute with YouTube URL then Here is the effect after giving value to both of the attribute mute and Autoplay .

Add mute=1 after autoplay=1 to let your video start playing automatically (but muted).


Example 

<iframe width="560" height="315"

 src="https://www.youtube.com/embed/2jg1bJQaYjg"

autoplay=1 & mute=1 " 

title="YouTube video player" frameborder="0" 

allow="accelerometer; clipboard-write; encrypted-media; 

gyroscope; picture-in-picture" allowfullscreen></iframe>

Comments

Last 7 Days

Smart contract code for Anyone can send coins to each other without a need for registering with a username and password with help of Ethereum keypair

How to use referrerpolicy Attribute value ( no-referrer-when-downgrade ) with < iframe > tag in HTML ? with example

How Artificial Intelligence Is Changing the World: A Complete Pro Guide

How Text Conversion Tools Work and Why They Are Useful

How to use comments in Solidity programming language ?

How to Convert Image to PDF on iPhone (Free & Easy Methods) | ThinkforU

How to Convert PNG to PDF Online (Free & Easy Method) | ThinkforU

How to Repeat Text Multiple Times Online (Free & Instant Method)