src/js/pop.js
branchpopcorn-port
changeset 442 ee6594f6d00d
parent 441 99b7c5192330
child 445 c2eac11a9053
--- 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() {