开发者

Flex - HTTPService - Security error accessing YouTube api

开发者 https://www.devze.com 2023-03-23 15:59 出处:网络
I have the following HTTPService defined: <mx:HTTPService id=\"youTubeHttpService\" result=\"resultHandler(event)\" fault=\"faultHandler(event)\"/>

I have the following HTTPService defined:

<mx:HTTPService id="youTubeHttpService" result="resultHandler(event)" fault="faultHandler(event)"/>

And I'm using the following URL (pattern) to obtain a list of YouTube videos for a particular user:

http://gda开发者_如何学编程ta.youtube.com/feeds/api/users/Y/uploads

where Y is a registered user on YouTube.

Eg: http://gdata.youtube.com/feeds/api/users/YouTube/uploads

I send an HTTP request using the following syntax:

youTubeHttpService.url = "http://gdata.youtube.com/feeds/api/users/YouTube/uploads";
youTubeHttpService.resultFormat = "object";
youTubeHttpService.send();

Now, the above code works fine for some people using our software while others are experiencing the following error ( in faultHandler() ):

Error: [RPC Fault faultString="Security error accessing url" faultCode="Channel.Security.Error" faultDetail="Destination: DefaultHTTP"] 

Again, the error happens to some people and not for others.

Have I missed something? Would it be a machine / browser specific problem? As a sanity check the above code works with the same .swf file in chrome, ie, firefox and safari.

I have read about the crossdomain.xml and don't think that is the issue as YouTube have that defined.

Finally, all users (intranet app) are using IE and the same version of flash.

Any help would be greatly appreciated as I have been pulling my hair out the past 2 days and asking the question over and over again "Why is it only happening for some users and not for other users?"

Norm.


Could it be possible that they have their security settings too high? Check out this page to change them http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html


You have a crossdomain policy restriction http://gdata.youtube.com/crossdomain.xml

It looks like youTube is allowing pretty much most everything.
So that leads me to believe the file is not being loaded.
Try this or a form of it.

Security.allowDomain( 'gdata.youtube.com' );
Security.loadPolicyFile( 'gdata.youtube.com' );

Also Use HTTPFox plugin for FireFox to see if it gets loaded

If worse comes to worse try this

0

精彩评论

暂无评论...
验证码 换一张
取 消