Skip to content

Commit a1c2110

Browse files
committed
Upgrade to fix bug in Able Player 4.2.1
1 parent 2d4da0a commit a1c2110

File tree

3 files changed

+69
-65
lines changed

3 files changed

+69
-65
lines changed

build/ableplayer.dist.js

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

build/ableplayer.js

Lines changed: 34 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1295,38 +1295,40 @@ var AblePlayerInstances = [];
12951295
// sync all other tracks to this same languge
12961296
this.syncTrackLanguages('init',this.captionLang);
12971297
}
1298-
if (this.usingVimeoCaptions && this.prefCaptions == 1) {
1299-
// initialize Vimeo captions to the default language
1300-
this.vimeoPlayer.enableTextTrack(this.captionLang).then(function(track) {
1301-
// track.language = the iso code for the language
1302-
// track.kind = 'captions' or 'subtitles'
1303-
// track.label = the human-readable label
1304-
}).catch(function(error) {
1305-
switch (error.name) {
1306-
case 'InvalidTrackLanguageError':
1307-
// no track was available with the specified language
1308-
console.log('No ' + track.kind + ' track is available in the specified language (' + track.label + ')');
1309-
break;
1310-
case 'InvalidTrackError':
1311-
// no track was available with the specified language and kind
1312-
console.log('No ' + track.kind + ' track is available in the specified language (' + track.label + ')');
1313-
break;
1314-
default:
1315-
// some other error occurred
1316-
console.log('Error loading ' + track.label + ' ' + track.kind + ' track');
1317-
break;
1318-
}
1319-
});
1320-
}
1321-
else {
1322-
// disable Vimeo captions.
1323-
// captions are either provided locally, or user has them turned off.
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-
}
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;
1319+
}
1320+
});
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+
}
13301332
}
13311333
};
13321334

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)