Wednesday, August 1, 2012

Autoplay Code for Embedded Videos

This is tutorial how to make your embedded YouTube videos autoplay.

- This is close look of embed video code :

<object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/OdT9z-JjtJk"></param><embed src="http://www.youtube.com/v/OdT9z-JjtJk" type="application/x-shockwave-flash" width="425" height="350"></embed></object>

-To make it autoplay, just put &autoplay=1 after the video ID so it looks like this: 

<object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/OdT9z-JjtJk&autoplay=1"></param><embed src="http://www.youtube.com/v/OdT9z-JjtJk&autoplay=1" type="application/x-shockwave-flash" width="425" height="350"></embed></object>

-Also you can change parameters width and height to suit your needs.
 This is sample how it can be done :

<object width="420" height="315"><param name="movie" value="http://www.youtube.com/v/3y3EuVjQt3M?version=3&amp;hl=en_US&amp;autoplay=1" /><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><embed src="http://www.youtube.com/v/3y3EuVjQt3M?version=3&amp;hl=en_US&autoplay=1" type="application/x-shockwave-flash" width="220" height="115" allowscriptaccess="always" allowfullscreen="true"></embed></object>

-It's simple as that enjoy :)  

No comments:

Post a Comment