Hello,
I have looked all over the forums, google etc. and not found any reliable and working solution to be able to retrieve the stream bitmapdata from RTMP or HTTPDynamicStreaming source. Please find the details below.
I have tried everything:
NetStream.checkPolicyFile = true
Security.loadPolicyFile(...);
/applications/live/main.asc has the code below:
application.onConnect = function( client )
{
client.videoSampleAccess = "/";
this.acceptConnection(client) ;
}
The Application.xml has the tag:
<Client>
<access>
<VideoSampleAccess enabled="true">/</VideoSampleAccess>
</access>
</Client>
But constantly, I receive this error ( both on FMS3.5 and FMS4.0 RTMP & HttpLiveDynamicStreaming):
securityerror:Error #2123: Security sandbox violation: BitmapData.draw: http://localhost/xxyy.swf cannot access rtmpt://localhost:1935/live. No policy files granted access.
The problem persists wherever the player.swf is placed.
Since I'm using OSMF the video display object had to be retrieved in the way like this:
var mediaDisplayObjectTrait:DisplayObjectTrait;
mediaDisplayObjectTrait = media.getTrait(MediaTraitType.DISPLAY_OBJECT) as DisplayObjectTrait;
(...)
v = new Video(mediaDisplayObjectTrait.mediaWidth,mediaDisplayObjectTrait.medi aHeight);
loadable.netStream.checkPolicyFile = true;
v.attachNetStream(loadable.netStream);
The new Video part is a must because when using ( the only working http - vod setup ) the BitmapData of the DisplayObject defaults to 320x240 even though the mediaWidth and mediaHeight properties are set fine and the video itself has much higher resolution. I must note at this point its far weird and worths another post.
Seems like the player simply doesn't know anything about where and how to obtain any kind of policy information from the stream.
I think this issue must be resolved once and for all, it's simply not acceptable to have this poor documentation floating around an essential feature without any professional help involved.
I share sentiments with Aron on this. FMS / FP integration re: security causes many lost hours/days on what should be open-wide by default and locked down only if you absolutely need to.
I am having the same issues and have tried all of the above. It appears there is no straightforward way to allow SoundMixer.computeSpectrum() on a NetStream without throwing this error.
Would appreciate any advice on the matter.
You don't need crossdomain policy files, you need to do the following;
1) Edit the Application.xml file in the host folder, within install directory/conf/... , edit the client tag, adding the attribute override=”yes”
<Client override=”yes”>
In a default install of Flash Media Server, the Client class is set to prevent overriding values in the application folder. This was why the settings we were trying were not holding.
We do not need to alter anything else of the conf Application.xml
2) Add the client/access nodes to the root Application.xml within the content folder ( we have already done this as far as I am aware ).
<Application>
<Client>
<Access>
<VideoSampleAccess enabled="true">/</VideoSampleAccess>
<AudioSampleAccess enabled="true">/</AudioSampleAccess>
</Access>
</Client>
</Application>
3) Restart the Media Server by using the administration console. This will enable the client>access values to be overridden to true.
I'm having trouble with this issue (FMIS 3.5):
SecurityError: Error #2123: Security sandbox violation: BitmapData.draw: http://mytestsite.com/test.swf cannot access unknown URL. No policy files granted access.
at flash.display::BitmapData/draw()
Runnig the built-in "live" application, I've tried:
1) Copy the "live" application from samples. In the main.asc:
//this.HTMLDomainsAuth = true
//this.SWFDomainsAuth = true
p_client.videoSampleAccess = "/"
p_client.audioSampleAccess = "/";
2) Edit the /applications/live/Application.xml
<Client override="yes"> (Tried both with and without the override option)
<AudioSampleAccess enabled="true">/</AudioSampleAccess>
<VideoSampleAccess enabled="true">/</VideoSampleAccess>
3) Edit /conf/_defaultRoot_/_defaultVHost_/Application.xml to set the following:
<Client override="yes"> (Tried both with and without the override option)
<AudioSampleAccess enabled="true">/</AudioSampleAccess>
<VideoSampleAccess enabled="true">/</VideoSampleAccess>
4) Made sure my crossdomain.xml file is at the root of the swf's domain
5) Tried netstream.checkPolicyFile = true
6) Tried to play the stream, wait 10 seconds with a timer, then try to do the draw()
I've restarted the Flash server multiple times and have had no luck.
hello i also face this problem , but my method solve this, i think its because it cant render bitmpdata while the video`s netstream doesnt work ,
so i removechild and clear the video while the netstream is close or before its init, and addchild while the netstream is playinb ,so the problem doesnt show again
while removechile video object the bitmapdata doesnt render it , so the error never occur , u can give it a try ^ ^
North America
Europe, Middle East and Africa
Asia Pacific