Skip to content

Instantly share code, notes, and snippets.

@umer936
Created January 25, 2017 21:05
Show Gist options
  • Save umer936/22f68a510291cb59ba7342a0bff2397e to your computer and use it in GitHub Desktop.
Save umer936/22f68a510291cb59ba7342a0bff2397e to your computer and use it in GitHub Desktop.
Prints out the captions from a JW video
innerDoc = document.getElementsByClassName("jwplayer");
var getVideo = innerDoc[0].getElementsByTagName('video')[0];
for (index = 0; index < getVideo.textTracks[0].cues.length; ++index) {
document.write(getVideo.textTracks[0].cues[index].text + " ");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment