Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

YouTube video in HTML5

Tags:

html

youtube

How do I play a YouTube video in HTML5?

like image 901
Tricia Fish Avatar asked Aug 19 '10 08:08

Tricia Fish


People also ask

How do I play a YouTube video in HTML?

Playing a YouTube Video in HTML. To play your video on a web page, do the following: Upload the video to YouTube. Take a note of the video id. Define an <iframe> element in your web page. Let the src attribute point to the video URL. Use the width and height attributes to specify the dimension of the player. Add any other parameters ...

Does Youtube use HTML5?

In this article, we will discuss the details of YouTube’s use of HTML5, how you can get started using it, and the current limitations of YouTube HTML5 video. To participate in YouTube’s opt-in HTML5 trial, you must be using a supported web browser, which include: Apple Safari, supports h.264

Why can't I display a video in HTML5?

Your browser does not support HTML5 video. To show a video in HTML, use the <video> element: Your browser does not support the video tag. The controls attribute adds video controls, like play, pause, and volume. It is a good idea to always include width and height attributes.

What is <HTML5>?

HTML5 defines DOM methods, properties, and events for the <video> element. This allows you to load, play, and pause videos, as well as setting duration and volume.


2 Answers

This is probably what you're looking for: Force HTML5 youtube video

HTML5 video may play if the user has opted in:

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

HTML5-by-defualt video - notice the ?html5=1:

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

The "HTML5" way of doing video would be to use a <video> tag. This post shows that it can be done, but it doesn't look like the best option. Show Youtube video source into HTML5 video tag?

like image 107
Dennis Avatar answered Nov 04 '22 01:11

Dennis


You can also take a look how YouTube does it, opt in at: http://www.youtube.com/html5

like image 37
pts Avatar answered Nov 04 '22 02:11

pts