handle video formats and resolutions

This commit is contained in:
rlx 2011-08-19 14:44:03 +00:00
commit ba96bfb76c
5 changed files with 45 additions and 16 deletions

View file

@ -39,6 +39,8 @@ Ox.VideoElement = function(options, self) {
setCurrentPart(self.currentPart + 1);
self.video.play();
} else {
self.ended = true;
self.paused = true;
that.triggerEvent('ended');
}
},
@ -89,7 +91,6 @@ Ox.VideoElement = function(options, self) {
}
function setCurrentPart(part) {
Ox.print('sCP', part)
var css = {};
['left', 'top', 'width', 'height'].forEach(function(key) {
css[key] = self.$video.css(key);
@ -130,6 +131,7 @@ Ox.VideoElement = function(options, self) {
that.currentTime = function() {
var ret;
self.ended = false;
if (arguments.length == 0) {
ret = getCurrentTime();
} else {
@ -159,6 +161,10 @@ Ox.VideoElement = function(options, self) {
};
that.play = function() {
if (self.ended) {
that.currentTime(0);
self.ended = false;
}
self.paused = false;
self.video.play();
return that;