chaimPaneth / react-native-jw-media-player

React-Native Android/iOS bridge for JWPlayer SDK (https://www.jwplayer.com/)
MIT License
190 stars 91 forks source link

Enabling captions to show by default is not working #358

Closed mrstebo closed 2 months ago

mrstebo commented 2 months ago

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?