更改播放视频
我正在尝试以下代码 http://code.google.com/apis/ ajax/playground/#change_the_playing_video
从 Playground 页面运行时效果很好。 但是,如果我使用作为示例提供的源代码创建一个新的本地文件,则会出现以下错误:
ytplayer is not Define
at line 40:
if(ytplayer) {
ytplayer.loadVideoById(videoID);
}
It might like for some Reason I don't get access to some parts of the javascript need by the example 。
只有我吗? 或者示例代码不在游乐场页面之外运行?
I'm trying the following code http://code.google.com/apis/ajax/playground/#change_the_playing_video
It works well when runned from the playground page. But if I create a new localfile with the source code provided as sample I get the following error:
ytplayer is not defined
at line 40:
if(ytplayer) {
ytplayer.loadVideoById(videoID);
}
It looks like for some reason I don't get access to some part of the javascript needed by the sample.
Is it just me? Or sample code don't run outside the playground page?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
很确定这是闪存的安全问题。 当我尝试在本地加载它时,我收到以下弹出窗口,但它 在我的设备上运行良好服务器。
(来源:fullahead.org)
如果您查看以下 Adobe 中的开发人员部分参考,你应该能够让它工作。
Pretty sure it's a security problem with flash. When I try to load it locally, I get the following popup, but it works fine on my server.
(source: fullahead.org)
If you check out the Developers section in the following Adobe reference, you should be able to get it working.
这与 Flash 中的同域限制有关。 尝试访问互联网上的资源的本地文件被视为“跨域”访问。 要将本地文件列入白名单,请将其位置添加到 全局安全设置。 单击“编辑位置...”,然后单击“添加位置...”。
This has to do with same-domain restrictions in Flash. Local files trying to access resources on the internet counts as "cross-domain" access. To whitelist your local file, add it's location to the global security settings. Click on "Edit locations..." and then "Add location...".