From a39dca28a8d6972abd37c7a64a085d6694a39302 Mon Sep 17 00:00:00 2001 From: Jesse Sessler Date: Mon, 28 Nov 2022 15:15:50 -0600 Subject: [PATCH 1/2] Guard against setting text tracks before player is initialized --- ios/Video/Features/RCTPlayerOperations.swift | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ios/Video/Features/RCTPlayerOperations.swift b/ios/Video/Features/RCTPlayerOperations.swift index cd0ddfec..8b76fafc 100644 --- a/ios/Video/Features/RCTPlayerOperations.swift +++ b/ios/Video/Features/RCTPlayerOperations.swift @@ -132,6 +132,8 @@ enum RCTPlayerOperations { let type = criteria?.type let group:AVMediaSelectionGroup! = player?.currentItem?.asset.mediaSelectionGroup(forMediaCharacteristic: characteristic) var mediaOption:AVMediaSelectionOption! + + guard group != nil else { return } if (type == "disabled") { // Do nothing. We want to ensure option is nil From c9b5b0078f97e119882d230b68d85252fc3bbde1 Mon Sep 17 00:00:00 2001 From: Jesse Sessler Date: Mon, 28 Nov 2022 15:22:38 -0600 Subject: [PATCH 2/2] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 35ce98ec..5b5008a7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ - Added "homepage" to package.json [#2882](https://github.com/react-native-video/react-native-video/pull/2882) - Fix regression when fullscreen prop is used combined with controls [#2911](https://github.com/react-native-video/react-native-video/pull/2911) - Fix: memory leak issue on iOS [#2907](https://github.com/react-native-video/react-native-video/pull/2907) +- Fix setting text tracks before player is initialized on iOS [#2935](https://github.com/react-native-video/react-native-video/pull/2935) ### Version 6.0.0-alpha.3