html - YouTube: How to present embed video with sound muted -


i'm trying embed video sound muted can not figure out how make work.

currently i'm using doesn't work:

<iframe src="https://www.youtube.com/embed/unrgwvj10gq?rel=0&amp;autoplay=1" width="560" height="315" frameborder="0" allowfullscreen></iframe> 

any of knows how can make work ?

you're going have add javascript mute audio. add id iframe:

<iframe id="myvideo" src="https://www.youtube.com/embed/unrgwvj10gq?rel=0&amp;autoplay=1" width="560" height="315" frameborder="0" allowfullscreen></iframe> 

then retrieve id javascript:

var myvideo =  iframe.getelementbyid('myvideo');  myvideo.mute(); 

also see mute section in youtube api reference https://developers.google.com/youtube/js_api_reference?csw=1

and question: how automatically play youtube video (iframe api) muted?


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -