有人熟悉 Vimeo 吗? js_onLoad 出现问题,损坏了吗?
大家好,我试图从 git hub 获取 vimeo“swfobject.html”示例,但它根本不起作用@ github.com/vimeo/vimeo-api-examples/blob/master/moogaloop-api/javascript /swfobject.html
我调试了一下,发现它甚至没有进入“js_onLoad”函数。有谁知道这个 github 代码是否已过时或者 js_onLoad 是否已弃用?我只是想做一个简单的例子,在播放器加载后显示警报“hi”,但我什至无法做到这一点。
我非常简单的示例代码在这里:http://pastie.org/1110855。有人看到问题吗?
有精通 vimeo JS API 的 stackoverflower 同胞吗?干杯
Hi all I was trying to get the vimeo "swfobject.html" example from git hub to work, but it simply doesn't work @ github.com/vimeo/vimeo-api-examples/blob/master/moogaloop-api/javascript/swfobject.html
I debugged a bit, and realized it doesn't even enter the "js_onLoad" function. Does anyone know if this github code dated or is js_onLoad deprecated? I'm just trying to do a simple example of displaying the alert "hi" after the player is loaded, but I can't even get that far.
My very simple sample code is here: http://pastie.org/1110855. Does anyone see a problem?
Any fellow stackoverflowers versed in vimeo JS API? Cheers
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我感受到你的痛苦。关于 vimeo API 存在大量不一致的信息。但仍然有一些部分可以发挥作用。查看 API Playground,它可以正常工作并清楚地演示如何执行各种有用的操作。源代码位于github。您可以拆开playground.html 文件并保留您需要的部分。
关于 Playground.html 文件的重要警告 - 当运行 file:/// URL 时它不起作用(对我来说)。它必须来自 http 服务器才能正常运行。 HTH。
I feel your pain. There's a bunch of inconsistent information about the vimeo API out there. But there are still parts that work. Check out the API Playground which works and demonstrates clearly how to do all sorts of useful things. The source code is on github. You can take apart the playground.html file and just leave in the parts that you need.
Important caveat about the playground.html file -- it doesn't work (for me) when running off a file:/// URL. It has to be coming off an http server to function at all. HTH.
我认为自己是 Vimeo JS API 方面的专家。他们的文档和演示非常差,所以我整理了这个小演示,我认为它更容易理解。它使用 jQuery 和 iFrame 嵌入方法,但希望它有帮助:
http://labs.funkhausdesign.com/examples/vimeo/froogaloop2-api -basics.html
它展示了如何监听事件并触发方法。
I consider myself a bit of an expert on the Vimeo JS API. Their documentation and demo's are very poor, so I put together this little demo that I think it much easier to follow. It users jQuery and the iFrame embed method, but hopefully it helps:
http://labs.funkhausdesign.com/examples/vimeo/froogaloop2-api-basics.html
It shows how to listen for an event and fire a method.
经过多次实验,事件似乎仅在嵌入的 HTML5 版本中触发,而在 Flash 版本中则不触发。
由于通用嵌入代码(iframe)自动选择技术,我相信最好的方法是避免使用它并进行自己的嵌入。
After several experiments, it seems that events are only fired with the HTML5 version of the embed, not with the Flash version.
As the Universal Embed code (iframe) automatically selects the technology, I believe that the best way to go is to avoid using it and make your own embed.