From 547c85225dbbafffdafd5cd74df6d6594962b5a2 Mon Sep 17 00:00:00 2001 From: Roland Kakonyi Date: Mon, 11 Nov 2024 09:16:56 +0100 Subject: [PATCH 1/7] add macOS check to pod install commands for the integration test application --- integration_test/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/integration_test/package.json b/integration_test/package.json index 5a33d6d9..cf59e111 100644 --- a/integration_test/package.json +++ b/integration_test/package.json @@ -14,8 +14,8 @@ "test:android": "yarn stop-test:android && yarn start-test:android", "test:ios": "yarn stop-test:ios && yarn start-test:ios", "pods": "yarn pods-install || yarn pods-update", - "pods-install": "NO_FLIPPER=1 yarn pod-install", - "pods-update": "cd ios && NO_FLIPPER=1 pod update --silent" + "pods-install": "[ \"$(uname)\" != Darwin ] || NO_FLIPPER=1 yarn pod-install", + "pods-update": "[ \"$(uname)\" != Darwin ] || cd ios && NO_FLIPPER=1 pod update --silent" }, "dependencies": { "@types/react": "^18.0.0", From 582910567297370f20af426a30cb900d9eb19e80 Mon Sep 17 00:00:00 2001 From: Lukas Knoch-Girstmair Date: Wed, 13 Nov 2024 10:43:11 +0100 Subject: [PATCH 2/7] Use concurrent hash map to avoid potential infinite stall --- .../bitmovin/player/reactnative/NetworkModule.kt | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/android/src/main/java/com/bitmovin/player/reactnative/NetworkModule.kt b/android/src/main/java/com/bitmovin/player/reactnative/NetworkModule.kt index 4fdd5a37..4cbc854c 100644 --- a/android/src/main/java/com/bitmovin/player/reactnative/NetworkModule.kt +++ b/android/src/main/java/com/bitmovin/player/reactnative/NetworkModule.kt @@ -1,5 +1,6 @@ package com.bitmovin.player.reactnative +import android.util.Log import androidx.concurrent.futures.CallbackToFutureAdapter import androidx.concurrent.futures.CallbackToFutureAdapter.Completer import com.bitmovin.player.api.network.HttpRequest @@ -14,6 +15,7 @@ import com.bitmovin.player.reactnative.converter.toJson import com.bitmovin.player.reactnative.converter.toNetworkConfig import com.facebook.react.bridge.* import com.facebook.react.module.annotations.ReactModule +import java.util.concurrent.ConcurrentHashMap import java.util.concurrent.Future private const val MODULE_NAME = "NetworkModule" @@ -25,8 +27,9 @@ class NetworkModule(context: ReactApplicationContext) : BitmovinBaseModule(conte * In-memory mapping from `nativeId`s to `NetworkConfig` instances. */ private val networkConfigs: Registry = mutableMapOf() - private val preprocessHttpRequestCompleters: MutableMap> = mutableMapOf() - private val preprocessHttpResponseCompleters: MutableMap> = mutableMapOf() + private val preprocessHttpRequestCompleters = ConcurrentHashMap>() + private val preprocessHttpResponseCompleters = ConcurrentHashMap>() + override fun getName() = MODULE_NAME fun getConfig(nativeId: NativeId?): NetworkConfig? = nativeId?.let { networkConfigs[it] } @@ -94,9 +97,14 @@ class NetworkModule(context: ReactApplicationContext) : BitmovinBaseModule(conte @ReactMethod fun setPreprocessedHttpRequest(requestId: String, request: ReadableMap) { - preprocessHttpRequestCompleters[requestId]?.set(request.toHttpRequest()) - preprocessHttpRequestCompleters.remove(requestId) + val completer = preprocessHttpRequestCompleters.remove(requestId) + if (completer == null) { + Log.e(MODULE_NAME, "Completer is null for requestId: $requestId, this can cause stuck network requests") + return + } + completer.set(request.toHttpRequest()) } + private fun preprocessHttpResponseFromJS( nativeId: NativeId, type: HttpRequestType, From 2cb3b0b0e726141f20e5e1f5a092a037aeab262c Mon Sep 17 00:00:00 2001 From: Lukas Knoch-Girstmair Date: Wed, 13 Nov 2024 11:02:38 +0100 Subject: [PATCH 3/7] Add changelog entry --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d058a09b..8f2918c8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## [Unreleased] + +### Fixed + +- Potential infinite stall when using `NetworkConfig.preprocessHttpRequest` and `NetworkConfig.preprocessHttpResponse` on Android + ## [0.31.0] - 2024-11-07 ### Added From 56bbadbeffa615d5f00df1c489ece949f1cd9bb0 Mon Sep 17 00:00:00 2001 From: Lukas Knoch-Girstmair Date: Wed, 13 Nov 2024 14:43:42 +0100 Subject: [PATCH 4/7] 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 5/7] 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 From f2920015d4983ace17d5bf9d683c8f68d24269cd Mon Sep 17 00:00:00 2001 From: Lukas Knoch-Girstmair Date: Wed, 13 Nov 2024 15:23:07 +0100 Subject: [PATCH 6/7] Upgrade native Android SDK version to `3.92.0` --- CHANGELOG.md | 4 ++++ android/build.gradle | 4 ++-- .../reactnative/services/MediaSessionPlaybackService.kt | 3 ++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4346b632..99d7ea7d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## [Unreleased] +### Changed + +- Update Bitmovin's native Android SDK version to `3.92.0` + ### Fixed - Error where setting `PlaybackConfig.isAutoplayEnabled = true` causes the player view creation to fail on Android diff --git a/android/build.gradle b/android/build.gradle index 37d586f7..d091538a 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -105,6 +105,6 @@ dependencies { // Bitmovin implementation 'com.google.ads.interactivemedia.v3:interactivemedia:3.33.0' implementation 'com.google.android.gms:play-services-ads-identifier:18.0.1' - implementation 'com.bitmovin.player:player:3.91.0+jason' - implementation 'com.bitmovin.player:player-media-session:3.91.0+jason' + implementation 'com.bitmovin.player:player:3.92.0+jason' + implementation 'com.bitmovin.player:player-media-session:3.92.0+jason' } diff --git a/android/src/main/java/com/bitmovin/player/reactnative/services/MediaSessionPlaybackService.kt b/android/src/main/java/com/bitmovin/player/reactnative/services/MediaSessionPlaybackService.kt index ff7afa28..af036da9 100644 --- a/android/src/main/java/com/bitmovin/player/reactnative/services/MediaSessionPlaybackService.kt +++ b/android/src/main/java/com/bitmovin/player/reactnative/services/MediaSessionPlaybackService.kt @@ -4,6 +4,7 @@ import android.content.Intent import android.os.Binder import android.os.IBinder import com.bitmovin.player.api.Player +import com.bitmovin.player.api.media.session.ControllerInfo import com.bitmovin.player.api.media.session.MediaSession import com.bitmovin.player.api.media.session.MediaSessionService @@ -29,7 +30,7 @@ class MediaSessionPlaybackService : MediaSessionService() { private val binder = ServiceBinder() private var mediaSession: MediaSession? = null - override fun onGetSession(): MediaSession? = null + override fun onGetSession(controllerInfo: ControllerInfo) = null override fun onDestroy() { disconnectSession() From 79cb38f3dea7e5946374cf53bf2393b0e94c2237 Mon Sep 17 00:00:00 2001 From: Bitmovin Release Automation Date: Thu, 14 Nov 2024 13:52:35 +0000 Subject: [PATCH 7/7] prepare release 0.32.0 --- CHANGELOG.md | 2 +- example/ios/Podfile.lock | 6 +++--- integration_test/ios/Podfile.lock | 6 +++--- package.json | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 55991a00..cad6dfa1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -## [Unreleased] +## [0.32.0] ### Changed diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index bd10c783..0e6b187f 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -1048,7 +1048,7 @@ PODS: - React-jsi (= 0.73.4-0) - React-logger (= 0.73.4-0) - React-perflogger (= 0.73.4-0) - - RNBitmovinPlayer (0.31.0): + - RNBitmovinPlayer (0.32.0): - BitmovinPlayer (= 3.77.0) - GoogleAds-IMA-iOS-SDK (= 3.23.0) - GoogleAds-IMA-tvOS-SDK (= 4.13.0) @@ -1301,7 +1301,7 @@ SPEC CHECKSUMS: React-runtimescheduler: 20b2202e3396589a71069d12ae9f328949c7c7b8 React-utils: 0307d396f233e47a167b5aaf045b0e4e1dc19d74 ReactCommon: 17891ca337bfa5a7263649b09f27a8c664537bf2 - RNBitmovinPlayer: a706e0f5a1a595271feda6d1fc9a9a7ff6d94104 + RNBitmovinPlayer: b05649d62740361dd1d1030ce5926e49b4a471eb RNCPicker: b18aaf30df596e9b1738e7c1f9ee55402a229dca RNScreens: b582cb834dc4133307562e930e8fa914b8c04ef2 SocketRocket: f32cd54efbe0f095c4d7594881e52619cfe80b17 @@ -1309,4 +1309,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: 11ac6cb62c1978622f6d687b574d9de3441a2680 -COCOAPODS: 1.15.2 +COCOAPODS: 1.16.2 diff --git a/integration_test/ios/Podfile.lock b/integration_test/ios/Podfile.lock index a1de6a4f..c5ee5b6b 100644 --- a/integration_test/ios/Podfile.lock +++ b/integration_test/ios/Podfile.lock @@ -1040,7 +1040,7 @@ PODS: - React-jsi (= 0.73.4-0) - React-logger (= 0.73.4-0) - React-perflogger (= 0.73.4-0) - - RNBitmovinPlayer (0.31.0): + - RNBitmovinPlayer (0.32.0): - BitmovinPlayer (= 3.77.0) - GoogleAds-IMA-iOS-SDK (= 3.23.0) - GoogleAds-IMA-tvOS-SDK (= 4.13.0) @@ -1266,10 +1266,10 @@ SPEC CHECKSUMS: React-runtimescheduler: 20b2202e3396589a71069d12ae9f328949c7c7b8 React-utils: 0307d396f233e47a167b5aaf045b0e4e1dc19d74 ReactCommon: 17891ca337bfa5a7263649b09f27a8c664537bf2 - RNBitmovinPlayer: a706e0f5a1a595271feda6d1fc9a9a7ff6d94104 + RNBitmovinPlayer: b05649d62740361dd1d1030ce5926e49b4a471eb SocketRocket: f32cd54efbe0f095c4d7594881e52619cfe80b17 Yoga: ab50eb8f7fcf1b36aad1801b5687b66b2c0aa000 PODFILE CHECKSUM: d1cd0316ec7219d421f4dfb46ced3af29fd4e932 -COCOAPODS: 1.15.2 +COCOAPODS: 1.16.2 diff --git a/package.json b/package.json index db7727e9..aadaf457 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bitmovin-player-react-native", - "version": "0.31.0", + "version": "0.32.0", "description": "Official React Native bindings for Bitmovin's mobile Player SDKs.", "main": "lib/index.js", "module": "lib/index.mjs",