Skip to content

Commit e79113f

Browse files
committed
Upgrade to fix another bug in Able Player 4.2.1
1 parent 9bd1267 commit e79113f

File tree

3 files changed

+65
-67
lines changed

3 files changed

+65
-67
lines changed

build/ableplayer.dist.js

Lines changed: 32 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1295,41 +1295,40 @@ var AblePlayerInstances = [];
12951295
// sync all other tracks to this same languge
12961296
this.syncTrackLanguages('init',this.captionLang);
12971297
}
1298-
if (this.usingVimeoCaptions) {
1299-
if (this.prefCaptions == 1) {
1300-
// initialize Vimeo captions to the default language
1301-
this.vimeoPlayer.enableTextTrack(this.captionLang).then(function(track) {
1302-
// track.language = the iso code for the language
1303-
// track.kind = 'captions' or 'subtitles'
1304-
// track.label = the human-readable label
1305-
}).catch(function(error) {
1306-
switch (error.name) {
1307-
case 'InvalidTrackLanguageError':
1308-
// no track was available with the specified language
1309-
1310-
break;
1311-
case 'InvalidTrackError':
1312-
// no track was available with the specified language and kind
1313-
1314-
break;
1315-
default:
1316-
// some other error occurred
1317-
1318-
break;
1298+
if (this.player === 'vimeo') {
1299+
if (this.usingVimeoCaptions && this.prefCaptions == 1) {
1300+
// initialize Vimeo captions to the default language
1301+
this.vimeoPlayer.enableTextTrack(this.captionLang).then(function(track) {
1302+
// track.language = the iso code for the language
1303+
// track.kind = 'captions' or 'subtitles'
1304+
// track.label = the human-readable label
1305+
}).catch(function(error) {
1306+
switch (error.name) {
1307+
case 'InvalidTrackLanguageError':
1308+
// no track was available with the specified language
1309+
1310+
break;
1311+
case 'InvalidTrackError':
1312+
// no track was available with the specified language and kind
1313+
1314+
break;
1315+
default:
1316+
// some other error occurred
1317+
1318+
break;
13191319
}
13201320
});
1321-
}
1322-
else {
1323-
// disable Vimeo captions.
1324-
// user has them turned off.
1325-
this.vimeoPlayer.disableTextTrack().then(function() {
1326-
// Vimeo captions disabled
1327-
}).catch(function(error) {
1328-
1329-
});
1330-
}
1331-
}
1332-
}
1321+
}
1322+
else {
1323+
// disable Vimeo captions.
1324+
this.vimeoPlayer.disableTextTrack().then(function() {
1325+
// Vimeo captions disabled
1326+
}).catch(function(error) {
1327+
1328+
});
1329+
}
1330+
}
1331+
}
13331332
};
13341333

13351334
AblePlayer.prototype.initHtml5Player = function () {

build/ableplayer.js

Lines changed: 32 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1295,41 +1295,40 @@ var AblePlayerInstances = [];
12951295
// sync all other tracks to this same languge
12961296
this.syncTrackLanguages('init',this.captionLang);
12971297
}
1298-
if (this.usingVimeoCaptions) {
1299-
if (this.prefCaptions == 1) {
1300-
// initialize Vimeo captions to the default language
1301-
this.vimeoPlayer.enableTextTrack(this.captionLang).then(function(track) {
1302-
// track.language = the iso code for the language
1303-
// track.kind = 'captions' or 'subtitles'
1304-
// track.label = the human-readable label
1305-
}).catch(function(error) {
1306-
switch (error.name) {
1307-
case 'InvalidTrackLanguageError':
1308-
// no track was available with the specified language
1309-
console.log('No ' + track.kind + ' track is available in the specified language (' + track.label + ')');
1310-
break;
1311-
case 'InvalidTrackError':
1312-
// no track was available with the specified language and kind
1313-
console.log('No ' + track.kind + ' track is available in the specified language (' + track.label + ')');
1314-
break;
1315-
default:
1316-
// some other error occurred
1317-
console.log('Error loading ' + track.label + ' ' + track.kind + ' track');
1318-
break;
1298+
if (this.player === 'vimeo') {
1299+
if (this.usingVimeoCaptions && this.prefCaptions == 1) {
1300+
// initialize Vimeo captions to the default language
1301+
this.vimeoPlayer.enableTextTrack(this.captionLang).then(function(track) {
1302+
// track.language = the iso code for the language
1303+
// track.kind = 'captions' or 'subtitles'
1304+
// track.label = the human-readable label
1305+
}).catch(function(error) {
1306+
switch (error.name) {
1307+
case 'InvalidTrackLanguageError':
1308+
// no track was available with the specified language
1309+
console.log('No ' + track.kind + ' track is available in the specified language (' + track.label + ')');
1310+
break;
1311+
case 'InvalidTrackError':
1312+
// no track was available with the specified language and kind
1313+
console.log('No ' + track.kind + ' track is available in the specified language (' + track.label + ')');
1314+
break;
1315+
default:
1316+
// some other error occurred
1317+
console.log('Error loading ' + track.label + ' ' + track.kind + ' track');
1318+
break;
13191319
}
13201320
});
1321-
}
1322-
else {
1323-
// disable Vimeo captions.
1324-
// user has them turned off.
1325-
this.vimeoPlayer.disableTextTrack().then(function() {
1326-
// Vimeo captions disabled
1327-
}).catch(function(error) {
1328-
console.log('Error disabling Vimeo text track: ',error);
1329-
});
1330-
}
1331-
}
1332-
}
1321+
}
1322+
else {
1323+
// disable Vimeo captions.
1324+
this.vimeoPlayer.disableTextTrack().then(function() {
1325+
// Vimeo captions disabled
1326+
}).catch(function(error) {
1327+
console.log('Error disabling Vimeo text track: ',error);
1328+
});
1329+
}
1330+
}
1331+
}
13331332
};
13341333

13351334
AblePlayer.prototype.initHtml5Player = function () {

build/ableplayer.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)