diff -r a525cc2214e7 -r 2c025db10a10 src/js/pop.js --- a/src/js/pop.js Tue Apr 17 20:19:46 2012 +0200 +++ b/src/js/pop.js Wed Apr 18 18:58:44 2012 +0200 @@ -8,13 +8,15 @@ */ IriSP.PopcornReplacement.player = function(container, options) { /* the jwplayer calls the callbacks in the global space so we need to - preserve them using IriSP.wrap */ + preserve them this way */ + var _this = this; + this.callbacks = { - onReady: IriSP.wrap(this, this.__initApi), - onTime: IriSP.wrap(this, this.__timeHandler), - onPlay: IriSP.wrap(this, this.__playHandler), - onPause: IriSP.wrap(this, this.__pauseHandler), - onSeek: IriSP.wrap(this, this.__seekHandler) + onReady: IriSP._.bind(this.__initApi, this), + onTime: IriSP._.bind(this.__timeHandler, this), + onPlay: IriSP._.bind(this.__playHandler, this), + onPause: IriSP._.bind(this.__pauseHandler, this), + onSeek: IriSP._.bind(this.__seekHandler, this) }; this.media = { @@ -81,23 +83,6 @@ } }; -/* -IriSP.PopcornReplacement.jwplayer = function(container, options) { - IriSP.PopcornReplacement._container = container.slice(1); //eschew the '#' - options.events = { - onReady: IriSP.PopcornReplacement.__initApi, - onTime: IriSP.PopcornReplacement.__timeHandler, - onPlay: IriSP.PopcornReplacement.__playHandler, - onPause: IriSP.PopcornReplacement.__pauseHandler, - onSeek: IriSP.PopcornReplacement.__seekHandler - } - - jwplayer(IriSP.PopcornReplacement._container).setup(options); - IriSP.PopcornReplacement.media.duration = options.duration; - return IriSP.PopcornReplacement; -}; -*/ - IriSP.PopcornReplacement.player.prototype.currentTime = function(time) { if (typeof(time) === "undefined") { return this.playerFns.getPosition();