Skip to content

Commit

Permalink
Merge pull request #573 from bitmovin/release/v0.33.0
Browse files Browse the repository at this point in the history
Release 0.33.0
  • Loading branch information
rolandkakonyi authored Nov 28, 2024
2 parents 56ad28c + e982972 commit 05c8573
Show file tree
Hide file tree
Showing 20 changed files with 223 additions and 29 deletions.
1 change: 1 addition & 0 deletions .github/workflows/create-sdk-update-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ jobs:
if: ${{ inputs.sdk_name == 'android' }}
run: |
sed -i '' "s/com.bitmovin.player:player:.*/com.bitmovin.player:player:${{ inputs.version_number }}'/g" android/build.gradle
sed -i '' "s/com.bitmovin.player:player-media-session:.*/com.bitmovin.player:player-media-session:${{ inputs.version_number }}'/g" android/build.gradle
- name: Commit version bump
run: |
Expand Down
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# Changelog

## [0.33.0]

### Added

- Android: `TweaksConfig.forceReuseVideoCodecReasons` that allows to force the reuse of the video codec despite a configuration change. This flag should be set only, if it is known that the codec can handle the given configuration change.
- `DebugConfig.isDebugLoggingEnabled` and `DebugConfig.setDebugLoggingEnabled(value: boolean)` to check and set whether debug logging is enabled. Debug logging helps diagnose problems and trace the flow of execution within the Player and **should not be enabled in production** as it may log sensitive or confidential information to the console.

### Changed

- Update Bitmovin's native iOS SDK version to `3.78.0`
- Update Bitmovin's native Android SDK version to `3.94.0`

## [0.32.0] - 2024-11-14

### Changed
Expand Down
2 changes: 1 addition & 1 deletion RNBitmovinPlayer.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Pod::Spec.new do |s|

s.swift_version = "5.10"
s.dependency "React-Core"
s.dependency "BitmovinPlayer", "3.77.0"
s.dependency "BitmovinPlayer", "3.78.0"
s.ios.dependency "GoogleAds-IMA-iOS-SDK", "3.23.0"
s.tvos.dependency "GoogleAds-IMA-tvOS-SDK", "4.13.0"
end
4 changes: 2 additions & 2 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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.92.0+jason'
implementation 'com.bitmovin.player:player-media-session:3.92.0+jason'
implementation 'com.bitmovin.player:player:3.94.0+jason'
implementation 'com.bitmovin.player:player-media-session:3.94.0+jason'
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package com.bitmovin.player.reactnative

import com.bitmovin.player.api.DebugConfig
import com.facebook.react.bridge.*
import com.facebook.react.module.annotations.ReactModule

private const val MODULE_NAME = "DebugModule"

@ReactModule(name = MODULE_NAME)
class DebugModule(context: ReactApplicationContext) : BitmovinBaseModule(context) {
override fun getName() = MODULE_NAME

/**
* Enable/disable verbose logging for the console logger.
* @param enabled Whether to set verbose logging as enabled or disabled.
*/
@ReactMethod
fun setDebugLoggingEnabled(enabled: Boolean, promise: Promise) {
promise.unit.resolveOnUiThread {
DebugConfig.isLoggingEnabled = enabled
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ class RNPlayerViewPackage : ReactPackage {
BitmovinCastManagerModule(reactContext),
BufferModule(reactContext),
NetworkModule(reactContext),
DebugModule(reactContext),
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import com.bitmovin.analytics.api.CustomData
import com.bitmovin.analytics.api.DefaultMetadata
import com.bitmovin.analytics.api.SourceMetadata
import com.bitmovin.player.api.DeviceDescription.DeviceName
import com.bitmovin.player.api.ForceReuseVideoCodecReason
import com.bitmovin.player.api.PlaybackConfig
import com.bitmovin.player.api.PlayerConfig
import com.bitmovin.player.api.TweaksConfig
Expand Down Expand Up @@ -167,6 +168,16 @@ fun ReadableMap.toStyleConfig(): StyleConfig = StyleConfig().apply {
withString("scalingMode") { scalingMode = ScalingMode.valueOf(it) }
}

/**
* Converts any JS string into an `ForceReuseVideoCodecReason` enum value.
*/
private fun String.toForceReuseVideoCodecReason(): ForceReuseVideoCodecReason? = when (this) {
"ColorInfoMismatch" -> ForceReuseVideoCodecReason.ColorInfoMismatch
"MaxInputSizeExceeded" -> ForceReuseVideoCodecReason.MaxInputSizeExceeded
"MaxResolutionExceeded" -> ForceReuseVideoCodecReason.MaxResolutionExceeded
else -> null
}

/**
* Converts any JS object into a `TweaksConfig` object.
*/
Expand All @@ -189,6 +200,12 @@ fun ReadableMap.toTweaksConfig(): TweaksConfig = TweaksConfig().apply {
withBoolean("useDrmSessionForClearSources") { useDrmSessionForClearSources = it }
withBoolean("useFiletypeExtractorFallbackForHls") { useFiletypeExtractorFallbackForHls = it }
withBoolean("preferSoftwareDecodingForAds") { preferSoftwareDecodingForAds = it }
withStringArray("forceReuseVideoCodecReasons") {
forceReuseVideoCodecReasons = it
.filterNotNull()
.mapNotNull(String::toForceReuseVideoCodecReason)
.toSet()
}
}

/**
Expand Down
16 changes: 8 additions & 8 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ PODS:
- BitmovinAnalyticsCollector/Core
- BitmovinPlayerCore (~> 3.48)
- BitmovinAnalyticsCollector/Core (3.9.0)
- BitmovinPlayer (3.77.0):
- BitmovinPlayer (3.78.0):
- BitmovinAnalyticsCollector/BitmovinPlayer (~> 3.0)
- BitmovinPlayerCore (= 3.77.0)
- BitmovinPlayerCore (3.77.0)
- BitmovinPlayerCore (= 3.78.0)
- BitmovinPlayerCore (3.78.0)
- boost (1.83.0)
- DoubleConversion (1.1.6)
- FBLazyVector (0.73.4-0)
Expand Down Expand Up @@ -1048,8 +1048,8 @@ PODS:
- React-jsi (= 0.73.4-0)
- React-logger (= 0.73.4-0)
- React-perflogger (= 0.73.4-0)
- RNBitmovinPlayer (0.32.0):
- BitmovinPlayer (= 3.77.0)
- RNBitmovinPlayer (0.33.0):
- BitmovinPlayer (= 3.78.0)
- GoogleAds-IMA-iOS-SDK (= 3.23.0)
- GoogleAds-IMA-tvOS-SDK (= 4.13.0)
- React-Core
Expand Down Expand Up @@ -1245,8 +1245,8 @@ EXTERNAL SOURCES:

SPEC CHECKSUMS:
BitmovinAnalyticsCollector: d08e0b13bcc32973370e0d71f2faa739561bac0a
BitmovinPlayer: 65866e13f7a8246ccbc7378607d6ca789f0f459e
BitmovinPlayerCore: 158b4a5b81b12b819f0f51b7b89711ca47e11583
BitmovinPlayer: 7fc1bf0b32c540537c05664c7b60a559f1e47206
BitmovinPlayerCore: 37cc7a3299af139f19a0e2e88c1f476821242cb0
boost: 88202336c3ba1e7a264a83c0c888784b0f360c28
DoubleConversion: 74cb0ce4de271b23e772567504735c87134edf0a
FBLazyVector: 33a271a7e8de0bd321e47356d8bc3b2d5fb9ddba
Expand Down Expand Up @@ -1301,7 +1301,7 @@ SPEC CHECKSUMS:
React-runtimescheduler: 20b2202e3396589a71069d12ae9f328949c7c7b8
React-utils: 0307d396f233e47a167b5aaf045b0e4e1dc19d74
ReactCommon: 17891ca337bfa5a7263649b09f27a8c664537bf2
RNBitmovinPlayer: b05649d62740361dd1d1030ce5926e49b4a471eb
RNBitmovinPlayer: 2b6f5929e0469976e262679a092077483d4a0c37
RNCPicker: b18aaf30df596e9b1738e7c1f9ee55402a229dca
RNScreens: b582cb834dc4133307562e930e8fa914b8c04ef2
SocketRocket: f32cd54efbe0f095c4d7594881e52619cfe80b17
Expand Down
6 changes: 3 additions & 3 deletions example/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2266,9 +2266,9 @@ cosmiconfig@^5.0.5, cosmiconfig@^5.1.0:
parse-json "^4.0.0"

cross-spawn@^7.0.3:
version "7.0.3"
resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6"
integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==
version "7.0.6"
resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.6.tgz#8a58fe78f00dcd70c370451759dfbfaf03e8ee9f"
integrity sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==
dependencies:
path-key "^3.1.0"
shebang-command "^2.0.0"
Expand Down
16 changes: 8 additions & 8 deletions integration_test/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ PODS:
- BitmovinAnalyticsCollector/Core
- BitmovinPlayerCore (~> 3.48)
- BitmovinAnalyticsCollector/Core (3.9.0)
- BitmovinPlayer (3.77.0):
- BitmovinPlayer (3.78.0):
- BitmovinAnalyticsCollector/BitmovinPlayer (~> 3.0)
- BitmovinPlayerCore (= 3.77.0)
- BitmovinPlayerCore (3.77.0)
- BitmovinPlayerCore (= 3.78.0)
- BitmovinPlayerCore (3.78.0)
- boost (1.83.0)
- DoubleConversion (1.1.6)
- FBLazyVector (0.73.4-0)
Expand Down Expand Up @@ -1040,8 +1040,8 @@ PODS:
- React-jsi (= 0.73.4-0)
- React-logger (= 0.73.4-0)
- React-perflogger (= 0.73.4-0)
- RNBitmovinPlayer (0.32.0):
- BitmovinPlayer (= 3.77.0)
- RNBitmovinPlayer (0.33.0):
- BitmovinPlayer (= 3.78.0)
- GoogleAds-IMA-iOS-SDK (= 3.23.0)
- GoogleAds-IMA-tvOS-SDK (= 4.13.0)
- React-Core
Expand Down Expand Up @@ -1215,8 +1215,8 @@ EXTERNAL SOURCES:

SPEC CHECKSUMS:
BitmovinAnalyticsCollector: d08e0b13bcc32973370e0d71f2faa739561bac0a
BitmovinPlayer: 65866e13f7a8246ccbc7378607d6ca789f0f459e
BitmovinPlayerCore: 158b4a5b81b12b819f0f51b7b89711ca47e11583
BitmovinPlayer: 7fc1bf0b32c540537c05664c7b60a559f1e47206
BitmovinPlayerCore: 37cc7a3299af139f19a0e2e88c1f476821242cb0
boost: 88202336c3ba1e7a264a83c0c888784b0f360c28
DoubleConversion: 74cb0ce4de271b23e772567504735c87134edf0a
FBLazyVector: 33a271a7e8de0bd321e47356d8bc3b2d5fb9ddba
Expand Down Expand Up @@ -1266,7 +1266,7 @@ SPEC CHECKSUMS:
React-runtimescheduler: 20b2202e3396589a71069d12ae9f328949c7c7b8
React-utils: 0307d396f233e47a167b5aaf045b0e4e1dc19d74
ReactCommon: 17891ca337bfa5a7263649b09f27a8c664537bf2
RNBitmovinPlayer: b05649d62740361dd1d1030ce5926e49b4a471eb
RNBitmovinPlayer: 2b6f5929e0469976e262679a092077483d4a0c37
SocketRocket: f32cd54efbe0f095c4d7594881e52619cfe80b17
Yoga: ab50eb8f7fcf1b36aad1801b5687b66b2c0aa000

Expand Down
6 changes: 3 additions & 3 deletions integration_test/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2252,9 +2252,9 @@ cosmiconfig@^5.0.5, cosmiconfig@^5.1.0:
parse-json "^4.0.0"

cross-spawn@^7.0.3:
version "7.0.3"
resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6"
integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==
version "7.0.6"
resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.6.tgz#8a58fe78f00dcd70c370451759dfbfaf03e8ee9f"
integrity sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==
dependencies:
path-key "^3.1.0"
shebang-command "^2.0.0"
Expand Down
7 changes: 7 additions & 0 deletions ios/DebugModule.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#import <React/RCTBridgeModule.h>

@interface RCT_EXTERN_REMAP_MODULE(DebugModule, DebugModule, NSObject)

RCT_EXTERN_METHOD(setDebugLoggingEnabled:(nonnull BOOL)enabled)

@end
33 changes: 33 additions & 0 deletions ios/DebugModule.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import BitmovinPlayer

@objc(DebugModule)
public class DebugModule: NSObject, RCTBridgeModule {
// swiftlint:disable:next implicitly_unwrapped_optional
@objc public var bridge: RCTBridge!

// swiftlint:disable:next implicitly_unwrapped_optional
public static func moduleName() -> String! {
"DebugModule"
}

/// Module requires main thread initialization.
public static func requiresMainQueueSetup() -> Bool {
true
}

// swiftlint:disable:next implicitly_unwrapped_optional
public var methodQueue: DispatchQueue! {
bridge.uiManager.methodQueue
}
}

extension DebugModule {
/// Enable/disable verbose logging for the console logger.
/// - Parameter enabled: Whether to set verbose logging as enabled or disabled.
@objc(setDebugLoggingEnabled:)
func setDebugLoggingEnabled(enabled: Bool) {
bridge.uiManager.addUIBlock { [weak self] _, _ in
DebugConfig.logging.logger?.level = enabled ? .verbose : .warning
}
}
}
3 changes: 3 additions & 0 deletions ios/FullscreenHandlerModule.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,22 @@ public class FullscreenHandlerModule: NSObject, RCTBridgeModule {
fullscreenHandlers.removeValue(forKey: nativeId)
}

@MainActor
@objc(onFullscreenChanged:isFullscreenEnabled:)
func onFullscreenChanged(_ nativeId: NativeId, isFullscreenEnabled: Bool) -> Any? {
fullscreenHandlers[nativeId]?.isFullscreen = isFullscreenEnabled
fullscreenChangeDispatchGroup.leave()
return nil
}

@MainActor
@objc(registerHandler:)
func registerHandler(_ nativeId: NativeId) {
guard fullscreenHandlers[nativeId] == nil else { return }
fullscreenHandlers[nativeId] = FullscreenHandlerBridge(nativeId, bridge: bridge)
}

@MainActor
@objc(setIsFullscreenActive:isFullscreen:)
func setIsFullscreenActive(_ nativeId: NativeId, isFullscreen: Bool) {
fullscreenHandlers[nativeId]?.isFullscreen = isFullscreen
Expand Down
1 change: 1 addition & 0 deletions ios/RNPlayerViewManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ public class RNPlayerViewManager: RCTViewManager {
bridge.module(for: FullscreenHandlerModule.self) as? FullscreenHandlerModule
}

@MainActor
private func maybeEmitPictureInPictureAvailabilityEvent(for view: RNPlayerView, previousState: Bool) {
guard let playerView = view.playerView,
playerView.isPictureInPictureAvailable != previousState else {
Expand Down
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.32.0",
"version": "0.33.0",
"description": "Official React Native bindings for Bitmovin's mobile Player SDKs.",
"main": "lib/index.js",
"module": "lib/index.mjs",
Expand Down
56 changes: 56 additions & 0 deletions src/debug.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import { NativeModules } from 'react-native';

const DebugModule = NativeModules.DebugModule;

/**
* Global debug configuration for all Bitmovin components.
*/
export class DebugConfig {
private static _isDebugEnabled = false;

/**
* Retrieves the current debug logging state.
*
* @returns `true` if debug logging is enabled, otherwise `false`.
*/
static get isDebugLoggingEnabled(): boolean {
return DebugConfig._isDebugEnabled;
}

/**
* Enables or disables global debug logging for all Bitmovin components.
*
* Debug logging provides detailed information primarily for debugging purposes,
* helping to diagnose problems and trace the flow of execution within the Player.
*
* ### Warning:
* This option **should not be enabled in production** as it may log sensitive or confidential
* information to the console.
*
* ## Platform-Specific Logging Behavior
* ---
* - **iOS:** logs are printed using `NSLog` at the verbose log level.
* - **Android:** logs are printed using `android.util.Log` with the following tags:
* - `BitmovinPlayer`
* - `BitmovinPlayerView`
* - `BitmovinOffline`
* - `BitmovinSource`
* - `BitmovinExoPlayer`
*
* ## Limitations
* ---
* **Android**
* - This flag **must** be set **before** creating any Bitmovin component to take effect.
*
* ## Usage Notes
* ---
* - We recommend setting this flag during your app's initialization phase, such as in the
* application's entry point (e.g. `App.tsx`).
*
* @defaultValue `false`
*/
static async setDebugLoggingEnabled(value: boolean): Promise<void> {
DebugConfig._isDebugEnabled = value;
await DebugModule.setDebugLoggingEnabled(value);
}
}
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,4 @@ export * from './liveConfig';
export * from './bufferApi';
export * from './network';
export * from './mediaControlConfig';
export * from './debug';
Loading

0 comments on commit 05c8573

Please sign in to comment.