cms/app-client/app/components/player-component.js
changeset 264 e0fc9f698b9b
parent 262 e999bcaa0c08
child 272 97c06607949b
equal deleted inserted replaced
263:3deace9204de 264:e0fc9f698b9b
     1 import Ember from 'ember';
     1 import Ember from 'ember';
     2 import Popcorn from 'popcorn';
     2 import Popcorn from 'popcorn';
     3 
     3 
     4 export default Ember.Component.extend({
     4 export default Ember.Component.extend({
     5     classNames: ['player-component'],
     5     classNames: ['player-component'],
     6     classNameBindings: ['video:video', 'reduce:reduce'],
     6     classNameBindings: ['video:video'],
     7     video: Ember.computed.alias('player.model.video'),
     7     video: Ember.computed.alias('player.model.video'),
     8     reduce: Ember.computed.alias('player.reduce'),
       
     9 
     8 
    10     player: Ember.inject.service(),
     9     player: Ember.inject.service(),
    11     popcorn: null,
    10     popcorn: null,
    12 
    11 
    13     head: 0,
    12     head: 0,
    50 
    49 
    51         this._super(...arguments);
    50         this._super(...arguments);
    52     },
    51     },
    53 
    52 
    54     didInsertElement: function() {
    53     didInsertElement: function() {
    55         this.set('popcorn', Popcorn('#popcorn-audio'));
    54         this.set('popcorn', new Popcorn('#popcorn-audio'));
    56         this.get('popcorn').on('loadeddata', Ember.run.bind(this, this.get('onUpdate')));
    55         this.get('popcorn').on('loadeddata', Ember.run.bind(this, this.get('onUpdate')));
    57         this.get('popcorn').on('timeupdate', Ember.run.bind(this, this.get('onUpdate')));
    56         this.get('popcorn').on('timeupdate', Ember.run.bind(this, this.get('onUpdate')));
    58 
    57 
    59         this.get('player').on('reset', Ember.run.bind(this, function(id) {
    58         this.get('player').on('reset', Ember.run.bind(this, function(id) {
    60             if(this.get('player').get('item') !== id) {
    59             if(this.get('player').get('item') !== id) {