first bind loadedmetadata, then set src

This commit is contained in:
rlx 2011-08-19 17:10:52 +00:00
parent 6d47477890
commit a9554bf477

View file

@ -26,12 +26,6 @@ Ox.VideoElement = function(options, self) {
self.$videos = self.options.src.map(function(src, i) { self.$videos = self.options.src.map(function(src, i) {
return $('<video>') return $('<video>')
.attr(Ox.extend({
preload: 'metadata',
src: src
}, i == 0 && self.options.autoplay ? {
autoplay: 'autoplay'
} : {}))
.css({position: 'absolute'}) .css({position: 'absolute'})
.bind({ .bind({
ended: function() { ended: function() {
@ -66,6 +60,12 @@ Ox.VideoElement = function(options, self) {
} }
}) })
.attr(Ox.extend({
preload: 'metadata',
src: src
}, i == 0 && self.options.autoplay ? {
autoplay: 'autoplay'
} : {}))
.hide() .hide()
.appendTo(that.$element); .appendTo(that.$element);
}); });