@@ -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 ( ) {
0 commit comments