Flash Player 上的外部 Javascript 接口无法在 CDN (Cloudfront) 上运行

发布于 2024-09-26 04:35:48 字数 681 浏览 0 评论 0原文

我有一个带有外部 javascript 接口的 Flash 播放器: reloadData() 我在编辑页面上的信息时通过 Javascript 调用该函数 - 基本上是为了保持页面上和播放器中的数据同步。

当播放器托管在本地时,reloadData() 函数可以正常工作。当我们将其移动到 CDN(Amazon Cloudfront)时,播放器加载成功,但外部 javascript 接口不再工作 - console.log(player) 显示以下内容:

<object type=​"application/​x-shockwave-flash" data=​"[our_cloudfront_url].swf" width=​"920" height=​"404" id=​"player" style=​"visibility:​ visible;​ ">​

Uncaught TypeError: Object #<an HTMLObjectElement> has no method 'reloadData'

我知道在使用时有很多行为不同的事情CDN 上的项目,但我想知道是否有人遇到过类似的问题并找到了解决方案。

哦,是的...我们使用 CNAME 指向 cloudfront 发行版 (buildid.ourdomain.net => distributionid.cloudfront.net)

I have a flash player with an external javascript interface: reloadData() I'm calling that function via Javascript when editing information on the page - basically to keep data on the page and in the player in synch.

The reloadData() function works fine when the player is hosted locally. When we move it to the CDN (Amazon Cloudfront), the player loads successfully, but the external javascript interface no longer works - console.log(player) reveals the following:

<object type=​"application/​x-shockwave-flash" data=​"[our_cloudfront_url].swf" width=​"920" height=​"404" id=​"player" style=​"visibility:​ visible;​ ">​

Uncaught TypeError: Object #<an HTMLObjectElement> has no method 'reloadData'

I know there are a lot of things that behave differently when working with items on a CDN, but I'm wondering if anyone has experienced a similar problem and figured out a fix.

Oh, yeah...we're using a CNAME to point to the cloudfront distribution (buildid.ourdomain.net => distributionid.cloudfront.net)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

再可℃爱ぅ一点好了 2024-10-03 04:35:48

好吧,我们解决了这个问题。有两件事是必需的:

  1. 嵌入 swf 时的页面上:allowScriptAccess="always"

  2. 在 swf 本身中:System.security。 allowDomain("ourdomain.com")

我想这有点明显,但我想我应该将其发布在这里以防其他情况像我这样可怜的迷失的灵魂也面临着同样的问题。

Well, we figured this one out. Two things are necessary:

  1. On the page when embedding the swf: allowScriptAccess="always"

  2. In the swf itself: System.security.allowDomain("ourdomain.com")

I guess this is sort of obvious, but I figured I'd post it here in case some other poor lost soul such as myself is having the same problem.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文