         private var _req_id : String;
 
         public function JSURLStream(){
-            _hola_managed = HSettings.enabled;
+            _hola_managed = HSettings.enabled && ExternalInterface.available;
             addEventListener(Event.OPEN, onOpen);
+            super();
+            if (!_hola_managed || js_api_inited)
+                return;
+            // Connect calls to JS.
+            ZErr.log('JSURLStream init api');
             ExternalInterface.marshallExceptions = true;
-            super();
-            // Connect calls to JS.
-            if (ExternalInterface.available && !js_api_inited){
-                ZErr.log('JSURLStream init api');
-                js_api_inited = true;
-                ExternalInterface.addCallback('hola_onFragmentData',
-                    hola_onFragmentData);
-            }
+            ExternalInterface.addCallback('hola_onFragmentData',
+                hola_onFragmentData);
+            js_api_inited = true;
         }
 
         protected function _trigger(cb:String, data:Object) : void {
-            if (!ExternalInterface.available) {
+            if (!_hola_managed)
+            {
                 // XXX arik: need ZErr.throw
                 ZErr.log('invalid trigger');
                 throw new Error('invalid trigger');


        override public function load(request : URLRequest) : void {
            // XXX arik: cleanup previous if hola mode changed
            _hola_managed = HSettings.enabled;
            req_count++;
            _req_id = 'req'+req_count;
            if (!_hola_managed)

        private function onOpen(event : Event) : void { _connected = true; }

        private function decode(str : String) : void {
            if (!str)
                return on_decoded_data(null);
            if (!HSettings.use_worker)
                return on_decoded_data(Base64.decode_str(str));
            var data : ByteArray = new ByteArray();
            data.shareable = true;
            data.writeUTFBytes(str);
            WorkerUtils.send({cmd: "b64.decode", id: _req_id});
