keep playing after resolution change

This commit is contained in:
rolux 2011-05-17 18:18:44 +02:00
parent 26dd7debe3
commit 1086be2686

View file

@ -692,7 +692,7 @@ Ox.VideoPlayer = function(options, self) {
self.$resolutionButton = $('<div>')
.css({
float: 'left',
width: '28px',
width: '32px',
height: '12px',
padding: '2px',
fontSize: '9px',
@ -713,7 +713,6 @@ Ox.VideoPlayer = function(options, self) {
position: 'absolute',
right: 0,
bottom: '16px',
width: '48px',
height: (self.resolutions.length * 16) + 'px',
background: 'transparent'
})
@ -740,6 +739,7 @@ Ox.VideoPlayer = function(options, self) {
self.resolutions.forEach(function(resolution, i) {
var $item = $('<div>')
.css({
width: '52px',
height: '16px',
background: 'rgba(32, 32, 32, 0.5)'
})
@ -772,7 +772,7 @@ Ox.VideoPlayer = function(options, self) {
$('<div>')
.css({
float: 'left',
width: '32px',
width: '36px',
height: '14px',
paddingTop: '2px',
fontSize: '9px',
@ -1326,7 +1326,7 @@ Ox.VideoPlayer = function(options, self) {
return prev + (
curr == 'timeline' || curr == 'space' ? 0 :
curr == 'position' ? self.positionWidth :
curr == 'resolution' ? 32 : 16
curr == 'resolution' ? 36 : 16
);
}, 0);
}
@ -1408,9 +1408,10 @@ Ox.VideoPlayer = function(options, self) {
self.options.out < self.video.duration ?
self.options.out : self.video.duration;
self.options.duration = self.out - self['in'];
self.video.currentTime = self.options.position;
self.$video.css(getCSS('video'));
self.$poster && self.$poster.css(getCSS('poster'));
self.video.currentTime = self.options.position;
self.playOnLoad && self.options.paused && togglePaused(true);
//self.$poster && self.$poster.css(getCSS('poster'));
hideLoadingIcon();
if (self.options.showIcon || self.options.showIconOnLoad) {
@ -1532,6 +1533,10 @@ Ox.VideoPlayer = function(options, self) {
}
function setResolution() {
if (!self.options.paused) {
self.playOnLoad = true;
togglePaused(true);
}
self.loaded = false;
showLoadingIcon();
self.video.src = self.options.video[self.options.resolution];