1
0
Fork 0
forked from 0x2620/oxjs

add Ox.VideoPlayer, demos/video/, and prove Chrome doesn't get buffered time ranges right

This commit is contained in:
rolux 2011-05-12 12:39:48 +02:00
commit 13b887abfb
5 changed files with 364 additions and 2 deletions

View file

@ -18,9 +18,11 @@ Ox.VideoElement = function(options, self) {
})
.options(options || {})
.attr({
//height: self.options.height,
poster: self.options.poster,
preload: 'auto',
src: self.options.url
src: self.options.url,
//width: self.options.width
})
.css({
height: self.options.height + 'px',
@ -28,8 +30,23 @@ Ox.VideoElement = function(options, self) {
})
.bind({
ended: ended,
canplay: function() {
Ox.print('canplay')
},
durationchange: function() {
Ox.print('durationchange')
},
loadedmetadata: function() {
Ox.print('loadedmetadata', self.video.duration)
self.video.currentTime = self.options.position;
that.triggerEvent('loadedmetadata', {
video: self.video
})
},
progress: function() {
that.triggerEvent('progress', {
video: self.video
});
}
});
@ -112,6 +129,7 @@ Ox.VideoElement = function(options, self) {
}
that.position = function(pos) {
// fixme: why not use options??
if (arguments.length == 0) {
return self.video.currentTime;
} else {