用Jquery停止Vimeo视频 [英] Stop a Vimeo Video with Jquery
本文介绍了用Jquery停止Vimeo视频的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要停止嵌入带有新的oembed api(通用播放器)的Vimeo视频,但是当我尝试添加事件时,出现此错误:
I need to stop a Vimeo video embedded with new oembed api (universal player) but when I try to add an event I get this error:
Uncaught TypeError: Object #<an HTMLIFrameElement> has no method 'addEvent'
但是我不明白为什么会出现此错误,我添加了jquery和frogaloop api,还向iframe中添加了id,但仍然不起作用::(
But I don't why I get this error, I added jquery and the frogaloop api, also I added ids to the iframes, but it still doesn't work: :(
完整代码在这里:
推荐答案
您不能.
- 没有DOM
addEvent
方法. - 您没有跨域访问Vimeo的权限,因此不允许您与iframe文档或抽象视图建立JavaScript界面.
- There's no DOM
addEvent
method. - You don't have cross-domain access to Vimeo, so you are not permitted to have JavaScript interface with the iframe's document or abstract view.
如果您想通过JavaScript与Vimeo交互,则必须让他们实现也接受您的域的postMessage
API.
If you wanted to interface with Vimeo via JavaScript, you would have to get them to implement a postMessage
API that also accepts your domain.
这篇关于用Jquery停止Vimeo视频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文