注解YouTube视频编程 [英] Annotating YouTube videos programmatically
问题描述
我希望能够以显示与覆盖注释
正常的YouTube视频由彩色矩形每一帧。唯一的要求是,这应该被编程完成。 YouTube有注释
现在,但需要使用它们的前端用手工来创建它们。我希望能够产生它们。什么是这样做的最佳方式?
一些想法:
- 构建自己的Flash播放器(EW?)
- 不知怎的,画到YouTube的Flash播放器。将这项工作?
- 反向工程和放大器;劫持YouTube的注释系统。无论是与本地文件搞乱或重定向它的企图下载
注释。 (使用Greasemonkey的?Firefox的插件?)
块引用>理念不计数:
下载的视频
块引用>解决方案YouTube上提供的动作脚本API 。
利用这一点,你可以使用他们的API加载视频到Flash,然后让你的Flash应用程序在视频上方图层上创建的注释。
或者,或者,如果你想从创建在Flash的东西,使用YouTube的JavaScript API,你可以在你的网页上的YouTube播放器绘制HTML的DIV望而却步。请记住,当你嵌入玩家有
= WMODE透明
在PARAMS列表。因此,使用从YouTube的例子:
<脚本类型=文/ JavaScript的> VAR PARAMS = {allowScriptAccess的:总是};
VAR的ATT = {ID:myytplayer的wmode:透明};
swfobject.embedSWF(http://www.youtube.com/v/VIDEO_ID&enablejsapi=1&playerapiid=ytplayer
ytapiplayer,425,356,8,NULL,NULL,则params,ATT以); < / SCRIPT>和那么你应该能够通过使用CSS / DHTML的YouTube视频吸引您的注释。
I want to be able to display a normal YouTube video with overlaid
annotations
, consisting of coloured rectangles for each frame. The only requirement is that this should be done programmatically. YouTube hasannotations
now, but require you to use their front end to create them by hand. I want to be able to generate them. What's the best way of doing this?Some ideas:
- Build your own Flash player (ew?)
- Somehow draw over the YouTube Flash player. Will this work?
- Reverse engineer & hijack YouTube's annotation system. Either messing with the local files or redirecting its attempt to download the annotations. (using Greasemonkey? Firefox plugin?)
Idea that doesn't count:
download the video
解决方案YouTube provides an ActionScript API.
Using this, you could load the videos into Flash using their API and then have your Flash app create the annotations on a layer above the video.
Or, alternatively, if you want to stay away from creating something in Flash, using YouTube's JavaScript API you could draw HTML DIVs over the YouTube player on your web page. Just remember when you embed the player to have
WMODE="transparent"
in the params list.So using the example from YouTube:
<script type="text/javascript"> var params = { allowScriptAccess: "always" }; var atts = { id: "myytplayer", wmode: "transparent" }; swfobject.embedSWF("http://www.youtube.com/v/VIDEO_ID&enablejsapi=1&playerapiid=ytplayer", "ytapiplayer", "425", "356", "8", null, null, params, atts); </script>
And then you should be able to draw your annotations over the YouTube movie using CSS/DHTML.
这篇关于注解YouTube视频编程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!