Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/development' into PRN-147/expose…
Browse files Browse the repository at this point in the history
…-tweaksConfig-forceReuseVideoCodecReasons
  • Loading branch information
strangesource committed Nov 15, 2024
2 parents d4c9099 + 1c20a68 commit c6d09fa
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 12 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Changelog

## [Unreleased]
## [0.32.0] - 2024-11-14

### Added

Expand All @@ -13,6 +13,7 @@
### Fixed

- Error where setting `PlaybackConfig.isAutoplayEnabled = true` causes the player view creation to fail on Android
- Potential infinite stall when using `NetworkConfig.preprocessHttpRequest` and `NetworkConfig.preprocessHttpResponse` on Android

## [0.31.0] - 2024-11-07

Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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"
Expand All @@ -25,8 +27,9 @@ class NetworkModule(context: ReactApplicationContext) : BitmovinBaseModule(conte
* In-memory mapping from `nativeId`s to `NetworkConfig` instances.
*/
private val networkConfigs: Registry<NetworkConfig> = mutableMapOf()
private val preprocessHttpRequestCompleters: MutableMap<String, Completer<HttpRequest>> = mutableMapOf()
private val preprocessHttpResponseCompleters: MutableMap<String, Completer<HttpResponse>> = mutableMapOf()
private val preprocessHttpRequestCompleters = ConcurrentHashMap<String, Completer<HttpRequest>>()
private val preprocessHttpResponseCompleters = ConcurrentHashMap<String, Completer<HttpResponse>>()

override fun getName() = MODULE_NAME

fun getConfig(nativeId: NativeId?): NetworkConfig? = nativeId?.let { networkConfigs[it] }
Expand Down Expand Up @@ -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,
Expand Down
6 changes: 3 additions & 3 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -1301,12 +1301,12 @@ SPEC CHECKSUMS:
React-runtimescheduler: 20b2202e3396589a71069d12ae9f328949c7c7b8
React-utils: 0307d396f233e47a167b5aaf045b0e4e1dc19d74
ReactCommon: 17891ca337bfa5a7263649b09f27a8c664537bf2
RNBitmovinPlayer: a706e0f5a1a595271feda6d1fc9a9a7ff6d94104
RNBitmovinPlayer: b05649d62740361dd1d1030ce5926e49b4a471eb
RNCPicker: b18aaf30df596e9b1738e7c1f9ee55402a229dca
RNScreens: b582cb834dc4133307562e930e8fa914b8c04ef2
SocketRocket: f32cd54efbe0f095c4d7594881e52619cfe80b17
Yoga: ab50eb8f7fcf1b36aad1801b5687b66b2c0aa000

PODFILE CHECKSUM: 11ac6cb62c1978622f6d687b574d9de3441a2680

COCOAPODS: 1.15.2
COCOAPODS: 1.16.2
6 changes: 3 additions & 3 deletions integration_test/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down

0 comments on commit c6d09fa

Please sign in to comment.