12 Replies Latest reply on Oct 18, 2007 4:43 PM by EliteZorro

    Security Sandbox Error

    Damon Edwards Level 3
      I keep getting this sandbox violation when I try and stream this video using NetStream and NetConnect. I'm getting the path from an XML file. If i just pop the path into an FLVPlayback component, it works just fine. Any Ideas?

      Edited to hide IP.
        • 1. Re: Security Sandbox Error
          clbeech Level 3
          AS3 huh dz? dunno, how about working when mounted online? looks like it's from the local...maybe hell if I know.
          • 2. Security Sandbox Error
            Damon Edwards Level 3
            yea, AS3. The video file is 'online'. It is on one of our servers that we use for RTMP. I've tried adding
            Security.allowDomain("*");
            Security.allowInsecureDomain("*");

            but it doesn't help. I'm sure there is something else I need to add, that I'm overlooking, well, I hope there is... If i just place
            "rtmp://myIPAddress/mystreamingvideos/stafford.flv" into my path variable instead of the XML node, this is what I recieve for trace statements:
            NetConnection.Connect.Success
            Error opening URL 'rtmp://myIPAddress/mystreamingvideos/stafford.flv'
            NetStream.Play.StreamNotFound
            Stream not found: rtmp://myIPAddress/mystreamingvideos/stafford.flv

            BUT, if I place that same RTMP string into an FLVPlayback source, it will play the movie just fine, so I know it is there.. I'm a bit confused with this.

            p.s.
            I just realized I didn't hide the second IP shown in the Sandbox Violation.. I must be tired this morning.
            • 3. Re: Security Sandbox Error
              Damon Edwards Level 3
              if I wrap quotes around my path variable like so.. stream.play("\""+path+"\"");
              I get:
              NetConnection.Connect.Success
              Then same Sandbox Violation as before.. Is there some sort of Security File I need on the server now? Why didn't this happen in AS2?
              • 4. Re: Security Sandbox Error
                clbeech Level 3
                I dunno man, I haven't worked with AS3 or video stuff enough to be even stickin' my head in here... ;P

                ...tried changing the publish setting to network?
                • 5. Re: Security Sandbox Error
                  Damon Edwards Level 3
                  I think this has more to do with Flash Player 9 security settings... I've tried adding a crossdomain.xml file and using it:
                  Security.loadPolicyFile(" http://myIPAddress/crossdomain.xml");

                  Still nothing though. This is making me bang my dead on the desk!!
                  • 6. Re: Security Sandbox Error
                    Level 7
                    >>bang my dead on the desk!!

                    Now, that paints an interesting picture...

                    --
                    Dave -
                    Head Developer
                    http://www.blurredistinction.com
                    Adobe Community Expert
                    http://www.adobe.com/communities/experts/


                    • 7. Re: Security Sandbox Error
                      clbeech Level 3
                      Hey dz, I'm sure you read this but, I found this under 'NetConnection' class

                      "By default, loading and playing an audio or video file is not allowed if the calling SWF is local and tries to load and play a remote file. A user must grant explicit permissions to allow this"

                      that's all so far ... just reading a little :)
                      • 8. Re: Security Sandbox Error
                        Damon Edwards Level 3
                        "Now, that paints an interesting picture..."

                        Yes, interesting, yet painful picture.

                        @clbeech: I've given the SWF permission in the Global Security Settings, but of course, that didn't work. I was reading about a mms.cfg file that handles permissions too, but I don't even have one on my drive... I have a mm.cfg, but I can tell that is not it. This is extremely frustrating.
                        • 9. Re: Security Sandbox Error
                          Damon Edwards Level 3
                          Event an HTTP stream throws the Security Error... I believe I have every counter measure set so that it won't throw an error...
                          • 10. Re: Security Sandbox Error
                            Damon Edwards Level 3
                            ok, using HTTP stream placed directly into my stream.play() method, works, however, getting the URL from XML throws violation. Using RTMP stream placed directly into my stream.play() method, states 'stream not found', and getting URL from XML throws sandbox violation.
                            • 11. Re: Security Sandbox Error
                              clbeech Level 3
                              maybe set up an XML socket connection? I'm outta my league here ...
                              • 12. Re: Security Sandbox Error
                                EliteZorro
                                I'm running into the same issue:

                                HTTPStatus: 200
                                *** Security Sandbox Violation ***
                                Connection to " http://www.myurl.com/videos/Eagle.flv"

                                halted - not permitted from file:///X|/Projects/Current/Video/Vrs4%2D2/Videos.swf
                                SecurityError: Error #2147: Forbidden protocol in URL " http://www.myurl.com/videos/Eagle.flv"
                                .
                                at flash.net::URLStream/load()
                                at flash.net::URLLoader/load()
                                at fl.video::SMILManager/ http://www.adobe.com/2007/flash/flvplayback/internal::connectXML()
                                at fl.video::NCManager/connectToURL()
                                at fl.video::VideoPlayer/ http://www.adobe.com/2007/flash/flvplayback/internal::_load()
                                at fl.video::VideoPlayer/load()
                                at fl.video::FLVPlayback/::doContentPathConnect()
                                at fl.video::FLVPlayback/set source()
                                at Videos_fla::MainTimeline/onDataLoad()
                                at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
                                at flash.events::EventDispatcher/dispatchEvent()
                                at flash.net::URLLoader/flash.net:URLLoader::onComplete()


                                My action script looks like:



                                import fl.video.*;

                                var flvPlayer:FLVPlayback = new FLVPlayback();
                                addChild(flvPlayer);
                                //The next line assumes you have copied the skin file to the local directory

                                flvPlayer.skin = " http://www.myurl.com/includes/SkinUnderPlayStopSeekMuteVol.swf"

                                //Create the URLLOader instance
                                var myLoader:URLLoader = new URLLoader()
                                //the data will come as URL-encoded variables
                                myLoader.dataFormat = URLLoaderDataFormat.VARIABLES
                                //Load using an URLRequest, even beeing local
                                myLoader.load(new URLRequest(" http://www.myurl.com/videos/video-working.asp"))
                                //onLoad handler listener
                                myLoader.addEventListener(Event.COMPLETE, onDataLoad)
                                //Error handling
                                myLoader.addEventListener(IOErrorEvent.IO_ERROR, onIOError)
                                myLoader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onSecurityError)
                                //Could be an error or just a message
                                myLoader.addEventListener(HTTPStatusEvent.HTTP_STATUS, onHTTPStatus)
                                //add a listener for the complete event
                                function onDataLoad(evt:Event){
                                Comments_txt.text = evt.target.data.Comments
                                Commented_txt.text = evt.target.data.Comments
                                flvPlayer.source = evt.target.data.Comments;
                                }
                                //error callbacks
                                function onIOError(evt:IOErrorEvent){
                                trace("IOError: "+evt.text)
                                }
                                function onHTTPStatus(evt:HTTPStatusEvent){
                                trace("HTTPStatus: "+evt.status)
                                }
                                function onSecurityError(evt:SecurityErrorEvent){
                                trace("SecurityError: "+evt.text)
                                }



                                My text boxes are there to confirm that the variable is loading which it does. Which they do. When I put the URL directly into the actionscript is runs but once it's loaded I get the Sandbox Security Error.

                                Is this Adobe's way of making you purchase the Media Server to make it work? Before I was happy with the Merger but now it's seemingly like they make it so you have to buy more products to do the same stuff. Any help appreciated...