YouTube video in HTML5

前提是你 提交于 2019-12-30 18:42:07

问题


How do I play a YouTube video in HTML5?


回答1:


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?




回答2:


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




回答3:


If you're using safari, there's an YouTube5 extension that will make all youtube videos into html5 videos.

http://www.verticalforest.com/2010/06/09/youtube5-html5-converter-for-youtube-videos/

Supports videos that youtube does not (videos with ads etc)




回答4:


You can embed videos effortlessly by right clicking the video on youtube, copying the embed video option, and pasting it in your html where you want it to appear, The problem with this you wont have control over what is shown in the embed code apart from the clip you are interested in, ie, adverts playlists etc




回答5:


http://html5demos.com/video#view-source is an example of how to use html5 to play a video.



来源:https://stackoverflow.com/questions/3520113/youtube-video-in-html5

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!