diff --git a/CHANGELOG.md b/CHANGELOG.md index 9a6e6e63..8d64f1d5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,15 @@ # Changelog +## [0.36.0] + +### Changed + +- Update Bitmovin's native iOS SDK version to `3.80.0` + +### Added + +- Android: `PlayerViewConfig.surfaceType` that allows to render video on a `TextureView` + ## [0.35.0] - 2024-12-10 ### Changed @@ -7,6 +17,10 @@ - Update Bitmovin's native Android SDK version to `3.98.0` - Update Bitmovin's native iOS SDK version to `3.79.0` +### Fixed + +- Android: Controls disappearing post midroll ads on select device by setting background color to `Color.TRANSPARENT` on IMA Ad container + ## [0.34.0] - 2024-12-04 ### Changed diff --git a/RNBitmovinPlayer.podspec b/RNBitmovinPlayer.podspec index 88e94d1c..2ac8df15 100644 --- a/RNBitmovinPlayer.podspec +++ b/RNBitmovinPlayer.podspec @@ -20,7 +20,7 @@ Pod::Spec.new do |s| s.swift_version = "5.10" s.dependency "React-Core" - s.dependency "BitmovinPlayer", "3.79.0" + s.dependency "BitmovinPlayer", "3.81.0" s.ios.dependency "GoogleAds-IMA-iOS-SDK", "3.23.0" s.tvos.dependency "GoogleAds-IMA-tvOS-SDK", "4.13.0" end diff --git a/android/src/main/java/com/bitmovin/player/reactnative/converter/JsonConverter.kt b/android/src/main/java/com/bitmovin/player/reactnative/converter/JsonConverter.kt index 45edf392..15d5c53d 100644 --- a/android/src/main/java/com/bitmovin/player/reactnative/converter/JsonConverter.kt +++ b/android/src/main/java/com/bitmovin/player/reactnative/converter/JsonConverter.kt @@ -51,6 +51,7 @@ import com.bitmovin.player.api.source.TimelineReferencePoint import com.bitmovin.player.api.ui.PlayerViewConfig import com.bitmovin.player.api.ui.ScalingMode import com.bitmovin.player.api.ui.StyleConfig +import com.bitmovin.player.api.ui.SurfaceType import com.bitmovin.player.api.ui.UiConfig import com.bitmovin.player.reactnative.BitmovinCastManagerOptions import com.bitmovin.player.reactnative.PictureInPictureConfig @@ -772,8 +773,15 @@ fun ReadableMap.toPictureInPictureConfig(): PictureInPictureConfig = PictureInPi fun ReadableMap.toPlayerViewConfig(): PlayerViewConfig = PlayerViewConfig( uiConfig = getMap("uiConfig")?.toUiConfig() ?: UiConfig.WebUi(), hideFirstFrame = getBooleanOrNull("hideFirstFrame") ?: false, + surfaceType = getString("surfaceType")?.toSurfaceType() ?: SurfaceType.SurfaceView, ) +private fun String.toSurfaceType(): SurfaceType? = when (this) { + "SurfaceView" -> SurfaceType.SurfaceView + "TextureView" -> SurfaceType.TextureView + else -> null +} + private fun ReadableMap.toUiConfig(): UiConfig { val variant = toVariant() ?: UiConfig.WebUi.Variant.SmallScreenUi val focusUiOnInitialization = getBooleanOrNull("focusUiOnInitialization") diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index eea57646..5c9b475c 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -3,10 +3,10 @@ PODS: - BitmovinAnalyticsCollector/Core - BitmovinPlayerCore (~> 3.48) - BitmovinAnalyticsCollector/Core (3.9.0) - - BitmovinPlayer (3.79.0): + - BitmovinPlayer (3.81.0): - BitmovinAnalyticsCollector/BitmovinPlayer (~> 3.0) - - BitmovinPlayerCore (= 3.79.0) - - BitmovinPlayerCore (3.79.0) + - BitmovinPlayerCore (= 3.81.0) + - BitmovinPlayerCore (3.81.0) - boost (1.83.0) - DoubleConversion (1.1.6) - FBLazyVector (0.73.4-0) @@ -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.35.0): - - BitmovinPlayer (= 3.79.0) + - RNBitmovinPlayer (0.36.0): + - BitmovinPlayer (= 3.81.0) - GoogleAds-IMA-iOS-SDK (= 3.23.0) - GoogleAds-IMA-tvOS-SDK (= 4.13.0) - React-Core @@ -1245,8 +1245,8 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: BitmovinAnalyticsCollector: d08e0b13bcc32973370e0d71f2faa739561bac0a - BitmovinPlayer: 1c19b819952c2c10c875569756593f2e177cf036 - BitmovinPlayerCore: 299f35f2d8882140a80577c14bd3026beb0cae7c + BitmovinPlayer: 4dd87b63c192ceaa4b29db93a7c7430eece618dc + BitmovinPlayerCore: 63641d00a689efbca6fe97bb8f68aea91f303758 boost: 88202336c3ba1e7a264a83c0c888784b0f360c28 DoubleConversion: 74cb0ce4de271b23e772567504735c87134edf0a FBLazyVector: 33a271a7e8de0bd321e47356d8bc3b2d5fb9ddba @@ -1301,7 +1301,7 @@ SPEC CHECKSUMS: React-runtimescheduler: 20b2202e3396589a71069d12ae9f328949c7c7b8 React-utils: 0307d396f233e47a167b5aaf045b0e4e1dc19d74 ReactCommon: 17891ca337bfa5a7263649b09f27a8c664537bf2 - RNBitmovinPlayer: 14ae9eebaf04eb693ce3a713c85b13df52446a00 + RNBitmovinPlayer: de83af231ba2a21f957c88ccdabc3541f73f81b3 RNCPicker: b18aaf30df596e9b1738e7c1f9ee55402a229dca RNScreens: b582cb834dc4133307562e930e8fa914b8c04ef2 SocketRocket: f32cd54efbe0f095c4d7594881e52619cfe80b17 diff --git a/example/yarn.lock b/example/yarn.lock index a5eeb6f9..fd6d9c38 100644 --- a/example/yarn.lock +++ b/example/yarn.lock @@ -3505,9 +3505,9 @@ ms@2.1.3: integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== nanoid@^3.1.23: - version "3.3.7" - resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.7.tgz#d0c301a691bc8d54efa0a2226ccf3fe2fd656bd8" - integrity sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g== + version "3.3.8" + resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.8.tgz#b1be3030bee36aaff18bacb375e5cce521684baf" + integrity sha512-WNLf5Sd8oZxOm+TzppcYk8gVOgP+l58xNy58D0nbUnOxOWRWvlcCV4kUF7ltmI6PsrLl/BgKEyS4mqsGChFN0w== negotiator@0.6.3: version "0.6.3" diff --git a/integration_test/ios/Podfile.lock b/integration_test/ios/Podfile.lock index b83c9e6f..0e57fc33 100644 --- a/integration_test/ios/Podfile.lock +++ b/integration_test/ios/Podfile.lock @@ -3,10 +3,10 @@ PODS: - BitmovinAnalyticsCollector/Core - BitmovinPlayerCore (~> 3.48) - BitmovinAnalyticsCollector/Core (3.9.0) - - BitmovinPlayer (3.79.0): + - BitmovinPlayer (3.81.0): - BitmovinAnalyticsCollector/BitmovinPlayer (~> 3.0) - - BitmovinPlayerCore (= 3.79.0) - - BitmovinPlayerCore (3.79.0) + - BitmovinPlayerCore (= 3.81.0) + - BitmovinPlayerCore (3.81.0) - boost (1.83.0) - DoubleConversion (1.1.6) - FBLazyVector (0.73.4-0) @@ -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.35.0): - - BitmovinPlayer (= 3.79.0) + - RNBitmovinPlayer (0.36.0): + - BitmovinPlayer (= 3.81.0) - GoogleAds-IMA-iOS-SDK (= 3.23.0) - GoogleAds-IMA-tvOS-SDK (= 4.13.0) - React-Core @@ -1215,8 +1215,8 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: BitmovinAnalyticsCollector: d08e0b13bcc32973370e0d71f2faa739561bac0a - BitmovinPlayer: 1c19b819952c2c10c875569756593f2e177cf036 - BitmovinPlayerCore: 299f35f2d8882140a80577c14bd3026beb0cae7c + BitmovinPlayer: 4dd87b63c192ceaa4b29db93a7c7430eece618dc + BitmovinPlayerCore: 63641d00a689efbca6fe97bb8f68aea91f303758 boost: 88202336c3ba1e7a264a83c0c888784b0f360c28 DoubleConversion: 74cb0ce4de271b23e772567504735c87134edf0a FBLazyVector: 33a271a7e8de0bd321e47356d8bc3b2d5fb9ddba @@ -1266,7 +1266,7 @@ SPEC CHECKSUMS: React-runtimescheduler: 20b2202e3396589a71069d12ae9f328949c7c7b8 React-utils: 0307d396f233e47a167b5aaf045b0e4e1dc19d74 ReactCommon: 17891ca337bfa5a7263649b09f27a8c664537bf2 - RNBitmovinPlayer: 14ae9eebaf04eb693ce3a713c85b13df52446a00 + RNBitmovinPlayer: de83af231ba2a21f957c88ccdabc3541f73f81b3 SocketRocket: f32cd54efbe0f095c4d7594881e52619cfe80b17 Yoga: ab50eb8f7fcf1b36aad1801b5687b66b2c0aa000 diff --git a/package.json b/package.json index fbeb4fcd..2995ac76 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bitmovin-player-react-native", - "version": "0.35.0", + "version": "0.36.0", "description": "Official React Native bindings for Bitmovin's mobile Player SDKs.", "main": "lib/index.js", "module": "lib/index.mjs", diff --git a/src/components/PlayerView/playerViewConfig.ts b/src/components/PlayerView/playerViewConfig.ts index 33e474df..990b3ddd 100644 --- a/src/components/PlayerView/playerViewConfig.ts +++ b/src/components/PlayerView/playerViewConfig.ts @@ -27,6 +27,18 @@ export interface PlayerViewConfig { * To reliably hide the first frame before a pre-roll ad, please ensure that you are using the {@link AdvertisingConfig} to schedule ads and not the {@link Player.scheduleAd} API call. */ hideFirstFrame?: boolean; + + /** + * Specify on which surface type the video should be rendered. + * + * See {@link https://developer.android.com/guide/topics/media/ui/playerview#surfacetype|Choosing a surface type} + * for more information. + * + * Default is {@link SurfaceType.SurfaceView}. + * + * @platform Android + */ + surfaceType?: SurfaceType; } /** @@ -97,3 +109,19 @@ export class CustomUi extends Variant { super(uiManagerFactoryFunction); } } + +/** + * The type of surface on which to render video. + * + * See {@link https://developer.android.com/guide/topics/media/ui/playerview#surfacetype|Choosing a surface type} + * for more information. + */ +export enum SurfaceType { + /** + * SurfaceView generally causes lower battery consumption, + * and has better handling for HDR and secure content. + */ + SurfaceView = 'SurfaceView', + /** TextureView is sometime needed for smooth animations. */ + TextureView = 'TextureView', +}