Skip to content

External YouTube Captions Load Inconsistently #606

Description

@cscottjames

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();
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions