Skip navigation
aronb123
Currently Being Moderated

!!Still unresolved error #2123: BitmapData.draw(), videosampleaccess, No policy files granted access

Sep 30, 2010 12:25 PM

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.

 
Replies
  • kglad
    72,340 posts
    Jul 21, 2002
    Currently Being Moderated
    Sep 30, 2010 12:37 PM   in reply to aronb123

    you need cross-domain policy files.

     
    |
    Mark as:
  • Currently Being Moderated
    Oct 28, 2010 1:04 PM   in reply to kglad

    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.

     
    |
    Mark as:
  • kglad
    72,340 posts
    Jul 21, 2002
    Currently Being Moderated
    Oct 28, 2010 1:48 PM   in reply to bdefore

    the answer to this issue is unchanged:  you need cross-domain policy files.

     
    |
    Mark as:
  • Currently Being Moderated
    Jan 13, 2011 1:15 AM   in reply to aronb123

    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.

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 22, 2011 9:24 AM   in reply to neilhighley.com

    Hey,

     

    I tried your solution but it does not work... I don't know what to do cause I found lots of differents solutions to fix it, but nothing seems working.

    I use FMS 3.5. Could you help me ?

     

    Tkx by advance

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 22, 2011 10:15 AM   in reply to pakit.ddps

    Hey guys,

     

    I finally found the solution. I followed the recommandation from Ekameleon and it works perfectly.

     

    http://www.ekameleon.net/blog/index.php?post/2008/02/20/93-fmis3-bitma pdatadraw-and-flash-player-901150-security-sandbox-violation

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 5, 2012 9:24 AM   in reply to pakit.ddps

    If you have already configured your FMS server settings and are wondering why you still get the error, try putting a delay after you play the stream and before you do your draw code. This solved the issue for me.

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 20, 2013 8:07 PM   in reply to micostar

    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.

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 16, 2013 3:19 AM   in reply to aronb123

    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 ^ ^

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points