Sunday, August 15, 2010

How to autoplay videos from Youtube

Autoplay means that the video will start playing by itself, without you/or your visitors pressing the play button. It is useful when you want to have a player on your page with just one song or video. Instead of going to a website where you can load the music/videos into a generated player you can directly take it from Youtube. The simplicity of a player from Youtube makes it easy to adjust the size to your preference, without cutting out anything, for example when you want to fit it into the sidebar of your blog. This is a very simple tutorial, you just need to be careful not to break any tags in the code.

Step One:

Take the embed code for your video from Youtube:

Step-01

Step Two:

Now it is time to edit the code:
1.Delete the part highlighed in red from the code just to simplify things.

Step-02


2. Add the code to autoplay the video. The code is "&autoplay=1" which has to be added right in between the end of the video link and the "& amp" tag.

Step-03

Step Three(Optional):

Adjust the width and height of your video.
You can now adjust the width and height of any video directly from Youtube, but if you need to do it yourself you just need to change the parts that are highlighted in red to fit your preferences.

Step-04
Result:



You can use it as a smaller video player or as I like to use it, as a music player and these are the exact sizes I use.

Step-05
Result:



Note: If you want to center your player put the video code between the tags: < center > < / center >

No comments:

Post a Comment