add subtitlesOffset

This commit is contained in:
j 2015-04-14 15:50:52 +01:00
commit 28d8271174
4 changed files with 11 additions and 1 deletions

View file

@ -71,6 +71,7 @@ Ox.VideoPlayer <f> Generic Video Player
out <n> Out point (sec)
text <s> Text
tracks <[s]> Track names, like "English" or "Director's Commentary"
subtitlesOffset <n|0> adds bottom offset below subtitles in % of height
subtitlesDefaultTrack <s|'English'> Track name
subtitlesTrack <s|'English'> Track name
timeline <s> Timeline image URL
@ -167,6 +168,7 @@ Ox.VideoPlayer = function(options, self) {
sizeIsLarge: false,
subtitles: [],
subtitlesDefaultTrack: 'English',
subtitlesOffset: 0,
subtitlesTrack: 'English',
timeline: '',
timelineType: '',
@ -1509,7 +1511,9 @@ Ox.VideoPlayer = function(options, self) {
} else if (element == 'subtitle') {
css = {
bottom: (Math.floor(self.height / 16)
+ !!self.controlsBottomAreVisible * 16) + 'px',
+ Math.floor(self.options.subtitlesOffset/100 * self.height)
+ !!self.controlsBottomAreVisible * 16
) + 'px',
width: self.width + 'px',
fontSize: Math.floor(self.height / 20) + 'px',
WebkitTextStroke: (self.height / 1000) + 'px rgb(0, 0, 0)'