Actionscript 3 Flash AS3试图加载Chrome YouTube时出现安全错误
当我尝试加载一个无铬YouTube swf时,我收到了基于flash的安全错误Actionscript 3 Flash AS3试图加载Chrome YouTube时出现安全错误,actionscript-3,youtube,Actionscript 3,Youtube,当我尝试加载一个无铬YouTube swf时,我收到了基于flash的安全错误 Warning: Domain www.youtube.com does not explicitly specify a meta-policy, but Content-Type of policy file http://www.youtube.com/crossdomain.xml is 'text/x-cross-domain-policy'. Applying meta-policy 'by-conte
Warning: Domain www.youtube.com does not explicitly specify a meta-policy, but Content-Type of policy file http://www.youtube.com/crossdomain.xml is 'text/x-cross-domain-policy'. Applying meta-policy 'by-content-type'.
Error: Request for resource at http://www.youtube.com/apiplayer?version=3 by requestor from http://... is denied due to lack of policy file permissions.
*** Security Sandbox Violation ***
Connection to http://www.youtube.com/apiplayer?version=3 halted - not permitted from http://...
我已经尝试了Security.loadPolicyFile和Security.allowDomain的所有相关变体,但仍然会出现这些错误
如果忽略这些跟踪错误(加载程序没有回调错误)并尝试使用播放器(在加载程序的Event.INIT期间通过Loader.content),则任何访问YouTube API的尝试都会导致崩溃
如果我在调试器中查看我的player(Object)变量,我会发现它实际上是一个com.goggle.youtube.application::SwfProxy,它是从Sprite派生的。在标准Sprite变量和函数之外,它包含enableJsApi=false、loader=null和player=”http://s.ytimg.com/yt/swfbin/apiplayer3-vfljSpMoI.swf"
但尝试调用player.setSize或player.loadVideoByUrl等函数将导致崩溃,例如
Exception thrown (TypeError: Error #1006: setSize is not a function.
请告知。我以前使用过无铬播放器,但遇到了这些错误。他们太令人沮丧了。许多错误可以忽略,因为YouTube仍然并没有更新默认的策略文件 当您试图将任何鼠标事件侦听器直接添加到小工具时,您将得到错误,这些错误将破坏运行时进程。我要做的是添加鼠标互动性,在电影剪辑上方添加一个精灵,并在其徽标显示的位置添加一个洞(这样某人仍然可以单击其徽标),然后将事件侦听器添加到您自己的srite中
希望这能有所帮助。最终消除错误的方法是指定。。。LoaderContext(false,new ApplicationDomain())好的,我解决了一半的问题。。。我现在可以调用setSize和loadVideoByUrl而不会崩溃。我试图在加载程序的Event.INIT期间使用播放器,而不是播放器的“onReady”事件。