src/js/players/player.allocine.js
branchnew-model
changeset 919 972099304059
parent 884 10233337f6da
child 957 4da0a5740b6c
--- a/src/js/players/player.allocine.js	Wed Jun 20 18:41:41 2012 +0200
+++ b/src/js/players/player.allocine.js	Tue Jun 26 14:22:29 2012 +0200
@@ -77,13 +77,11 @@
     this.player = document.getElementById(this.container);
     this.player.addEventListener("onStateChange", "onAllocineStateChange");
     this.player.cueVideoByUrl(this._options.video);
-    this.callbacks.onReady();
+    this.trigger("loadedmetadata");
 };
 
 IriSP.PopcornReplacement.allocine.prototype.progressHandler = function(progressInfo) {
-    this.callbacks.onTime({
-        position: progressInfo.mediaTime
-    });
+    this.trigger("timeupdate");
 }
 
 
@@ -105,27 +103,18 @@
 }
 
 IriSP.PopcornReplacement.allocine.prototype.stateHandler = function(state) {
-    console.log("stateHandler");
     switch(state) {
         case 1:
-            this.callbacks.onPlay();
+            this.trigger("play");
             break;
 
         case 2:
-            this.callbacks.onPause();
+            this.trigger("pause");
             break;
 
         case 3:
-            this.callbacks.onSeek({
-                position: this.player.getCurrentTime()
-            });
+            this.trigger("seeked");
             break;
-
-        /*
-        case 5:
-            this.callbacks.onReady();
-            break;
-        */
     }
     
 };
\ No newline at end of file