# HG changeset patch # User hamidouk # Date 1323356480 -3600 # Node ID ee6594f6d00de23ade6239273e0178253071d6e5 # Parent 99b7c5192330fc6ec0fc598a067b2f2a43e00726 play pause that just works (tm) diff -r 99b7c5192330 -r ee6594f6d00d src/js/pop.js --- a/src/js/pop.js Thu Dec 08 15:52:01 2011 +0100 +++ b/src/js/pop.js Thu Dec 08 16:01:20 2011 +0100 @@ -2,7 +2,9 @@ popcorn is a bit unstable at the time */ IriSP.PopcornReplacement = {}; -IriSP.PopcornReplacement.media = { "paused": true}; +IriSP.PopcornReplacement.media = { + "paused": true +}; IriSP.PopcornReplacement.listen = function(msg, callback) { IriSP.jQuery(IriSP.PopcornReplacement).bind(msg, function(event, rest) { callback(rest); }); @@ -30,8 +32,8 @@ options.events = { onReady: IriSP.PopcornReplacement.__initApi, onTime: IriSP.PopcornReplacement.__timeHandler, - // onPlay: IriSP.PopcornReplacement.__playHandler, - // onPause: IriSP.PopcornReplacement.__pauseHandler, + onPlay: IriSP.PopcornReplacement.__playHandler, + onPause: IriSP.PopcornReplacement.__pauseHandler, onSeek: IriSP.PopcornReplacement.__seekHandler } @@ -157,10 +159,12 @@ IriSP.PopcornReplacement.__playHandler = function(event) { IriSP.PopcornReplacement.media.paused = false; + IriSP.PopcornReplacement.trigger("play"); }; IriSP.PopcornReplacement.__pauseHandler = function(event) { IriSP.PopcornReplacement.media.paused = true; + IriSP.PopcornReplacement.trigger("pause"); }; IriSP.PopcornReplacement.roundTime = function() {