equal
deleted
inserted
replaced
44 |
44 |
45 this.get('player').on('reset', Ember.run.bind(this, function(id) { |
45 this.get('player').on('reset', Ember.run.bind(this, function(id) { |
46 if(this.get('player').get('item') !== id) { |
46 if(this.get('player').get('item') !== id) { |
47 this.get('popcorn').on('loadeddata', Ember.run.bind(this, this.get('play'))); |
47 this.get('popcorn').on('loadeddata', Ember.run.bind(this, this.get('play'))); |
48 } else { |
48 } else { |
49 this.toggle(); |
49 this.send('toggle'); |
50 } |
50 } |
51 })); |
51 })); |
52 }, |
52 }, |
53 |
53 |
54 onUpdate: function() { |
54 onUpdate: function() { |
73 |
73 |
74 pause: function() { |
74 pause: function() { |
75 this.get('popcorn').pause(); |
75 this.get('popcorn').pause(); |
76 }, |
76 }, |
77 |
77 |
78 toggle: function() { |
78 actions: { |
79 if(this.get('player').get('playing')) { |
|
80 this.pause(); |
|
81 } else { |
|
82 this.play(); |
|
83 } |
|
84 }, |
|
85 |
79 |
86 actions: { |
80 toggle: function() { |
|
81 if(this.get('player').get('playing')) { |
|
82 this.pause(); |
|
83 } else { |
|
84 this.play(); |
|
85 } |
|
86 }, |
87 |
87 |
88 backward: function() { |
88 backward: function() { |
89 var index = this.get('player').get('items').indexOf(this.get('player').get('item')); |
89 var index = this.get('player').get('items').indexOf(this.get('player').get('item')); |
90 var item = this.get('player').get('items')[index - 1]; |
90 var item = this.get('player').get('items')[index - 1]; |
91 this.get('player').set('item', item); |
91 this.get('player').set('item', item); |
93 |
93 |
94 forward: function() { |
94 forward: function() { |
95 var index = this.get('player').get('items').indexOf(this.get('player').get('item')); |
95 var index = this.get('player').get('items').indexOf(this.get('player').get('item')); |
96 var item = this.get('player').get('items')[index + 1]; |
96 var item = this.get('player').get('items')[index + 1]; |
97 this.get('player').set('item', item); |
97 this.get('player').set('item', item); |
|
98 }, |
|
99 |
|
100 setTime: function(event) { |
|
101 this.get('popcorn').currentTime(event.layerX * this.get('popcorn').duration() / Ember.$(event.target).width()); |
98 } |
102 } |
99 |
103 |
100 } |
104 } |
101 }); |
105 }); |