I need to be able to get the Cues array from TextTracks object in VideoJs.
I have the following code:
videojs("example_video_1", {}, function(){
// Player (this) is initialized and ready.
var aTextTrack = this.textTracks()[0];
aTextTrack.show();
var theArray = this.textTracks()[0]['$'];
console.log(theArray);
console.dir(this.textTracks()[0]['$']);
// EXAMPLE: Start playing the video.
this.play();
});
The var theArray prints as empty but console.dir prints the contents of the Array. How can I get these values? I know its related with javascript asyc variables.
Cheers