Browse Source
Merge pull request #1367 from allmonday/dev
adding poster attribute for video component.
pull/1375/head
Artur Arseniev
8 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
9 additions and
1 deletions
-
src/dom_components/model/ComponentVideo.js
-
src/dom_components/view/ComponentVideoView.js
|
|
|
@ -17,6 +17,7 @@ module.exports = Component.extend( |
|
|
|
ytncUrl: 'https://www.youtube-nocookie.com/embed/', |
|
|
|
viUrl: 'https://player.vimeo.com/video/', |
|
|
|
loop: 0, |
|
|
|
poster: '', |
|
|
|
muted: 0, |
|
|
|
autoplay: 0, |
|
|
|
controls: 1, |
|
|
|
@ -178,6 +179,12 @@ module.exports = Component.extend( |
|
|
|
placeholder: 'eg. ./media/video.mp4', |
|
|
|
changeProp: 1 |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: 'Poster', |
|
|
|
name: 'poster', |
|
|
|
placeholder: '', |
|
|
|
changeProp: 1 |
|
|
|
}, |
|
|
|
this.getAutoplayTrait(), |
|
|
|
this.getLoopTrait(), |
|
|
|
this.getControlsTrait() |
|
|
|
|
|
|
|
@ -12,7 +12,7 @@ module.exports = ComponentView.extend({ |
|
|
|
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:loop change:autoplay change:controls change:color change:rel change:modestbranding change:poster', |
|
|
|
this.updateVideo |
|
|
|
); |
|
|
|
this.listenTo(this.model, 'change:provider', this.updateProvider); |
|
|
|
@ -67,6 +67,7 @@ module.exports = ComponentView.extend({ |
|
|
|
videoEl.loop = md.get('loop'); |
|
|
|
videoEl.autoplay = md.get('autoplay'); |
|
|
|
videoEl.controls = md.get('controls'); |
|
|
|
videoEl.poster = md.get('poster'); |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
|