My site uses AblePlayer in a Drupal environment. When using AblePlayer for YouTube videos, the library does not always identify an external caption track.
In this situation:
- there is no locally-hosted VTT caption file
- the YouTube video has captions that are hosted on YouTube
- the externally-hosted captions usually appear on the video (about 3 out of 4 times). These can be toggled on/off with the "CC" button
- about 1 out of 4 times, no captions appear. The "CC" caption toggle button does not appear
Adding this code to ableplayer.js has remediated the situation for me:
In AblePlayer.prototype.getYouTubeCaptionTracks (line 6262):
if(!triedAgain) {
console.log('searching again for captions');
var triedAgain = true;
this.getYouTubeCaptionTracks();
}
My site uses AblePlayer in a Drupal environment. When using AblePlayer for YouTube videos, the library does not always identify an external caption track.
In this situation:
Adding this code to ableplayer.js has remediated the situation for me:
In AblePlayer.prototype.getYouTubeCaptionTracks (line 6262):