use VideoElement loop in VideoPlayer

This commit is contained in:
j 2017-04-16 22:54:40 +02:00
parent c32d50e82e
commit c0bfe480ad

View file

@ -438,6 +438,7 @@ Ox.VideoPlayer = function(options, self) {
self.$video = Ox.VideoElement({
items: self.video,
loop: self.options.loop,
playbackRate: self.options.playbackRate
})
.bindEvent(Ox.extend({
@ -1341,10 +1342,6 @@ Ox.VideoPlayer = function(options, self) {
}
function ended() {
if (self.options.loop) {
rewind();
self.$video.play();
} else {
!self.options.paused && togglePaused();
if (self.options.poster) {
self.$poster.animate({
@ -1361,7 +1358,6 @@ Ox.VideoPlayer = function(options, self) {
self.options.rewind && setTimeout(rewind, 250);
that.triggerEvent('ended');
}
}
function enterFullscreen() {
that.on({
@ -2638,6 +2634,7 @@ Ox.VideoPlayer = function(options, self) {
function toggleLoop(from) {
self.options.loop = !self.options.loop;
self.$video.options('loop', self.options.loop);
if (self.$loopButton && from != 'button') {
self.$loopButton.toggle();
}