Html – Force HTML5 youtube video

htmlvideoyoutube

Regarding the Youtube API Blog they are experimenting with their new HTML5 Video Player.

Apparently to play a video in html5, you have to use the iframe embedding code :

<iframe class="youtube-player" type="text/html" width="640" height="385"
  src="http://www.youtube.com/embed/VIDEO_ID" frameborder="0">
</iframe>

But if the client has not joined the HTML5 Trial, the player will automatically fall back into the flash player even if the client's browser is HTML5 video capable.

How to force the HTML5 video playback if the browser supports it, even if the users are not yet involved in the HTML5 Trial?

Otherwise how to disable the flash fallback?

EDIT:

It's possible to force HTML player through links to Youtube Video, but I need this kind of feature for embedded videos.

Best Answer

I've found the solution :

You have to add the html5=1 in the src attribute of the iframe :

<iframe src="http://www.youtube.com/embed/dP15zlyra3c?html5=1"></iframe>

The video will be displayed as HTML5 if available, or fallback into flash player.

Related Topic