|
|
|
@ -8,13 +8,20 @@ export default ComponentView.extend({ |
|
|
|
|
|
|
|
initialize(o) { |
|
|
|
OComponentView.prototype.initialize.apply(this, arguments); |
|
|
|
this.listenTo(this.model, 'change:src', this.updateSrc); |
|
|
|
this.listenTo( |
|
|
|
this.model, |
|
|
|
'change:loop change:autoplay change:controls change:color change:rel change:modestbranding change:poster', |
|
|
|
this.updateVideo |
|
|
|
); |
|
|
|
this.listenTo(this.model, 'change:provider', this.updateProvider); |
|
|
|
const { model } = this; |
|
|
|
const props = [ |
|
|
|
'loop', |
|
|
|
'autoplay', |
|
|
|
'controls', |
|
|
|
'color', |
|
|
|
'rel', |
|
|
|
'modestbranding', |
|
|
|
'poster' |
|
|
|
]; |
|
|
|
const events = props.map(p => `change:${p}`).join(' '); |
|
|
|
this.listenTo(model, 'change:provider', this.updateProvider); |
|
|
|
this.listenTo(model, 'change:src', this.updateSrc); |
|
|
|
this.listenTo(model, events, this.updateVideo); |
|
|
|
}, |
|
|
|
|
|
|
|
/** |
|
|
|
@ -138,6 +145,7 @@ export default ComponentView.extend({ |
|
|
|
this.updateClasses(); |
|
|
|
var prov = this.model.get('provider'); |
|
|
|
this.el.appendChild(this.renderByProvider(prov)); |
|
|
|
this.updateVideo(); |
|
|
|
return this; |
|
|
|
} |
|
|
|
}); |
|
|
|
|