规避Flash播放器的bug,同时绑定youtube事件

Circumvent Flash player bug while binding youtube events

本文关键字:绑定 youtube 事件 Flash 播放器 bug 规避      更新时间:2023-09-26

我使用以下代码绑定包含在iframe中的Youtube播放器的onStateChange事件。在问题中,我得到了通过javascript生成youtube播放器的代码,这对我来说不是一个选项。

我在firefox中遇到这个Bug。

Error: Permission denied to access property 'toString'

如问题所述,我无法修复此问题,因为adobe或google显然必须这样做。

我的问题是我绑定到onStateChange事件的回调函数没有被调用。我的代码在Safari中工作得很好,但在Firefox中不行。

我想这个bug会阻止我正确设置回调函数。有人已经为这个问题写了一个解决方案吗?

我不能评论你在Firefox中看到的那个特定的错误。

你应该知道,有其他的方法来动态插入YouTube iframe播放器响应点击占位符元素,但是,

我有几个使用静态图像缩略图的例子(鼠标在"播放"图标上),当点击时变成自动播放的<iframe>播放器。您可以在http://ytdirectlite.appspot.com/static-min/submit.html底部的提交小部件中的"My YouTube Videos"选项卡中看到一个实时示例,并在

查看源代码。

https://code.google.com/p/youtube-direct-lite/source/browse/static/css/index.css # 150https://code.google.com/p/youtube-direct-lite/source/browse/static/js/ytdl/panels/existing.jshttps://code.google.com/p/youtube-direct-lite/source/browse/static/js/ytdl/player.js