]> khamidou — GitHub mirrors - popcorn-js.git/commitdiff
removed the Window.Processing timeout block. it now uses the popcorn.getScript()...
authorChristopher De Cairos <chris.decairos@gmail.com>
Thu, 8 Sep 2011 15:09:43 +0000 (11:09 -0400)
committerChristopher De Cairos <chris.decairos@gmail.com>
Thu, 8 Sep 2011 15:09:43 +0000 (11:09 -0400)
plugins/gml/popcorn.gml.js

index 17cf12f4ea0d79ed763d585af3093eb30f6e0aa8..228825007b1672a8c357686863289d9e57ebd7f0 100755 (executable)
 
       if ( !window.Processing ) {
 
-        Popcorn.getScript( "http://processingjs.org/content/download/processing-js-1.2.1/processing-1.2.1.min.js" );
-      }
-
-      // makes sure both processing.js and the gml data are loaded
-      var readyCheck = function() {
-
-        if ( window.Processing ) {
-
+        Popcorn.getScript( "http://processingjs.org/content/download/processing-js-1.2.1/processing-1.2.1.min.js", function() {
+          
           Popcorn.getJSONP( "http://000000book.com/data/" + options.gmltag + ".json?callback=", function( data ) {
 
             options.pjsInstance = new Processing( options.container, gmlPlayer );
             options.pjsInstance.construct( self.media, data, options );
             options._running && options.pjsInstance.loop();
           }, false );
+        });
+      }
 
-          return;
-        }
-
-        setTimeout( readyCheck, 5 );
-      };
-
-      readyCheck();
     },
     /**
      * @member gml