cms/app-client/app/components/player-component.js
changeset 246 5b7ae96768be
parent 242 523ca6e73353
child 247 7a5d729992b8
equal deleted inserted replaced
245:c9dd78a43b07 246:5b7ae96768be
    53             }
    53             }
    54         }));
    54         }));
    55     },
    55     },
    56 
    56 
    57     onUpdate: function() {
    57     onUpdate: function() {
    58         var currentTime = this.get('popcorn').currentTime();
    58         var progress = this.get('popcorn').currentTime();
    59         var duration = this.get('popcorn').duration();
    59         var duration = this.get('popcorn').duration();
    60         this.$('.bar .value').width(currentTime * 100 / duration + '%');
    60         this.$('.bar .value').width(progress * 100 / duration + '%');
    61         this.set('head', currentTime);
    61         this.get('player').set('progress', progress * 1000);
    62         this.set('remaining', duration - currentTime);
    62         this.set('head', progress);
       
    63         this.set('remaining', duration - progress);
    63     },
    64     },
    64 
    65 
    65     onPlay: function() {
    66     onPlay: function() {
    66         this.get('player').set('playing', true);
    67         this.get('player').set('playing', true);
    67     },
    68     },