animate subtitles on toggle scale
This commit is contained in:
parent
d437d95f96
commit
cbcfbe8340
1 changed files with 16 additions and 15 deletions
|
@ -1509,7 +1509,19 @@ Ox.VideoPlayer = function(options, self) {
|
|||
marginLeft: -self.timelineImageWidth + 'px'
|
||||
};
|
||||
} else if (element == 'subtitle') {
|
||||
css = getSubtitlesCSS();
|
||||
css = {
|
||||
bottom: (
|
||||
Math.floor(self.height / 16)
|
||||
+ Math.floor(
|
||||
self.options.subtitlesOffset / 100 * self.height
|
||||
)
|
||||
+ (self.options.subtitlesOffset ? getVideoCSS().top : 0)
|
||||
+ !!self.controlsBottomAreVisible * 16
|
||||
) + 'px',
|
||||
width: self.width + 'px',
|
||||
fontSize: Math.floor(self.height / 20) + 'px',
|
||||
WebkitTextStroke: (self.height / 1000) + 'px rgb(0, 0, 0)'
|
||||
};
|
||||
} else if (element == 'spaceBottom' || element == 'timeline') {
|
||||
css = {
|
||||
width: self.timelineWidth + 'px'
|
||||
|
@ -1631,20 +1643,6 @@ Ox.VideoPlayer = function(options, self) {
|
|||
: [];
|
||||
}
|
||||
|
||||
function getSubtitlesCSS() {
|
||||
return {
|
||||
bottom: (
|
||||
Math.floor(self.height / 16)
|
||||
+ Math.floor(self.options.subtitlesOffset / 100 * self.height)
|
||||
+ (self.options.subtitlesOffset ? getVideoCSS().top : 0)
|
||||
+ !!self.controlsBottomAreVisible * 16
|
||||
) + 'px',
|
||||
width: self.width + 'px',
|
||||
fontSize: Math.floor(self.height / 20) + 'px',
|
||||
WebkitTextStroke: (self.height / 1000) + 'px rgb(0, 0, 0)'
|
||||
};
|
||||
}
|
||||
|
||||
function getTimeline() {
|
||||
var $timeline = Ox.SmallVideoTimeline({
|
||||
//_offset: getTimelineLeft(),
|
||||
|
@ -2692,6 +2690,9 @@ Ox.VideoPlayer = function(options, self) {
|
|||
self.videoCSS = getVideoCSS();
|
||||
self.$video.animate(self.videoCSS, 250);
|
||||
self.$poster && self.$poster.animate(self.videoCSS, 250);
|
||||
self.$subtitle && self.$subtitle.animate({
|
||||
bottom: getCSS('subtitle').bottom
|
||||
}, 250);
|
||||
if (self.$scaleButton && from != 'button') {
|
||||
self.$scaleButton.toggle();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue