From 56bbadbeffa615d5f00df1c489ece949f1cd9bb0 Mon Sep 17 00:00:00 2001 From: Lukas Knoch-Girstmair Date: Wed, 13 Nov 2024 14:43:42 +0100 Subject: [PATCH 1/2] Null safe check if `isBackgroundPlaybackEnabled` property is set --- .../java/com/bitmovin/player/reactnative/RNPlayerViewManager.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/src/main/java/com/bitmovin/player/reactnative/RNPlayerViewManager.kt b/android/src/main/java/com/bitmovin/player/reactnative/RNPlayerViewManager.kt index 842c945f..cc6fef11 100644 --- a/android/src/main/java/com/bitmovin/player/reactnative/RNPlayerViewManager.kt +++ b/android/src/main/java/com/bitmovin/player/reactnative/RNPlayerViewManager.kt @@ -248,7 +248,7 @@ class RNPlayerViewManager(private val context: ReactApplicationContext) : Simple val playbackConfig = playerConfig?.getMap("playbackConfig") val isPictureInPictureEnabled = view.config?.pictureInPictureConfig?.isEnabled == true || playbackConfig?.getBooleanOrNull("isPictureInPictureEnabled") == true - view.enableBackgroundPlayback = playbackConfig?.getBoolean("isBackgroundPlaybackEnabled") ?: false + view.enableBackgroundPlayback = playbackConfig?.getBooleanOrNull("isBackgroundPlaybackEnabled") == true val rnStyleConfigWrapper = playerConfig?.toRNStyleConfigWrapperFromPlayerConfig() val configuredPlayerViewConfig = view.config?.playerViewConfig ?: PlayerViewConfig() From 375c00b531cfd2262362eee65ad51c7c082f56ea Mon Sep 17 00:00:00 2001 From: Lukas Knoch-Girstmair Date: Wed, 13 Nov 2024 14:50:56 +0100 Subject: [PATCH 2/2] Add changelog entry --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d058a09b..4346b632 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## [Unreleased] + +### Fixed + +- Error where setting `PlaybackConfig.isAutoplayEnabled = true` causes the player view creation to fail on Android + ## [0.31.0] - 2024-11-07 ### Added