10 Replies Latest reply on Apr 16, 2013 3:19 AM by yu cheng lung

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




      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



      /applications/live/main.asc has the code below:



      application.onConnect = function( client )


          client.videoSampleAccess = "/";

          this.acceptConnection(client) ;




      The Application.xml has the tag:






                <VideoSampleAccess enabled="true">/</VideoSampleAccess>





      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.mediaHeight);

      loadable.netStream.checkPolicyFile = true;




      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.