From 03cbb92654232cb0a3519f315d6c68ad2f8e7248 Mon Sep 17 00:00:00 2001 From: rolux Date: Thu, 13 Mar 2014 18:53:02 +0000 Subject: [PATCH] cleanup VideoElement --- source/Ox.UI/js/Video/VideoElement.js | 6 ++++-- source/Ox.UI/js/Video/VideoPlayer.js | 17 +++-------------- 2 files changed, 7 insertions(+), 16 deletions(-) diff --git a/source/Ox.UI/js/Video/VideoElement.js b/source/Ox.UI/js/Video/VideoElement.js index 9dceb2cd..395b51c7 100644 --- a/source/Ox.UI/js/Video/VideoElement.js +++ b/source/Ox.UI/js/Video/VideoElement.js @@ -5,7 +5,7 @@ Ox.VideoElement VideoElement Object options Options object autoplay autoplay items array of objects with src,in,out,duration - look loop playback + loop loop playback self Shared private variable ([options[, self]]) -> VideoElement Object loadedmetadata loadedmetadata @@ -109,7 +109,9 @@ Ox.VideoElement = function(options, self) { loadItems(function() { setCurrentItem(0); - self.options.autoplay && that.play(); + self.options.autoplay && setTimeout(function() { + that.play(); + }); }); function getCurrentTime() { diff --git a/source/Ox.UI/js/Video/VideoPlayer.js b/source/Ox.UI/js/Video/VideoPlayer.js index dadd58b6..1731dbdd 100644 --- a/source/Ox.UI/js/Video/VideoPlayer.js +++ b/source/Ox.UI/js/Video/VideoPlayer.js @@ -49,7 +49,6 @@ Ox.VideoPlayer Generic Video Player position Initial position (sec) poster Poster URL posterFrame Position of poster frame (sec) - preload 'auto', 'metadata' or 'none' out Out point (sec) resolution resolution rewind If true, video will rewind when ended @@ -146,7 +145,6 @@ Ox.VideoPlayer = function(options, self) { position: 0, poster: '', posterFrame: -1, - preload: 'auto', out: 0, resolution: 0, rewind: false, @@ -416,18 +414,9 @@ Ox.VideoPlayer = function(options, self) { dragend: dragend }); - self.$video = Ox.VideoElement( - // autoplay seems to always play from the beginning, - // and poster doesn't seem to work at all - Ox.extend({ - preload: self.options.preload, - items: self.video, - }, !self.options.paused && !self.options.playInToOut ? { - /*autoplay: 'autoplay'*/ - } : {}/*, self.options.poster ? { - poster: self.options.poster - } : {}*/) - ) + self.$video = Ox.VideoElement({ + items: self.video + }) .bindEvent(Ox.extend({ durationchange: durationchange, ended: ended,