fix setting paused=false before video is loaded on VideoPlayer;fix calling play() on VideoElement before its ready.

This commit is contained in:
j 2014-04-10 12:50:12 +00:00
parent 8c584dea18
commit 95e6e4c36f
2 changed files with 8 additions and 6 deletions

View file

@ -459,10 +459,12 @@ Ox.VideoElement = function(options, self) {
if (self.ended) { if (self.ended) {
that.currentTime(0); that.currentTime(0);
} }
self.ended = false; isReady(self.$video, function(video) {
self.paused = false; self.ended = false;
self.seeking = false; self.paused = false;
self.video.play(); self.seeking = false;
video.play();
});
return that; return that;
}; };

View file

@ -1874,9 +1874,9 @@ Ox.VideoPlayer = function(options, self) {
if (!self.options.paused) { if (!self.options.paused) {
self.options.paused = true; self.options.paused = true;
togglePaused('button'); togglePaused('loadedmetadata');
} else if (self.options.paused && self.playOnLoad) { } else if (self.options.paused && self.playOnLoad) {
togglePaused('button'); togglePaused('loadedmetadata');
} }
self.$playButton && self.$playButton.options({disabled: false}); self.$playButton && self.$playButton.options({disabled: false});