Skip to content

Commit

Permalink
Merge pull request #559 from bitmovin/untracked/fix-autoplay-causing-…
Browse files Browse the repository at this point in the history
…exception

Null safe check if `isBackgroundPlaybackEnabled` property is set
  • Loading branch information
strangesource authored Nov 13, 2024
2 parents 547c852 + 375c00b commit f8e6a26
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit f8e6a26

Please sign in to comment.