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 -

javascript - Get parameter of GET request -

javascript - Twitter Bootstrap - how to add some more margin between tooltip popup and element -