src/js/widgets/playerWidget.js
branchpopcorn-port
changeset 296 10ecc65d945c
parent 295 be44f374549e
child 311 43a1b7d95317
equal deleted inserted replaced
295:be44f374549e 296:10ecc65d945c
    74       return;
    74       return;
    75       
    75       
    76   }
    76   }
    77   
    77   
    78   // we get it at each call because it may change.
    78   // we get it at each call because it may change.
    79   var duration = +this._serializer.currentMedia().meta["dc:duration"]; 
    79   var duration = +this._serializer.currentMedia().meta["dc:duration"] / 1000; 
    80   var totalTime = IriSP.secondsToTime(duration);
    80   var totalTime = IriSP.secondsToTime(duration);
    81   var elapsedTime = IriSP.secondsToTime(this._Popcorn.currentTime());
    81   var elapsedTime = IriSP.secondsToTime(this._Popcorn.currentTime());
    82   
    82   
    83   var timeTemplate = "{{hours}}:{{minutes}}:{{seconds}}";
    83   var timeTemplate = "{{hours}}:{{minutes}}:{{seconds}}";
    84   this.selector.find(".Ldt-ElapsedTime").html(Mustache.to_html(timeTemplate, elapsedTime));
    84   this.selector.find(".Ldt-ElapsedTime").html(Mustache.to_html(timeTemplate, elapsedTime));
    85   this.selector.find(".Ldt-TotalTime").html(Mustache.to_html(timeTemplate, totalTime));
    85   this.selector.find(".Ldt-TotalTime").html(Mustache.to_html(timeTemplate, totalTime));
    86   
       
    87   this._previousSecond = this._Popcorn.roundTime();
    86   this._previousSecond = this._Popcorn.roundTime();
    88 };
    87 };
    89 
    88 
    90 /* update the icon of the button - separate function from playHandler
    89 /* update the icon of the button - separate function from playHandler
    91    because in some cases (for instance, when the user directly clicks on
    90    because in some cases (for instance, when the user directly clicks on