forked from 0x2620/oxjs
add playbackRate to video elements
This commit is contained in:
parent
da08120ff4
commit
f2e7c75d2c
5 changed files with 32 additions and 3 deletions
|
|
@ -6,6 +6,7 @@ Ox.VideoElement <f> VideoElement Object
|
|||
autoplay <b|false> autoplay
|
||||
items <a|[]> array of objects with src,in,out,duration
|
||||
loop <b|false> loop playback
|
||||
playbackRate <n|1> playback rate
|
||||
self <o> Shared private variable
|
||||
([options[, self]]) -> <o:Ox.Element> VideoElement Object
|
||||
loadedmetadata <!> loadedmetadata
|
||||
|
|
@ -23,6 +24,7 @@ Ox.VideoElement = function(options, self) {
|
|||
.defaults({
|
||||
autoplay: false,
|
||||
loop: false,
|
||||
playbackRate: 1,
|
||||
items: []
|
||||
})
|
||||
.options(options || {})
|
||||
|
|
@ -67,11 +69,13 @@ Ox.VideoElement = function(options, self) {
|
|||
that.triggerEvent('durationchange', {
|
||||
duration: that.duration()
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
playbackRate: function() {
|
||||
self.video.playbackRate = self.options.playbackRate;
|
||||
}
|
||||
})
|
||||
.css({width: '100%', height: '100%'});
|
||||
|
|
@ -157,7 +161,6 @@ Ox.VideoElement = function(options, self) {
|
|||
}
|
||||
});
|
||||
}
|
||||
|
||||
},
|
||||
seeking: function() {
|
||||
//seeking event triggered in setCurrentTime
|
||||
|
|
@ -317,6 +320,7 @@ Ox.VideoElement = function(options, self) {
|
|||
}
|
||||
self.video.volume = volume;
|
||||
self.video.muted = muted;
|
||||
self.video.playbackRate = self.options.playbackRate;
|
||||
self.$video.css(css);
|
||||
self.buffering = true;
|
||||
Ox.Log('Video', 'sCV', self.video.src, item['in'],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue