In this article you will learn how to embed one video by YouTube with autoplay on but sound muted. The YouTube video will play automatically when the webpage loads, but with the sound set to zero.
It's easy to embed video from YouTube on your website. You can copy the default IFRAME embed code, paste it anywhere in your web page, and you're ready. Youtube also offers a very basic configuration. You can modify the dimensions or hide the brand name Youtube etc but if you wanted more control over the behavior of the embedded player then you can do it through YouTube Player API.
This article explains how you can embed a video from Youtube which will play automatically when the web page loads but with mute audio.
It could be a useful technique for a website that sells various things products, starting for example with short screencasts to highlight the products, playing a 5-10 second video on initial page load, but without sound so as not to disturb the user.
The volume will be automatically set to zero and the user can manually activate the sound with one click. Likewise, if you use Youtube videos as a background, it's more sensible to incorporate mute video that runs continuously.
But let's see how you can do that. Go to the YouTube page that contains the video you want and note the ID of the video from the URL. For example, if the video link from YouTube is http://youtube.com/watch?v=xyz-123, the id of the video is XYZ-123 (ie all characters after v = and until the next &) . Once you have copied the id, all you have to do is replace YOUR_VIDEO_ID with your own id in the script below.
Then integrate all of the above script into the code of your webpage and the video will automatically play with the sound muted.
You can further customize the YouTube player by modifying the various variables. For example, if you set loop to 1, the video will play in a loop. If you set fs to 1 then a full key will appear screen(fs=fullscreen) inside the video player.
Good Luck!