Guard against setting text tracks before player is initialized

This commit is contained in:
Jesse Sessler 2022-11-28 15:15:50 -06:00
parent 95b297df62
commit a39dca28a8

View File

@ -133,6 +133,8 @@ enum RCTPlayerOperations {
let group:AVMediaSelectionGroup! = player?.currentItem?.asset.mediaSelectionGroup(forMediaCharacteristic: characteristic) let group:AVMediaSelectionGroup! = player?.currentItem?.asset.mediaSelectionGroup(forMediaCharacteristic: characteristic)
var mediaOption:AVMediaSelectionOption! var mediaOption:AVMediaSelectionOption!
guard group != nil else { return }
if (type == "disabled") { if (type == "disabled") {
// Do nothing. We want to ensure option is nil // Do nothing. We want to ensure option is nil
} else if (type == "language") || (type == "title") { } else if (type == "language") || (type == "title") {