src/js/pop.js
branchpopcorn-port
changeset 723 bbf9914a5f99
parent 711 323205a7bd39
child 749 e9ee52225395
equal deleted inserted replaced
722:ed12570ebd64 723:bbf9914a5f99
    99 IriSP.PopcornReplacement.player.prototype.currentTime = function(time) {
    99 IriSP.PopcornReplacement.player.prototype.currentTime = function(time) {
   100   if (typeof(time) === "undefined") {        
   100   if (typeof(time) === "undefined") {        
   101       return this.playerFns.getPosition();            
   101       return this.playerFns.getPosition();            
   102   } else {
   102   } else {
   103      var currentTime = +time;
   103      var currentTime = +time;
   104      this.playerFns.seek( currentTime );
   104      this.playerFns.seek(currentTime);              
   105      this.__delay_seek_signal = true;    /* FIXME : useless ? */
       
   106      this.trigger("seeked");           
       
   107      return currentTime;
   105      return currentTime;
   108   }
   106   }
   109 };
   107 };
   110 
   108 
   111 IriSP.PopcornReplacement.player.prototype.play = function() {
   109 IriSP.PopcornReplacement.player.prototype.play = function() {
   177   this.trigger("timeupdate");
   175   this.trigger("timeupdate");
   178 };
   176 };
   179 
   177 
   180 IriSP.PopcornReplacement.player.prototype.__seekHandler = function(event) {
   178 IriSP.PopcornReplacement.player.prototype.__seekHandler = function(event) {
   181   var i = 0;
   179   var i = 0;
   182 
   180   
   183   for(i = 0; i < this.__codes.length; i++) {
   181   for(i = 0; i < this.__codes.length; i++) {
   184      var c = this.__codes[i];
   182      var c = this.__codes[i];
   185     
   183     
   186      if (event.position >= c.start && event.position < c.end) {        
   184      if (event.position >= c.start && event.position < c.end) {        
   187         c.onEnd();
   185         c.onEnd();
   197      if (event.offset >= c.start && event.offset < c.end) { 
   195      if (event.offset >= c.start && event.offset < c.end) { 
   198        c.onStart();
   196        c.onStart();
   199      }
   197      }
   200      
   198      
   201    }
   199    }
   202 
   200   
   203   this.trigger("timeupdate");
   201   this.trigger("seeked");  
   204 };
   202 };
   205 
   203 
   206 IriSP.PopcornReplacement.player.prototype.__playHandler = function(event) {
   204 IriSP.PopcornReplacement.player.prototype.__playHandler = function(event) {
   207   this.media.paused = false;
   205   this.media.paused = false;
   208   this.trigger("play");
   206   this.trigger("play");