]> khamidou — GitHub mirrors - popcorn-js.git/commitdiff
tic #115 javascript command
authorScottDowne <sdowne@learn.senecac.on.ca>
Thu, 14 Oct 2010 17:53:46 +0000 (13:53 -0400)
committerScottDowne <sdowne@learn.senecac.on.ca>
Thu, 14 Oct 2010 17:53:46 +0000 (13:53 -0400)
popcorn.js
tools/jsshellhelper.pyc

index 04726d4204886b9f1ea8cfd01d79d8cd2f747d1a..83330fd109c3dd0376013494379d3f07c515e26c 100644 (file)
       this.videoManager.videoElement.currentTime = this.params.seekto;
     };
   };
-  
+
+  ////////////////////////////////////////////////////////////////////////////
+  // Javascript Command
+  ////////////////////////////////////////////////////////////////////////////
+
+  Popcorn.JsCommand = function(name, params, text, videoManager) {
+    Popcorn.VideoCommand.call(this, name, params, text, videoManager);
+    this.start = eval(this.params.start);
+    this.stop = eval(this.params.stop);
+    this.onIn = function() {
+      this.start();
+    };
+    this.onOut = function() {
+      this.stop();
+    };
+  };
+
   // Wrapper for accessing commands by name
   // commands[name].create() returns a new command of type name
   // Not sure if this is the best way; maybe it's too fancy?
       create: function(name, params, text, videoManager) {
         return new Popcorn.SeekCommand(name, params, text, videoManager);
       }
+    },
+    javascript: {
+      create: function(name, params, text, videoManager) {
+        return new Popcorn.JsCommand(name, params, text, videoManager);
+      }
     }
   };
 
index ab8571954f30ba18517757ad861368f5e5e60b7f..9780ec4372298aebc32786e479fa940731f75940 100644 (file)
Binary files a/tools/jsshellhelper.pyc and b/tools/jsshellhelper.pyc differ