3 Replies Latest reply on Nov 4, 2010 2:35 PM by Coco213

    Security error




      I'm trying to manipulate the pixel the video with the function Bitmap.draw( mediaContainer for instance ) but I have a security error :


      Async error when loading media Security error #2123 Violation de la sécurité Sandbow. Acces refusé à tous les fichiers de régulation (acces refuse to all regulation files)


      Any idea about that ?


      If I use a simple NetStream / NetConnection / Video class, I've not this issue.


      Thanks for any help !

        • 1. Re: Security error
          Coco213 Level 1

          I've looking for the #2123 error on the web, and it seems I've to pass a Context instance to the URLRequest :


          Something like this :


                      var context: LoaderContext = new LoaderContext()
                      context.checkPolicyFile = true;
                      context.securityDomain = SecurityDomain.currentDomain;
                      context.applicationDomain = ApplicationDomain.currentDomain;
                      loader.load( new URLRequest( video_url ), context )


          But I don't know where to pass the context ...


          And I don't really understand why I've a security error : the swf and the flv are on the same adress !


          Thanks for any help

          • 2. Re: Security error
            Andrian Cucu Adobe Employee

            Hi Coco213,


            The snippet below works for me (in Strobe Media Playback from trunk) only after the video playback has started.


            var bitmapData:BitmapData;

            var bitmap:Bitmap;

            bitmapData = new BitmapData(200, 200);



            bitmap = new Bitmap(bitmapData);




            If you try to use it before the video starts, you'll get the security error that you describe.


            For detecting the mediaPlayer state change, use a snippet like this:


            player.media.addEventListener(MediaPlayerStateChangeEvent.MEDIA_PLAYER_STATE_CHANGE, onMediaPlayerStateChange);


            private function onMediaPlayerStateChange(event:MediaPlayerStateChangeEvent):void



            if (event.state == MediaPlayerState.PLAYING)

                   // Do your magic...




            Please confirm if that solved your issue.


            Merci et A+,


            • 3. Re: Security error
              Coco213 Level 1



              Thanks, it works now.


              But I don't know why, before, even when the video was started, the error was still catch in my try / catch block ...



              I think there is an error in the snipet, it seems to be :


              player.addEventListener(MediaPlayerStateChangeEvent.MEDIA_PLAYER_STATE_CHANGE, onMediaPlayerStateChange);


              rather than


              player.media.addEventListener(MediaPlayerStateChangeEvent.MEDIA_PLAYER_STATE_CHANGE, onMediaPlayerStateChange);



              Best regards