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