jwplayer / jwplayer-react-native

MIT License
32 stars 9 forks source link

[bug]Updates ios setCurrentCaptions to implement correctly #100

Closed Sccttt closed 1 week ago

Sccttt commented 2 weeks ago

What does this Pull Request do?

Switches setCurrentCaptions to use setCaptionTrack(index:) instead of currentCaptionsTrack = index. This is what JWPlayer’s docs say to use. https://sdk.jwplayer.com/ios/v4/reference/Protocols/JWPlayerProtocol.html#/c:@M@JWPlayerKit@objc(pl)JWPlayerProtocol(im)setCaptionTrackWithIndex:error:

Why is this Pull Request needed?

The old way didn’t match their official docs, so this should be more correct and less likely to break.

Anything to double-check?

Make sure try is used right for the setCaptionTrack method, since it can throw errors.

Any related PRs?

Nope.