Skip to content

Commit 669c172

Browse files
committed
Fix font-family bug in non-English players
1 parent 0e9951e commit 669c172

6 files changed

Lines changed: 24 additions & 24 deletions

File tree

build/ableplayer.dist.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1586,7 +1586,7 @@ var AblePlayerInstances = [];
15861586
'name': 'prefCaptionsFont',
15871587
'label': this.tt.prefCaptionsFont,
15881588
'group': 'captions',
1589-
'default': this.tt.sans
1589+
'default': 'sans'
15901590
});
15911591
prefs.push({
15921592
'name': 'prefCaptionsSize',
@@ -1828,7 +1828,7 @@ var AblePlayerInstances = [];
18281828
optionText = this.tt.captionsPositionBelow;
18291829
}
18301830
}
1831-
else if (thisPref === 'prefCaptionsColor' || thisPref === 'prefCaptionsBGColor') {
1831+
else if (thisPref === 'prefCaptionsFont' || thisPref === 'prefCaptionsColor' || thisPref === 'prefCaptionsBGColor') {
18321832
optionValue = options[j][0];
18331833
optionText = options[j][1];
18341834
}
@@ -9903,11 +9903,11 @@ if (thisObj.useTtml && (trackSrc.endsWith('.xml') || trackText.startsWith('<?xml
99039903
switch (pref) {
99049904

99059905
case 'prefCaptionsFont':
9906-
options[0] = this.tt.serif;
9907-
options[1] = this.tt.sans;
9908-
options[3] = this.tt.cursive;
9909-
options[4] = this.tt.fantasy;
9910-
options[2] = this.tt.monospace;
9906+
options[0] = ['serif',this.tt.serif];
9907+
options[1] = ['sans-serif',this.tt.sans];
9908+
options[2] = ['cursive',this.tt.cursive];
9909+
options[3] = ['fantasy',this.tt.fantasy];
9910+
options[4] = ['monospace',this.tt.monospace];
99119911
break;
99129912

99139913
case 'prefCaptionsColor':

build/ableplayer.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1586,7 +1586,7 @@ var AblePlayerInstances = [];
15861586
'name': 'prefCaptionsFont',
15871587
'label': this.tt.prefCaptionsFont,
15881588
'group': 'captions',
1589-
'default': this.tt.sans
1589+
'default': 'sans'
15901590
});
15911591
prefs.push({
15921592
'name': 'prefCaptionsSize',
@@ -1828,7 +1828,7 @@ var AblePlayerInstances = [];
18281828
optionText = this.tt.captionsPositionBelow;
18291829
}
18301830
}
1831-
else if (thisPref === 'prefCaptionsColor' || thisPref === 'prefCaptionsBGColor') {
1831+
else if (thisPref === 'prefCaptionsFont' || thisPref === 'prefCaptionsColor' || thisPref === 'prefCaptionsBGColor') {
18321832
optionValue = options[j][0];
18331833
optionText = options[j][1];
18341834
}
@@ -9903,11 +9903,11 @@ if (thisObj.useTtml && (trackSrc.endsWith('.xml') || trackText.startsWith('<?xml
99039903
switch (pref) {
99049904

99059905
case 'prefCaptionsFont':
9906-
options[0] = this.tt.serif;
9907-
options[1] = this.tt.sans;
9908-
options[3] = this.tt.cursive;
9909-
options[4] = this.tt.fantasy;
9910-
options[2] = this.tt.monospace;
9906+
options[0] = ['serif',this.tt.serif];
9907+
options[1] = ['sans-serif',this.tt.sans];
9908+
options[2] = ['cursive',this.tt.cursive];
9909+
options[3] = ['fantasy',this.tt.fantasy];
9910+
options[4] = ['monospace',this.tt.monospace];
99119911
break;
99129912

99139913
case 'prefCaptionsColor':

build/ableplayer.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ableplayer",
3-
"version": "4.2.1",
3+
"version": "4.2.2",
44
"description": "fully accessible HTML5 media player",
55
"homepage": "http://ableplayer.github.io/ableplayer",
66
"bugs": "https://github.com/ableplayer/ableplayer/issues",

scripts/caption.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -252,11 +252,11 @@
252252
switch (pref) {
253253

254254
case 'prefCaptionsFont':
255-
options[0] = this.tt.serif;
256-
options[1] = this.tt.sans;
257-
options[3] = this.tt.cursive;
258-
options[4] = this.tt.fantasy;
259-
options[2] = this.tt.monospace;
255+
options[0] = ['serif',this.tt.serif];
256+
options[1] = ['sans-serif',this.tt.sans];
257+
options[2] = ['cursive',this.tt.cursive];
258+
options[3] = ['fantasy',this.tt.fantasy];
259+
options[4] = ['monospace',this.tt.monospace];
260260
break;
261261

262262
case 'prefCaptionsColor':

scripts/preference.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@
180180
'name': 'prefCaptionsFont',
181181
'label': this.tt.prefCaptionsFont,
182182
'group': 'captions',
183-
'default': this.tt.sans
183+
'default': 'sans'
184184
});
185185
prefs.push({
186186
'name': 'prefCaptionsSize',
@@ -422,7 +422,7 @@
422422
optionText = this.tt.captionsPositionBelow;
423423
}
424424
}
425-
else if (thisPref === 'prefCaptionsColor' || thisPref === 'prefCaptionsBGColor') {
425+
else if (thisPref === 'prefCaptionsFont' || thisPref === 'prefCaptionsColor' || thisPref === 'prefCaptionsBGColor') {
426426
optionValue = options[j][0];
427427
optionText = options[j][1];
428428
}

0 commit comments

Comments
 (0)