I am trying to implement a feature that involves remembering the saved close caption preferences across videos in our app. I have used the setCurrentCaptions function, but it doesn't appear to be doing anything.
At the minute I have it hooked up to the onPlaylistItem event so that I know that the playlist item is ready to play, and that we have fetched the caption tracks. The video I have has a single caption track, and I have called this.playerRef.current.setCurrentCaptions(1) for it to automatically enable them. I am setting it to 1 as per the description in the documentation:
Turns off captions when argument is 0. Setting argument to another integer, sets captions to track at playlistItem.tracks[integer - 1]
Is this an issue, or am I doing something incorrectly?
I am trying to implement a feature that involves remembering the saved close caption preferences across videos in our app. I have used the
setCurrentCaptions
function, but it doesn't appear to be doing anything.At the minute I have it hooked up to the
onPlaylistItem
event so that I know that the playlist item is ready to play, and that we have fetched the caption tracks. The video I have has a single caption track, and I have calledthis.playerRef.current.setCurrentCaptions(1)
for it to automatically enable them. I am setting it to 1 as per the description in the documentation:Is this an issue, or am I doing something incorrectly?