注解YouTube视频编程 [英] Annotating YouTube videos programmatically

查看:155
本文介绍了注解YouTube视频编程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望能够以显示与覆盖注释正常的YouTube视频由彩色矩形每一帧。唯一的要求是,这应该被编程完成。 YouTube有注释现在,但需要使用它们的前端用手工来创建它们。我希望能够产生它们。什么是这样做的最佳方式?

一些想法:


  

      
  1. 构建自己的Flash播放器(EW?)

  2.   
  3. 不知怎的,画到YouTube的Flash播放器。将这项工作?

  4.   
  5. 反向工程和放大器;劫持YouTube的注释系统。无论是与本地文件搞乱或重定向它的企图下载
      注释。 (使用Greasemonkey的?Firefox的插件?)

  6.   

理念不计数:


  

下载的视频



解决方案

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 has annotations 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:

  1. Build your own Flash player (ew?)
  2. Somehow draw over the YouTube Flash player. Will this work?
  3. 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆