cleanup VideoElement

This commit is contained in:
rolux 2014-03-13 18:53:02 +00:00
parent b487da90a1
commit 03cbb92654
2 changed files with 7 additions and 16 deletions

View file

@ -5,7 +5,7 @@ Ox.VideoElement <f> VideoElement Object
options <o> Options object
autoplay <b|false> autoplay
items <a|[]> array of objects with src,in,out,duration
look <b|false> loop playback
loop <b|false> loop playback
self <o> Shared private variable
([options[, self]]) -> <o:Ox.Element> 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() {

View file

@ -49,7 +49,6 @@ Ox.VideoPlayer <f> Generic Video Player
position <n|0> Initial position (sec)
poster <s|''> Poster URL
posterFrame <n|-1> Position of poster frame (sec)
preload <s|'auto'> 'auto', 'metadata' or 'none'
out <n> Out point (sec)
resolution <n|0> resolution
rewind <b|false> 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,