Sometimes the first thing that we might want to share with a visitor to our web page is a playing video. Using YouTube, it is rather easy to add auto play functionality to any YouTube video. It is a simple code that needs to be inserted in the code from the share option on YouTube.
To get the code for the video, go to YouTube and find the video you would like on your site. Then get the video code by clicking on the share button at the bottom:
Now that we have the code, all we need to do is add the auto play functionality. We do this by adding the following code highlighted below. The “Before” example is what the code looks like when we first get it from YouTube, the “After” example features the additional code to be added in bold. Make sure to add it to the video in the exact same position, with the exact same characters.
YouTube Video without Auto Play
<iframe width=”640″ height=”360″ src=”[YouTube Video URL]” frameborder=”0″ allowfullscreen></iframe>
YouTube Video with Auto Play
<iframe src=”[YouTube Video URL]?rel=0&autoplay=1″ width=”640″ height=”360″ frameborder=”0″ allowfullscreen=”allowfullscreen”></iframe>
That’s it! Now your ready to enjoy auto play YouTube videos on your website. Just make sure to embed the code in the HTML editor of your site, and you should be good to go.