How to autoplay a video using the new embed code style for Youtube : You can use any of the following methods to embed a YouTube player in your application and specify player parameters. Note that the instructions below demonstrate how to embed a player that loads a single video. The following section explains how to configure your player to load other types of content, such as playlists and search results.

YouTube players can be embedded in a web page using either an <iframe> tag or an <object> tag. By appending parameters to the IFrame or SWF URL, you can customize the playback experience in your application. For example, you can automatically play videos using the autoplay parameter or cause a video to play repeatedly using the loop parameter. You can also use the enablejsapi parameter to enable the player to be controlled via the IFrame Player API.

The Easiest method to get an auto player for Youtube is :

If you use replace “&” with “?” in the url the video will autoload.

So your url would be: http://www.youtube.com/embed/JW5meKfy3fY?autoplay=1

UPDATE:

To make YouTube Autoplay in an iFrame Code

How to Make Your Tube Video Automatically Play

First – you have to copy the code to your website, looks like this:

<iframe src=”http://www.youtube.com/embed/JW5meKfy3fY?rel=0″ frameborder=”0″ width=”560″ height=”315″></iframe>

To make your youtube iframe autoplay:

The next part is simple:
Just add:

&amp;autoplay=1

to the end of the You Tube URL – like this:

<iframe src=”http://www.youtube.com/embed/JW5meKfy3fY?rel=0&amp;autoplay=1” frameborder=”0″ width=”560″ height=”315″></iframe>

Embed a YouTube player

Best practice: IFrame embeds are the recommended method for embedding a YouTube player because the IFrame will select the appropriate player based on the client’s capabilities and available YouTube file formats.

You can use any of the following methods to embed a YouTube player in your application and specify player parameters. Note that the instructions below demonstrate how to embed a player that loads a single video. The following section explains how to configure your player to load other types of content, such as playlists and search results.

Embed a player using an <iframe> tag

Define an <iframe> tag in your application in which the src URL specifies the content that the player will load as well as any other player parameters you want to set. The <iframe> tag’s height and width parameters specify the dimensions of the player.

If you create the <iframe> element yourself (rather than using the IFrame Player API to create it), you can append player parameters directly to the end of the URL. The URL has the following format:

http://www.youtube.com/embed/VIDEO_ID

The <iframe> tag below would load a 640x390px player that would play the YouTube video M7lc1UVf-VE. Since the URL sets the autoplay parameter to 1, the video would play automatically once the player has loaded.

<iframe id="ytplayer" type="text/html" width="640" height="390"
  src="http://www.youtube.com/embed/M7lc1UVf-VE?autoplay=1&origin=http://example.com"
  frameborder="0"/>

Embed a player using the IFrame Player API

Follow the IFrame Player API instructions to insert a video player in your web page or application after the Player API’s JavaScript code has loaded. The second parameter in the constructor for the video player is an object that specifies player options. Within that object, the playerVars property identifies player parameters.

The HTML and JavaScript code below shows a simple example that inserts a YouTube player into the page element that has an id value of ytplayer. The onYouTubePlayerAPIReady() function specified here is called automatically when the IFrame Player API code has loaded. This code does not define any player parameters and also does not define other event handlers.

<div id="ytplayer"></div>

<script>
  // Load the IFrame Player API code asynchronously.
  var tag = document.createElement('script');
  tag.src = "https://www.youtube.com/player_api";
  var firstScriptTag = document.getElementsByTagName('script')[0];
  firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);

  // Replace the 'ytplayer' element with an <iframe> and
  // YouTube player after the API code downloads.
  var player;
  function onYouTubePlayerAPIReady() {
    player = new YT.Player('ytplayer', {
      height: '390',
      width: '640',
      videoId: 'M7lc1UVf-VE'
    });
  }
</script>

 

Tags

  • autoplay embed android youtube
  • embed youtube autoplay
  • where is the youtube embed code
  • youtube embed autoplay

Tags

  • youtube embed autoplay
  • embed code for autoplaY youtube
  • iframe youtube autoplay
  • youtube auto play demo ifrme
  • youtube autoplay next video
  • youtube iframe api example
  • youtube video autoplay android
  • 안드로이드 youtube iframe version=3