开发者

embedding youtube videos using modernizer, rather then an iframe

If one hosts his own video files (h.264, WebM or ogg, and flash for each video) you can put it on your html5 pages by this (and many other) method:

http://camendesign.com/code/video_for_everybody

If you don't host and want h.264 or WebM codec with flash fallback from 开发者_运维技巧your youtube hosted videos, you can use this method:

http://apiblog.youtube.com/2010/07/new-way-to-embed-youtube-videos.html http://www.youtube.com/html5

The trick here is that there is a html5 page, with auto-detection, in the iframe.

However, I am using modernizer, and would like to embed my youtube videos without using the iframe, but just with direct links to the h.264(webkit) and WebM(gecko) file. Modernizer would detect what to serve, and fallback on the youtube flash embed (trident).

How do I get these files from youtube? Via the API?

http://code.google.com/intl/zh-TW/apis/youtube/2.0/reference.html#formatsp

It seems youtube is not very keen on direct access to these files, because all the extensions out here to 'download' them. And the iframe method also only works on fmovies wthout advertising.


YouTube 'terms of use' do not allow to access the YouTube video source files directly.

Currently the YouTube team provides a JavaScript API, but it is not updated to support HTML yet: http://code.google.com/apis/youtube/js_api_reference.html

-Andrian

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜