From e15b320ee51545e2d658364489a887e4a4cc5b98 Mon Sep 17 00:00:00 2001 From: ScottDowne Date: Thu, 14 Oct 2010 13:53:46 -0400 Subject: [PATCH] tic #115 javascript command --- popcorn.js | 23 ++++++++++++++++++++++- tools/jsshellhelper.pyc | Bin 1161 -> 1164 bytes 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/popcorn.js b/popcorn.js index 04726d4..83330fd 100644 --- a/popcorn.js +++ b/popcorn.js @@ -965,7 +965,23 @@ 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? @@ -1035,6 +1051,11 @@ 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); + } } }; diff --git a/tools/jsshellhelper.pyc b/tools/jsshellhelper.pyc index ab8571954f30ba18517757ad861368f5e5e60b7f..9780ec4372298aebc32786e479fa940731f75940 100644 GIT binary patch delta 102 zcmeC=?BQg;_=%V6g3$Jj?Ci{<8Vn2!`WgATsrtpq`6VU#1^ER=hLi6zOH8(6o`_R6 M8K;cI091z`%>V!Z delta 99 zcmeC-?Bry>_=%UxbFTbGc6MeFbp{3o{fzwFRQ=-Q{E`y=vaDj$$q$(&CR;O4#3h-G LOG09DA&WEs(qJCH -- 2.43.0