bitmovin-player-react-native 1.13.0 → 1.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/android/build.gradle +2 -2
  3. package/android/src/main/java/com/bitmovin/player/reactnative/converter/JsonConverter.kt +2 -0
  4. package/build/cmcdConfig.d.ts +23 -0
  5. package/build/cmcdConfig.d.ts.map +1 -0
  6. package/build/cmcdConfig.js +2 -0
  7. package/build/cmcdConfig.js.map +1 -0
  8. package/build/components/PlayerView/index.d.ts +1 -1
  9. package/build/components/PlayerView/index.d.ts.map +1 -1
  10. package/build/components/PlayerView/index.js +9 -2
  11. package/build/components/PlayerView/index.js.map +1 -1
  12. package/build/components/PlayerView/properties.d.ts +9 -0
  13. package/build/components/PlayerView/properties.d.ts.map +1 -1
  14. package/build/components/PlayerView/properties.js.map +1 -1
  15. package/build/index.d.ts +1 -0
  16. package/build/index.d.ts.map +1 -1
  17. package/build/index.js +1 -0
  18. package/build/index.js.map +1 -1
  19. package/build/playbackConfig.d.ts +7 -0
  20. package/build/playbackConfig.d.ts.map +1 -1
  21. package/build/playbackConfig.js.map +1 -1
  22. package/build/source.d.ts +7 -0
  23. package/build/source.d.ts.map +1 -1
  24. package/build/source.js.map +1 -1
  25. package/ios/Event+JSON.swift +2 -2
  26. package/ios/RCTConvert+BitmovinPlayer.swift +6 -0
  27. package/ios/RNBitmovinPlayer.podspec +1 -1
  28. package/ios/RNPlayerView.swift +9 -0
  29. package/ios/RNPlayerViewManager.swift +3 -0
  30. package/package.json +1 -1
  31. package/src/cmcdConfig.ts +22 -0
  32. package/src/components/PlayerView/index.tsx +19 -1
  33. package/src/components/PlayerView/properties.ts +10 -0
  34. package/src/index.ts +1 -0
  35. package/src/playbackConfig.ts +7 -0
  36. package/src/source.ts +7 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,31 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.15.0] - 2026-03-27
4
+
5
+ ### Added
6
+
7
+ - Android: `PlaybackConfig.handleAudioFocus` to control whether the player pauses playback when audio focus is lost
8
+ - iOS: `PlayerView.isPictureInPictureEnabled` to enable or disable Picture in Picture availability dynamically after player initialization
9
+
10
+ ### Changed
11
+
12
+ - Update Bitmovin's native iOS SDK version to `3.110.0`
13
+
14
+ ### Fixed
15
+
16
+ - iOS, tvOS: Error/Warning code not forwarded to the React Native bridge on error and warning events
17
+
18
+ ## [1.14.0] - 2026-03-20
19
+
20
+ ### Added
21
+
22
+ - `SourceConfig.cmcdConfig.isEnabled` to enable support for Common Media Client Data (CMCD) on iOS/tvOS 18+ (Android currently ignores `cmcdConfig`)
23
+
24
+ ### Changed
25
+
26
+ - Update Bitmovin's native iOS SDK version to `3.109.0`
27
+ - Update Bitmovin's native Android SDK version to `3.146.0+jason`
28
+
3
29
  ## [1.13.0] - 2026-03-13
4
30
 
5
31
  ### Changed
@@ -9,7 +35,9 @@
9
35
  ## [1.12.0] - 2026-03-13
10
36
 
11
37
  ## [1.11.0] - 2026-03-05
38
+
12
39
  ### Added
40
+
13
41
  - Support for streaming ads with the Bitmovin Advertising Module (BAM) via `AdSourceType.BITMOVIN` in `AdvertisingConfig` ad schedules. Note: on iOS, VMAP is currently not supported with BAM.
14
42
 
15
43
  ### Changed
@@ -108,6 +108,6 @@ dependencies {
108
108
 
109
109
  // Bitmovin
110
110
  implementation 'com.google.android.gms:play-services-ads-identifier:18.0.1'
111
- implementation 'com.bitmovin.player:player:3.145.0+jason'
112
- implementation 'com.bitmovin.player:player-media-session:3.145.0+jason'
111
+ implementation 'com.bitmovin.player:player:3.146.0+jason'
112
+ implementation 'com.bitmovin.player:player-media-session:3.146.0+jason'
113
113
  }
@@ -165,6 +165,7 @@ fun Map<String, Any?>.toPlaybackConfig(): PlaybackConfig = PlaybackConfig().appl
165
165
  withBoolean("isAutoplayEnabled") { isAutoplayEnabled = it }
166
166
  withBoolean("isMuted") { isMuted = it }
167
167
  withBoolean("isTimeShiftEnabled") { isTimeShiftEnabled = it }
168
+ withBoolean("handleAudioFocus") { handleAudioFocus = it }
168
169
  }
169
170
 
170
171
  fun Map<String, Any?>.toStyleConfig(): StyleConfig = StyleConfig().apply {
@@ -280,6 +281,7 @@ fun Map<String, Any?>.toSourceConfig(): SourceConfig? {
280
281
  withString("thumbnailTrack") { thumbnailTrack = it.toThumbnailTrack() }
281
282
  withMap("metadata") { metadata = it.toMap() }
282
283
  withMap("options") { options = it.toSourceOptions() }
284
+ // Note: cmcdConfig is not yet supported on Android.
283
285
  }
284
286
  }
285
287
 
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Contains config values regarding Common Media Client Data (CMCD).
3
+ * More information about the Consumer Technology Association (CTA) Specification is available at https://cdn.cta.tech/cta/media/media/resources/standards/pdfs/cta-5004-final.pdf
4
+ *
5
+ * @platform iOS 18+, tvOS 18+
6
+ */
7
+ export interface CmcdConfig {
8
+ /**
9
+ * Enables sending Common Media Client Data (CMCD) on requests as HTTP headers.
10
+ *
11
+ * Note:
12
+ * - Common Media Client Data (CMCD) is only supported through HTTP headers.
13
+ * - By default, CMCD data is only sent on media (video and audio) requests.
14
+ * To enable them also for manifest requests, {@link TweaksConfig.isCustomHlsLoadingEnabled} needs to be disabled.
15
+ * - Only CMCD v1 is supported for now.
16
+ *
17
+ * Default is `false`.
18
+ *
19
+ * @platform iOS 18+, tvOS 18+
20
+ */
21
+ isEnabled?: boolean;
22
+ }
23
+ //# sourceMappingURL=cmcdConfig.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cmcdConfig.d.ts","sourceRoot":"","sources":["../src/cmcdConfig.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,WAAW,UAAU;IACzB;;;;;;;;;;;;OAYG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=cmcdConfig.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cmcdConfig.js","sourceRoot":"","sources":["../src/cmcdConfig.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Contains config values regarding Common Media Client Data (CMCD).\n * More information about the Consumer Technology Association (CTA) Specification is available at https://cdn.cta.tech/cta/media/media/resources/standards/pdfs/cta-5004-final.pdf\n *\n * @platform iOS 18+, tvOS 18+\n */\nexport interface CmcdConfig {\n /**\n * Enables sending Common Media Client Data (CMCD) on requests as HTTP headers.\n *\n * Note:\n * - Common Media Client Data (CMCD) is only supported through HTTP headers.\n * - By default, CMCD data is only sent on media (video and audio) requests.\n * To enable them also for manifest requests, {@link TweaksConfig.isCustomHlsLoadingEnabled} needs to be disabled.\n * - Only CMCD v1 is supported for now.\n *\n * Default is `false`.\n *\n * @platform iOS 18+, tvOS 18+\n */\n isEnabled?: boolean;\n}\n"]}
@@ -6,5 +6,5 @@ import { PlayerViewProps } from './properties';
6
6
  *
7
7
  * @param options configuration options
8
8
  */
9
- export declare function PlayerView({ viewRef, style, player, config, fullscreenHandler, customMessageHandler, isFullscreenRequested, scalingMode, isPictureInPictureRequested, pictureInPictureActions, ...props }: PlayerViewProps): React.JSX.Element | null;
9
+ export declare function PlayerView({ viewRef, style, player, config, fullscreenHandler, customMessageHandler, isFullscreenRequested, scalingMode, isPictureInPictureRequested, pictureInPictureActions, isPictureInPictureEnabled, ...props }: PlayerViewProps): React.JSX.Element | null;
10
10
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/PlayerView/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiD,MAAM,OAAO,CAAC;AAOtE,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAa/C;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,EACzB,OAAO,EACP,KAAK,EACL,MAAM,EACN,MAAM,EACN,iBAAiB,EACjB,oBAAoB,EACpB,qBAA6B,EAC7B,WAAW,EACX,2BAAmC,EACnC,uBAAuB,EACvB,GAAG,KAAK,EACT,EAAE,eAAe,4BA6KjB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/PlayerView/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiD,MAAM,OAAO,CAAC;AAOtE,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAa/C;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,EACzB,OAAO,EACP,KAAK,EACL,MAAM,EACN,MAAM,EACN,iBAAiB,EACjB,oBAAoB,EACpB,qBAA6B,EAC7B,WAAW,EACX,2BAAmC,EACnC,uBAAuB,EACvB,yBAAyB,EACzB,GAAG,KAAK,EACT,EAAE,eAAe,4BAyLjB"}
@@ -1,5 +1,5 @@
1
1
  import React, { useEffect, useRef, useState } from 'react';
2
- import { StyleSheet } from 'react-native';
2
+ import { Platform, StyleSheet } from 'react-native';
3
3
  import { useKeepAwake } from 'expo-keep-awake';
4
4
  import { NativePlayerView } from './native';
5
5
  import { useProxy } from '../../hooks/useProxy';
@@ -20,7 +20,7 @@ const styles = StyleSheet.create({
20
20
  *
21
21
  * @param options configuration options
22
22
  */
23
- export function PlayerView({ viewRef, style, player, config, fullscreenHandler, customMessageHandler, isFullscreenRequested = false, scalingMode, isPictureInPictureRequested = false, pictureInPictureActions, ...props }) {
23
+ export function PlayerView({ viewRef, style, player, config, fullscreenHandler, customMessageHandler, isFullscreenRequested = false, scalingMode, isPictureInPictureRequested = false, pictureInPictureActions, isPictureInPictureEnabled, ...props }) {
24
24
  // Keep the device awake while the PlayerView is mounted
25
25
  useKeepAwake();
26
26
  const nativeView = useRef(viewRef?.current || null);
@@ -73,6 +73,13 @@ export function PlayerView({ viewRef, style, player, config, fullscreenHandler,
73
73
  void nativeView.current?.updatePictureInPictureActions(pictureInPictureActions);
74
74
  }
75
75
  }, [isPlayerInitialized, pictureInPictureActions]);
76
+ useEffect(() => {
77
+ if (isPlayerInitialized &&
78
+ isPictureInPictureEnabled != null &&
79
+ Platform.OS === 'ios') {
80
+ void nativeView.current?.setIsPictureInPictureEnabled(isPictureInPictureEnabled);
81
+ }
82
+ }, [isPlayerInitialized, isPictureInPictureEnabled]);
76
83
  if (!isPlayerInitialized) {
77
84
  return null;
78
85
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/PlayerView/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAa,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACtE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAA0B,MAAM,UAAU,CAAC;AACpE,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAC3E,OAAO,EAAE,0BAA0B,EAAE,MAAM,qCAAqC,CAAC;AAGjF,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAE1E;;GAEG;AACH,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,SAAS,EAAE;QACT,SAAS,EAAE,SAAS;KACrB;CACF,CAAC,CAAC;AAEH;;;;;GAKG;AACH,MAAM,UAAU,UAAU,CAAC,EACzB,OAAO,EACP,KAAK,EACL,MAAM,EACN,MAAM,EACN,iBAAiB,EACjB,oBAAoB,EACpB,qBAAqB,GAAG,KAAK,EAC7B,WAAW,EACX,2BAA2B,GAAG,KAAK,EACnC,uBAAuB,EACvB,GAAG,KAAK,EACQ;IAChB,wDAAwD;IACxD,YAAY,EAAE,CAAC;IAEf,MAAM,UAAU,GAAG,MAAM,CAAwB,OAAO,EAAE,OAAO,IAAI,IAAI,CAAC,CAAC;IAE3E,8BAA8B;IAC9B,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAC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C,KAAK,CAAC,kBAAkB,CAAC,CAAC,CACvD,4BAA4B,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,yBAAyB,CAAC,CAAC,EACrE,CACH,CAAC;AACJ,CAAC","sourcesContent":["import React, { RefObject, useEffect, useRef, useState } from 'react';\nimport { StyleSheet } from 'react-native';\nimport { useKeepAwake } from 'expo-keep-awake';\nimport { NativePlayerView, NativePlayerViewConfig } from './native';\nimport { useProxy } from '../../hooks/useProxy';\nimport { FullscreenHandlerBridge } from '../../ui/fullscreenhandlerbridge';\nimport { CustomMessageHandlerBridge } from '../../ui/custommessagehandlerbridge';\nimport { PlayerViewProps } from './properties';\nimport { PictureInPictureAction } from './pictureInPictureAction';\nimport { addPlatformToMetadataEvent } from '../../utils/metadataPlatform';\n\n/**\n * Base style that initializes the native view frame when no width/height prop has been set.\n */\nconst styles = StyleSheet.create({\n baseStyle: {\n alignSelf: 'stretch',\n },\n});\n\n/**\n * Component that provides the Bitmovin Player UI and default UI handling to an attached `Player` instance.\n * This component needs a `Player` instance to work properly so make sure one is passed to it as a prop.\n *\n * @param options configuration options\n */\nexport function PlayerView({\n viewRef,\n style,\n player,\n config,\n fullscreenHandler,\n customMessageHandler,\n isFullscreenRequested = false,\n scalingMode,\n isPictureInPictureRequested = false,\n pictureInPictureActions,\n ...props\n}: PlayerViewProps) {\n // Keep the device awake while the PlayerView is mounted\n useKeepAwake();\n\n const nativeView = useRef<InternalPlayerViewRef>(viewRef?.current || null);\n\n // Native events proxy helper.\n const proxy = useProxy();\n // Style resulting from merging `baseStyle` and `props.style`.\n const nativeViewStyle = StyleSheet.flatten([styles.baseStyle, style]);\n\n const fullscreenBridge: React.RefObject<FullscreenHandlerBridge | undefined> =\n useRef(undefined);\n if (fullscreenHandler && !fullscreenBridge.current) {\n fullscreenBridge.current = new FullscreenHandlerBridge();\n }\n if (fullscreenBridge.current) {\n fullscreenBridge.current.setFullscreenHandler(fullscreenHandler);\n }\n\n const customMessageHandlerBridge: React.RefObject<\n CustomMessageHandlerBridge | undefined\n > = useRef(undefined);\n if (customMessageHandler && !customMessageHandlerBridge.current) {\n customMessageHandlerBridge.current = new CustomMessageHandlerBridge();\n }\n if (customMessageHandlerBridge.current && customMessageHandler) {\n customMessageHandlerBridge.current.setCustomMessageHandler(\n customMessageHandler\n );\n }\n\n const nativePlayerViewConfig: NativePlayerViewConfig = {\n playerId: player.nativeId,\n customMessageHandlerBridgeId: customMessageHandlerBridge.current?.nativeId,\n enableBackgroundPlayback:\n player.config?.playbackConfig?.isBackgroundPlaybackEnabled,\n isPictureInPictureEnabledOnPlayer:\n player.config?.playbackConfig?.isPictureInPictureEnabled,\n userInterfaceTypeName: player.config?.styleConfig?.userInterfaceType,\n playerViewConfig: config,\n };\n\n const [isPlayerInitialized, setIsPlayerInitialized] = useState(false);\n\n useEffect(() => {\n void player.initialize().then(() => {\n setIsPlayerInitialized(true);\n // call attach player on native view if switched to AsyncFunction for RNPlayerViewExpo\n });\n\n return () => {\n fullscreenBridge.current?.destroy();\n fullscreenBridge.current = undefined;\n customMessageHandlerBridge.current?.destroy();\n customMessageHandlerBridge.current = undefined;\n };\n }, [player, fullscreenBridge, customMessageHandlerBridge]);\n\n useEffect(() => {\n if (isPlayerInitialized && viewRef) {\n viewRef.current = nativeView.current;\n }\n }, [isPlayerInitialized, viewRef, nativeView]);\n\n useEffect(() => {\n if (isPlayerInitialized && pictureInPictureActions != null) {\n void nativeView.current?.updatePictureInPictureActions(\n pictureInPictureActions\n );\n }\n }, [isPlayerInitialized, pictureInPictureActions]);\n\n if (!isPlayerInitialized) {\n return null;\n }\n\n return (\n <NativePlayerView\n ref={nativeView}\n style={nativeViewStyle}\n config={nativePlayerViewConfig}\n isFullscreenRequested={isFullscreenRequested}\n isPictureInPictureRequested={isPictureInPictureRequested}\n scalingMode={scalingMode}\n fullscreenBridgeId={fullscreenBridge.current?.nativeId}\n onBmpAdBreakFinished={proxy(props.onAdBreakFinished)}\n onBmpAdBreakStarted={proxy(props.onAdBreakStarted)}\n onBmpAdClicked={proxy(props.onAdClicked)}\n onBmpAdError={proxy(props.onAdError)}\n onBmpAdFinished={proxy(props.onAdFinished)}\n onBmpAdManifestLoad={proxy(props.onAdManifestLoad)}\n onBmpAdManifestLoaded={proxy(props.onAdManifestLoaded)}\n onBmpAdQuartile={proxy(props.onAdQuartile)}\n onBmpAdScheduled={proxy(props.onAdScheduled)}\n onBmpAdSkipped={proxy(props.onAdSkipped)}\n onBmpAdStarted={proxy(props.onAdStarted)}\n onBmpCastAvailable={proxy(props.onCastAvailable)}\n onBmpCastPaused={proxy(props.onCastPaused)}\n onBmpCastPlaybackFinished={proxy(props.onCastPlaybackFinished)}\n onBmpCastPlaying={proxy(props.onCastPlaying)}\n onBmpCastStarted={proxy(props.onCastStarted)}\n onBmpCastStart={proxy(props.onCastStart)}\n onBmpCastStopped={proxy(props.onCastStopped)}\n onBmpCastTimeUpdated={proxy(props.onCastTimeUpdated)}\n onBmpCastWaitingForDevice={proxy(props.onCastWaitingForDevice)}\n onBmpCueEnter={proxy(props.onCueEnter)}\n onBmpCueExit={proxy(props.onCueExit)}\n onBmpMetadata={\n props.onMetadata\n ? (e) => props.onMetadata?.(addPlatformToMetadataEvent(e.nativeEvent))\n : undefined\n }\n onBmpMetadataParsed={\n props.onMetadataParsed\n ? (e) =>\n props.onMetadataParsed?.(\n addPlatformToMetadataEvent(e.nativeEvent)\n )\n : undefined\n }\n onBmpDestroy={proxy(props.onDestroy)}\n onBmpEvent={proxy(props.onEvent)}\n onBmpFullscreenEnabled={proxy(props.onFullscreenEnabled)}\n onBmpFullscreenDisabled={proxy(props.onFullscreenDisabled)}\n onBmpFullscreenEnter={proxy(props.onFullscreenEnter)}\n onBmpFullscreenExit={proxy(props.onFullscreenExit)}\n onBmpMuted={proxy(props.onMuted)}\n onBmpPaused={proxy(props.onPaused)}\n onBmpPictureInPictureAvailabilityChanged={proxy(\n props.onPictureInPictureAvailabilityChanged\n )}\n onBmpPictureInPictureEnter={proxy(props.onPictureInPictureEnter)}\n onBmpPictureInPictureEntered={proxy(props.onPictureInPictureEntered)}\n onBmpPictureInPictureExit={proxy(props.onPictureInPictureExit)}\n onBmpPictureInPictureExited={proxy(props.onPictureInPictureExited)}\n onBmpPlay={proxy(props.onPlay)}\n onBmpPlaybackFinished={proxy(props.onPlaybackFinished)}\n onBmpPlaybackSpeedChanged={proxy(props.onPlaybackSpeedChanged)}\n onBmpPlayerActive={proxy(props.onPlayerActive)}\n onBmpPlayerError={proxy(props.onPlayerError)}\n onBmpPlayerWarning={proxy(props.onPlayerWarning)}\n onBmpPlaying={proxy(props.onPlaying)}\n onBmpReady={proxy(props.onReady)}\n onBmpSeek={proxy(props.onSeek)}\n onBmpSeeked={proxy(props.onSeeked)}\n onBmpTimeShift={proxy(props.onTimeShift)}\n onBmpTimeShifted={proxy(props.onTimeShifted)}\n onBmpStallStarted={proxy(props.onStallStarted)}\n onBmpStallEnded={proxy(props.onStallEnded)}\n onBmpSourceError={proxy(props.onSourceError)}\n onBmpSourceLoad={proxy(props.onSourceLoad)}\n onBmpSourceLoaded={proxy(props.onSourceLoaded)}\n onBmpSourceUnloaded={proxy(props.onSourceUnloaded)}\n onBmpSourceWarning={proxy(props.onSourceWarning)}\n onBmpAudioAdded={proxy(props.onAudioAdded)}\n onBmpAudioChanged={proxy(props.onAudioChanged)}\n onBmpAudioRemoved={proxy(props.onAudioRemoved)}\n onBmpSubtitleAdded={proxy(props.onSubtitleAdded)}\n onBmpSubtitleChanged={proxy(props.onSubtitleChanged)}\n onBmpSubtitleRemoved={proxy(props.onSubtitleRemoved)}\n onBmpTimeChanged={proxy(props.onTimeChanged)}\n onBmpUnmuted={proxy(props.onUnmuted)}\n onBmpVideoDownloadQualityChanged={proxy(\n props.onVideoDownloadQualityChanged\n )}\n onBmpVideoPlaybackQualityChanged={proxy(\n props.onVideoPlaybackQualityChanged\n )}\n onBmpDownloadFinished={proxy(props.onDownloadFinished)}\n onBmpFairplayLicenseAcquired={proxy(props.onFairplayLicenseAcquired)}\n />\n );\n}\n\ninterface InternalPlayerViewRef extends RefObject<any> {\n /**\n * Update Picture in Picture actions that should be displayed on the Picture in Picture window.\n * Ideally we would just pass the props to the `NativePlayerView`, but due to a React Native limitation,\n * the props aren't passed to the native module when PiP is active on Android.\n */\n updatePictureInPictureActions: (\n actions: PictureInPictureAction[]\n ) => Promise<void>;\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/PlayerView/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAa,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACtE,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAA0B,MAAM,UAAU,CAAC;AACpE,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAC3E,OAAO,EAAE,0BAA0B,EAAE,MAAM,qCAAqC,CAAC;AAGjF,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAE1E;;GAEG;AACH,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,SAAS,EAAE;QACT,SAAS,EAAE,SAAS;KACrB;CACF,CAAC,CAAC;AAEH;;;;;GAKG;AACH,MAAM,UAAU,UAAU,CAAC,EACzB,OAAO,EACP,KAAK,EACL,MAAM,EACN,MAAM,EACN,iBAAiB,EACjB,oBAAoB,EACpB,qBAAqB,GAAG,KAAK,EAC7B,WAAW,EACX,2BAA2B,GAAG,KAAK,EACnC,uBAAuB,EACvB,yBAAyB,EACzB,GAAG,KAAK,EACQ;IAChB,wDAAwD;IACxD,YAAY,EAAE,CAAC;IAEf,MAAM,UAAU,GAAG,MAAM,CAAwB,OAAO,EAAE,OAAO,IA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,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC,CACrD,gBAAgB,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAC7C,YAAY,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CACrC,gCAAgC,CAAC,CAAC,KAAK,CACrC,KAAK,CAAC,6BAA6B,CACpC,CAAC,CACF,gCAAgC,CAAC,CAAC,KAAK,CACrC,KAAK,CAAC,6BAA6B,CACpC,CAAC,CACF,qBAAqB,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC,CACvD,4BAA4B,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,yBAAyB,CAAC,CAAC,EACrE,CACH,CAAC;AACJ,CAAC","sourcesContent":["import React, { RefObject, useEffect, useRef, useState } from 'react';\nimport { Platform, StyleSheet } from 'react-native';\nimport { useKeepAwake } from 'expo-keep-awake';\nimport { NativePlayerView, NativePlayerViewConfig } from './native';\nimport { useProxy } from '../../hooks/useProxy';\nimport { FullscreenHandlerBridge } from '../../ui/fullscreenhandlerbridge';\nimport { CustomMessageHandlerBridge } from '../../ui/custommessagehandlerbridge';\nimport { PlayerViewProps } from './properties';\nimport { PictureInPictureAction } from './pictureInPictureAction';\nimport { addPlatformToMetadataEvent } from '../../utils/metadataPlatform';\n\n/**\n * Base style that initializes the native view frame when no width/height prop has been set.\n */\nconst styles = StyleSheet.create({\n baseStyle: {\n alignSelf: 'stretch',\n },\n});\n\n/**\n * Component that provides the Bitmovin Player UI and default UI handling to an attached `Player` instance.\n * This component needs a `Player` instance to work properly so make sure one is passed to it as a prop.\n *\n * @param options configuration options\n */\nexport function PlayerView({\n viewRef,\n style,\n player,\n config,\n fullscreenHandler,\n customMessageHandler,\n isFullscreenRequested = false,\n scalingMode,\n isPictureInPictureRequested = false,\n pictureInPictureActions,\n isPictureInPictureEnabled,\n ...props\n}: PlayerViewProps) {\n // Keep the device awake while the PlayerView is mounted\n useKeepAwake();\n\n const nativeView = useRef<InternalPlayerViewRef>(viewRef?.current || null);\n\n // Native events proxy helper.\n const proxy = useProxy();\n // Style resulting from merging `baseStyle` and `props.style`.\n const nativeViewStyle = StyleSheet.flatten([styles.baseStyle, style]);\n\n const fullscreenBridge: React.RefObject<FullscreenHandlerBridge | undefined> =\n useRef(undefined);\n if (fullscreenHandler && !fullscreenBridge.current) {\n fullscreenBridge.current = new FullscreenHandlerBridge();\n }\n if (fullscreenBridge.current) {\n fullscreenBridge.current.setFullscreenHandler(fullscreenHandler);\n }\n\n const customMessageHandlerBridge: React.RefObject<\n CustomMessageHandlerBridge | undefined\n > = useRef(undefined);\n if (customMessageHandler && !customMessageHandlerBridge.current) {\n customMessageHandlerBridge.current = new CustomMessageHandlerBridge();\n }\n if (customMessageHandlerBridge.current && customMessageHandler) {\n customMessageHandlerBridge.current.setCustomMessageHandler(\n customMessageHandler\n );\n }\n\n const nativePlayerViewConfig: NativePlayerViewConfig = {\n playerId: player.nativeId,\n customMessageHandlerBridgeId: customMessageHandlerBridge.current?.nativeId,\n enableBackgroundPlayback:\n player.config?.playbackConfig?.isBackgroundPlaybackEnabled,\n isPictureInPictureEnabledOnPlayer:\n player.config?.playbackConfig?.isPictureInPictureEnabled,\n userInterfaceTypeName: player.config?.styleConfig?.userInterfaceType,\n playerViewConfig: config,\n };\n\n const [isPlayerInitialized, setIsPlayerInitialized] = useState(false);\n\n useEffect(() => {\n void player.initialize().then(() => {\n setIsPlayerInitialized(true);\n // call attach player on native view if switched to AsyncFunction for RNPlayerViewExpo\n });\n\n return () => {\n fullscreenBridge.current?.destroy();\n fullscreenBridge.current = undefined;\n customMessageHandlerBridge.current?.destroy();\n customMessageHandlerBridge.current = undefined;\n };\n }, [player, fullscreenBridge, customMessageHandlerBridge]);\n\n useEffect(() => {\n if (isPlayerInitialized && viewRef) {\n viewRef.current = nativeView.current;\n }\n }, [isPlayerInitialized, viewRef, nativeView]);\n\n useEffect(() => {\n if (isPlayerInitialized && pictureInPictureActions != null) {\n void nativeView.current?.updatePictureInPictureActions(\n pictureInPictureActions\n );\n }\n }, [isPlayerInitialized, pictureInPictureActions]);\n\n useEffect(() => {\n if (\n isPlayerInitialized &&\n isPictureInPictureEnabled != null &&\n Platform.OS === 'ios'\n ) {\n void nativeView.current?.setIsPictureInPictureEnabled(\n isPictureInPictureEnabled\n );\n }\n }, [isPlayerInitialized, isPictureInPictureEnabled]);\n\n if (!isPlayerInitialized) {\n return null;\n }\n\n return (\n <NativePlayerView\n ref={nativeView}\n style={nativeViewStyle}\n config={nativePlayerViewConfig}\n isFullscreenRequested={isFullscreenRequested}\n isPictureInPictureRequested={isPictureInPictureRequested}\n scalingMode={scalingMode}\n fullscreenBridgeId={fullscreenBridge.current?.nativeId}\n onBmpAdBreakFinished={proxy(props.onAdBreakFinished)}\n onBmpAdBreakStarted={proxy(props.onAdBreakStarted)}\n onBmpAdClicked={proxy(props.onAdClicked)}\n onBmpAdError={proxy(props.onAdError)}\n onBmpAdFinished={proxy(props.onAdFinished)}\n onBmpAdManifestLoad={proxy(props.onAdManifestLoad)}\n onBmpAdManifestLoaded={proxy(props.onAdManifestLoaded)}\n onBmpAdQuartile={proxy(props.onAdQuartile)}\n onBmpAdScheduled={proxy(props.onAdScheduled)}\n onBmpAdSkipped={proxy(props.onAdSkipped)}\n onBmpAdStarted={proxy(props.onAdStarted)}\n onBmpCastAvailable={proxy(props.onCastAvailable)}\n onBmpCastPaused={proxy(props.onCastPaused)}\n onBmpCastPlaybackFinished={proxy(props.onCastPlaybackFinished)}\n onBmpCastPlaying={proxy(props.onCastPlaying)}\n onBmpCastStarted={proxy(props.onCastStarted)}\n onBmpCastStart={proxy(props.onCastStart)}\n onBmpCastStopped={proxy(props.onCastStopped)}\n onBmpCastTimeUpdated={proxy(props.onCastTimeUpdated)}\n onBmpCastWaitingForDevice={proxy(props.onCastWaitingForDevice)}\n onBmpCueEnter={proxy(props.onCueEnter)}\n onBmpCueExit={proxy(props.onCueExit)}\n onBmpMetadata={\n props.onMetadata\n ? (e) => props.onMetadata?.(addPlatformToMetadataEvent(e.nativeEvent))\n : undefined\n }\n onBmpMetadataParsed={\n props.onMetadataParsed\n ? (e) =>\n props.onMetadataParsed?.(\n addPlatformToMetadataEvent(e.nativeEvent)\n )\n : undefined\n }\n onBmpDestroy={proxy(props.onDestroy)}\n onBmpEvent={proxy(props.onEvent)}\n onBmpFullscreenEnabled={proxy(props.onFullscreenEnabled)}\n onBmpFullscreenDisabled={proxy(props.onFullscreenDisabled)}\n onBmpFullscreenEnter={proxy(props.onFullscreenEnter)}\n onBmpFullscreenExit={proxy(props.onFullscreenExit)}\n onBmpMuted={proxy(props.onMuted)}\n onBmpPaused={proxy(props.onPaused)}\n onBmpPictureInPictureAvailabilityChanged={proxy(\n props.onPictureInPictureAvailabilityChanged\n )}\n onBmpPictureInPictureEnter={proxy(props.onPictureInPictureEnter)}\n onBmpPictureInPictureEntered={proxy(props.onPictureInPictureEntered)}\n onBmpPictureInPictureExit={proxy(props.onPictureInPictureExit)}\n onBmpPictureInPictureExited={proxy(props.onPictureInPictureExited)}\n onBmpPlay={proxy(props.onPlay)}\n onBmpPlaybackFinished={proxy(props.onPlaybackFinished)}\n onBmpPlaybackSpeedChanged={proxy(props.onPlaybackSpeedChanged)}\n onBmpPlayerActive={proxy(props.onPlayerActive)}\n onBmpPlayerError={proxy(props.onPlayerError)}\n onBmpPlayerWarning={proxy(props.onPlayerWarning)}\n onBmpPlaying={proxy(props.onPlaying)}\n onBmpReady={proxy(props.onReady)}\n onBmpSeek={proxy(props.onSeek)}\n onBmpSeeked={proxy(props.onSeeked)}\n onBmpTimeShift={proxy(props.onTimeShift)}\n onBmpTimeShifted={proxy(props.onTimeShifted)}\n onBmpStallStarted={proxy(props.onStallStarted)}\n onBmpStallEnded={proxy(props.onStallEnded)}\n onBmpSourceError={proxy(props.onSourceError)}\n onBmpSourceLoad={proxy(props.onSourceLoad)}\n onBmpSourceLoaded={proxy(props.onSourceLoaded)}\n onBmpSourceUnloaded={proxy(props.onSourceUnloaded)}\n onBmpSourceWarning={proxy(props.onSourceWarning)}\n onBmpAudioAdded={proxy(props.onAudioAdded)}\n onBmpAudioChanged={proxy(props.onAudioChanged)}\n onBmpAudioRemoved={proxy(props.onAudioRemoved)}\n onBmpSubtitleAdded={proxy(props.onSubtitleAdded)}\n onBmpSubtitleChanged={proxy(props.onSubtitleChanged)}\n onBmpSubtitleRemoved={proxy(props.onSubtitleRemoved)}\n onBmpTimeChanged={proxy(props.onTimeChanged)}\n onBmpUnmuted={proxy(props.onUnmuted)}\n onBmpVideoDownloadQualityChanged={proxy(\n props.onVideoDownloadQualityChanged\n )}\n onBmpVideoPlaybackQualityChanged={proxy(\n props.onVideoPlaybackQualityChanged\n )}\n onBmpDownloadFinished={proxy(props.onDownloadFinished)}\n onBmpFairplayLicenseAcquired={proxy(props.onFairplayLicenseAcquired)}\n />\n );\n}\n\ninterface InternalPlayerViewRef extends RefObject<any> {\n /**\n * Update Picture in Picture actions that should be displayed on the Picture in Picture window.\n * Ideally we would just pass the props to the `NativePlayerView`, but due to a React Native limitation,\n * the props aren't passed to the native module when PiP is active on Android.\n */\n updatePictureInPictureActions: (\n actions: PictureInPictureAction[]\n ) => Promise<void>;\n /**\n * Enables or disables Picture in Picture mode availability.\n * Only applicable on iOS — `isPictureInPictureRequested` has no effect when disabled.\n */\n setIsPictureInPictureEnabled: (isEnabled: boolean) => Promise<void>;\n}\n"]}
@@ -65,6 +65,15 @@ export interface BasePlayerViewProps {
65
65
  * - iOS: All actions enabled
66
66
  */
67
67
  pictureInPictureActions?: PictureInPictureAction[];
68
+ /**
69
+ * Enables or disables Picture in Picture mode availability.
70
+ * When disabled, `isPictureInPictureRequested` property has no effect.
71
+ *
72
+ * Can be changed dynamically after the player is initialized.
73
+ *
74
+ * @platform iOS, tvOS
75
+ */
76
+ isPictureInPictureEnabled?: boolean;
68
77
  }
69
78
  /**
70
79
  * {@link PlayerView} component props.
@@ -1 +1 @@
1
- {"version":3,"file":"properties.d.ts","sourceRoot":"","sources":["../../../src/components/PlayerView/properties.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AACnE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC,GAAG,CAAC,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC;IACtB;;OAEG;IACH,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IAEtC;;OAEG;IACH,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;IAE5C;;;;;;;OAOG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAEhC;;;OAGG;IACH,WAAW,CAAC,EAAE,WAAW,CAAC;IAE1B;;;OAGG;IACH,2BAA2B,CAAC,EAAE,OAAO,CAAC;IAEtC;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAElB;;;OAGG;IACH,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAE1B;;;;;;;;;;;;;;;OAeG;IACH,uBAAuB,CAAC,EAAE,sBAAsB,EAAE,CAAC;CACpD;AAED;;GAEG;AACH,MAAM,WAAW,eAAgB,SAAQ,mBAAmB,EAAE,gBAAgB;IAC5E,OAAO,CAAC,EAAE,SAAS,CAAC,GAAG,CAAC,CAAC;IACzB;;;OAGG;IACH,MAAM,EAAE,MAAM,CAAC;CAChB"}
1
+ {"version":3,"file":"properties.d.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M,CAAC;CAChB"}
@@ -1 +1 @@
1
- {"version":3,"file":"properties.js","sourceRoot":"","sources":["../../../src/components/PlayerView/properties.ts"],"names":[],"mappings":"","sourcesContent":["import { PlayerViewEvents } from './events';\nimport { Player } from '../../player';\nimport { FullscreenHandler, CustomMessageHandler } from '../../ui';\nimport { ScalingMode } from '../../styleConfig';\nimport { ViewStyle } from 'react-native';\nimport { PlayerViewConfig } from './playerViewConfig';\nimport { PictureInPictureAction } from './pictureInPictureAction';\nimport { RefObject } from 'react';\n\n/**\n * Base `PlayerView` component props.\n * Used to establish common props between `NativePlayerView` and {@link PlayerView}.\n */\nexport interface BasePlayerViewProps {\n ref?: RefObject<null>;\n /**\n * The {@link FullscreenHandler} that is used by the {@link PlayerView} to control the fullscreen mode.\n */\n fullscreenHandler?: FullscreenHandler;\n\n /**\n * The {@link CustomMessageHandler} that can be used to directly communicate with the embedded Bitmovin Web UI.\n */\n customMessageHandler?: CustomMessageHandler;\n\n /**\n * Can be set to `true` to request fullscreen mode, or `false` to request exit of fullscreen mode.\n * Should not be used to get the current fullscreen state. Use {@link PlayerViewEvents.onFullscreenEnter} and {@link PlayerViewEvents.onFullscreenExit}\n * or the {@link FullscreenHandler.isFullscreenActive} property to get the current state.\n * Using this property to change the fullscreen state, it is ensured that the embedded Player UI is also aware\n * of potential fullscreen state changes.\n * To use this property, a {@link FullscreenHandler} must be set.\n */\n isFullscreenRequested?: boolean;\n\n /**\n * A value defining how the video is displayed within the parent container's bounds.\n * Possible values are defined in {@link ScalingMode}.\n */\n scalingMode?: ScalingMode;\n\n /**\n * Can be set to `true` to request Picture in Picture mode, or `false` to request exit of Picture in Picture mode.\n * Should not be used to get the current Picture in Picture state. Use {@link PlayerViewEvents.onPictureInPictureEnter} and {@link PlayerViewEvents.onPictureInPictureExit}.\n */\n isPictureInPictureRequested?: boolean;\n\n /**\n * Style of the {@link PlayerView}.\n */\n style?: ViewStyle;\n\n /**\n * Configures the visual presentation and behaviour of the {@link PlayerView}.\n * The value must not be altered after setting it initially.\n */\n config?: PlayerViewConfig;\n\n /**\n * Picture in Picture actions that should be displayed on the Picture in Picture window.\n *\n * Limitations:\n * - On Android if an empty list is passed and {@link MediaControlConfig.isEnabled} is set to true\n * play, pause, next, and previous controls will appear, due to the default Android Picture in Picture implementation:\n * https://developer.android.com/develop/ui/views/picture-in-picture#add_controls\n * Set {@link MediaControlConfig.isEnabled} to false if this is\n * not the desired behaviour.\n * - on iOS/tvOS if {@link PictureInPictureAction.TogglePlayback} is not specified also other actions are\n * disabled due to OS limitations.\n *\n * Default value is `undefined`, which translates to:\n * - Android: No actions, unless {@link MediaControlConfig.isEnabled} is set to true\n * - iOS: All actions enabled\n */\n pictureInPictureActions?: PictureInPictureAction[];\n}\n\n/**\n * {@link PlayerView} component props.\n */\nexport interface PlayerViewProps extends BasePlayerViewProps, PlayerViewEvents {\n viewRef?: RefObject<any>;\n /**\n * {@link Player} instance (generally returned from {@link usePlayer} hook) that will control\n * and render audio/video inside the {@link PlayerView}.\n */\n player: Player;\n}\n"]}
1
+ {"version":3,"file":"properties.js","sourceRoot":"","sources":["../../../src/components/PlayerView/properties.ts"],"names":[],"mappings":"","sourcesContent":["import { PlayerViewEvents } from './events';\nimport { Player } from '../../player';\nimport { FullscreenHandler, CustomMessageHandler } from '../../ui';\nimport { ScalingMode } from '../../styleConfig';\nimport { ViewStyle } from 'react-native';\nimport { PlayerViewConfig } from './playerViewConfig';\nimport { PictureInPictureAction } from './pictureInPictureAction';\nimport { RefObject } from 'react';\n\n/**\n * Base `PlayerView` component props.\n * Used to establish common props between `NativePlayerView` and {@link PlayerView}.\n */\nexport interface BasePlayerViewProps {\n ref?: RefObject<null>;\n /**\n * The {@link FullscreenHandler} that is used by the {@link PlayerView} to control the fullscreen mode.\n */\n fullscreenHandler?: FullscreenHandler;\n\n /**\n * The {@link CustomMessageHandler} that can be used to directly communicate with the embedded Bitmovin Web UI.\n */\n customMessageHandler?: CustomMessageHandler;\n\n /**\n * Can be set to `true` to request fullscreen mode, or `false` to request exit of fullscreen mode.\n * Should not be used to get the current fullscreen state. Use {@link PlayerViewEvents.onFullscreenEnter} and {@link PlayerViewEvents.onFullscreenExit}\n * or the {@link FullscreenHandler.isFullscreenActive} property to get the current state.\n * Using this property to change the fullscreen state, it is ensured that the embedded Player UI is also aware\n * of potential fullscreen state changes.\n * To use this property, a {@link FullscreenHandler} must be set.\n */\n isFullscreenRequested?: boolean;\n\n /**\n * A value defining how the video is displayed within the parent container's bounds.\n * Possible values are defined in {@link ScalingMode}.\n */\n scalingMode?: ScalingMode;\n\n /**\n * Can be set to `true` to request Picture in Picture mode, or `false` to request exit of Picture in Picture mode.\n * Should not be used to get the current Picture in Picture state. Use {@link PlayerViewEvents.onPictureInPictureEnter} and {@link PlayerViewEvents.onPictureInPictureExit}.\n */\n isPictureInPictureRequested?: boolean;\n\n /**\n * Style of the {@link PlayerView}.\n */\n style?: ViewStyle;\n\n /**\n * Configures the visual presentation and behaviour of the {@link PlayerView}.\n * The value must not be altered after setting it initially.\n */\n config?: PlayerViewConfig;\n\n /**\n * Picture in Picture actions that should be displayed on the Picture in Picture window.\n *\n * Limitations:\n * - On Android if an empty list is passed and {@link MediaControlConfig.isEnabled} is set to true\n * play, pause, next, and previous controls will appear, due to the default Android Picture in Picture implementation:\n * https://developer.android.com/develop/ui/views/picture-in-picture#add_controls\n * Set {@link MediaControlConfig.isEnabled} to false if this is\n * not the desired behaviour.\n * - on iOS/tvOS if {@link PictureInPictureAction.TogglePlayback} is not specified also other actions are\n * disabled due to OS limitations.\n *\n * Default value is `undefined`, which translates to:\n * - Android: No actions, unless {@link MediaControlConfig.isEnabled} is set to true\n * - iOS: All actions enabled\n */\n pictureInPictureActions?: PictureInPictureAction[];\n\n /**\n * Enables or disables Picture in Picture mode availability.\n * When disabled, `isPictureInPictureRequested` property has no effect.\n *\n * Can be changed dynamically after the player is initialized.\n *\n * @platform iOS, tvOS\n */\n isPictureInPictureEnabled?: boolean;\n}\n\n/**\n * {@link PlayerView} component props.\n */\nexport interface PlayerViewProps extends BasePlayerViewProps, PlayerViewEvents {\n viewRef?: RefObject<any>;\n /**\n * {@link Player} instance (generally returned from {@link usePlayer} hook) that will control\n * and render audio/video inside the {@link PlayerView}.\n */\n player: Player;\n}\n"]}
package/build/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  export * from './adaptationConfig';
2
+ export * from './cmcdConfig';
2
3
  export * from './advertising';
3
4
  export * from './analytics';
4
5
  export * from './audioSession';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,MAAM,CAAC;AACrB,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,sBAAsB,CAAC;AACrC,cAAc,SAAS,CAAC;AACxB,cAAc,yBAAyB,CAAC;AACxC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,MAAM,CAAC;AACrB,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,sBAAsB,CAAC;AACrC,cAAc,SAAS,CAAC;AACxB,cAAc,yBAAyB,CAAC;AACxC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC"}
package/build/index.js CHANGED
@@ -1,4 +1,5 @@
1
1
  export * from './adaptationConfig';
2
+ export * from './cmcdConfig';
2
3
  export * from './advertising';
3
4
  export * from './analytics';
4
5
  export * from './audioSession';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,MAAM,CAAC;AACrB,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,sBAAsB,CAAC;AACrC,cAAc,SAAS,CAAC;AACxB,cAAc,yBAAyB,CAAC;AACxC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC","sourcesContent":["export * from './adaptationConfig';\nexport * from './advertising';\nexport * from './analytics';\nexport * from './audioSession';\nexport * from './components';\nexport * from './drm';\nexport * from './events';\nexport * from './hooks';\nexport * from './player';\nexport * from './source';\nexport * from './subtitleTrack';\nexport * from './styleConfig';\nexport * from './ui';\nexport * from './offline';\nexport * from './thumbnail';\nexport * from './remoteControlConfig';\nexport * from './bitmovinCastManager';\nexport * from './audioTrack';\nexport * from './media';\nexport * from './metadata';\nexport * from './tweaksConfig';\nexport * from './bufferConfig';\nexport * from './playbackConfig';\nexport * from './playerConfig';\nexport * from './liveConfig';\nexport * from './bufferApi';\nexport * from './network';\nexport * from './mediaControlConfig';\nexport * from './debug';\nexport * from './decoder/decoderConfig';\nexport * from './mediaTrackRole';\nexport * from './subtitleFormat';\nexport * from './utils/temporal';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,MAAM,CAAC;AACrB,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,sBAAsB,CAAC;AACrC,cAAc,SAAS,CAAC;AACxB,cAAc,yBAAyB,CAAC;AACxC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC","sourcesContent":["export * from './adaptationConfig';\nexport * from './cmcdConfig';\nexport * from './advertising';\nexport * from './analytics';\nexport * from './audioSession';\nexport * from './components';\nexport * from './drm';\nexport * from './events';\nexport * from './hooks';\nexport * from './player';\nexport * from './source';\nexport * from './subtitleTrack';\nexport * from './styleConfig';\nexport * from './ui';\nexport * from './offline';\nexport * from './thumbnail';\nexport * from './remoteControlConfig';\nexport * from './bitmovinCastManager';\nexport * from './audioTrack';\nexport * from './media';\nexport * from './metadata';\nexport * from './tweaksConfig';\nexport * from './bufferConfig';\nexport * from './playbackConfig';\nexport * from './playerConfig';\nexport * from './liveConfig';\nexport * from './bufferApi';\nexport * from './network';\nexport * from './mediaControlConfig';\nexport * from './debug';\nexport * from './decoder/decoderConfig';\nexport * from './mediaTrackRole';\nexport * from './subtitleFormat';\nexport * from './utils/temporal';\n"]}
@@ -65,6 +65,13 @@ export interface PlaybackConfig {
65
65
  * ```
66
66
  */
67
67
  isBackgroundPlaybackEnabled?: boolean;
68
+ /**
69
+ * Whether to automate audio focus management, allowing the player to pause when other apps request focus.
70
+ *
71
+ * @defaultValue `false`
72
+ * @platform Android
73
+ */
74
+ handleAudioFocus?: boolean;
68
75
  /**
69
76
  * Whether the Picture in Picture mode option is enabled or not. Default is `false`.
70
77
  * @example
@@ -1 +1 @@
1
- {"version":3,"file":"playbackConfig.d.ts","sourceRoot":"","sources":["../src/playbackConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B;;;;;;;;;;OAUG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B;;;;;;;;;;OAUG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;;;;;;;OAUG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACH,2BAA2B,CAAC,EAAE,OAAO,CAAC;IACtC;;;;;;;;;;;OAWG;IACH,yBAAyB,CAAC,EAAE,OAAO,CAAC;IAEpC;;;;OAIG;IACH,aAAa,CAAC,EAAE,aAAa,CAAC;CAC/B"}
1
+ {"version":3,"file":"playbackConfig.d.ts","sourceRoot":"","sources":["../src/playbackConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B;;;;;;;;;;OAUG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B;;;;;;;;;;OAUG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;;;;;;;OAUG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACH,2BAA2B,CAAC,EAAE,OAAO,CAAC;IACtC;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B;;;;;;;;;;;OAWG;IACH,yBAAyB,CAAC,EAAE,OAAO,CAAC;IAEpC;;;;OAIG;IACH,aAAa,CAAC,EAAE,aAAa,CAAC;CAC/B"}
@@ -1 +1 @@
1
- {"version":3,"file":"playbackConfig.js","sourceRoot":"","sources":["../src/playbackConfig.ts"],"names":[],"mappings":"","sourcesContent":["import { DecoderConfig } from './decoder/decoderConfig';\n\n/**\n * Configures the playback behaviour of the player.\n */\nexport interface PlaybackConfig {\n /**\n * Whether the player starts playing automatically after loading a source or not. Default is `false`.\n * @example\n * ```\n * const player = new Player({\n * playbackConfig: {\n * isAutoplayEnabled: true,\n * },\n * });\n * ```\n */\n isAutoplayEnabled?: boolean;\n /**\n * Whether the sound is muted on startup or not. Default value is `false`.\n * @example\n * ```\n * const player = new Player({\n * playbackConfig: {\n * isMuted: true,\n * },\n * });\n * ```\n */\n isMuted?: boolean;\n /**\n * Whether time shift / DVR for live streams is enabled or not. Default is `true`.\n * @example\n * ```\n * const player = new Player({\n * playbackConfig: {\n * isTimeShiftEnabled: false,\n * },\n * });\n * ```\n */\n isTimeShiftEnabled?: boolean;\n /**\n * Whether background playback is enabled or not.\n * Default is `false`.\n *\n * When set to `true`, playback is not automatically paused\n * anymore when the app moves to the background.\n * When set to `true`, also make sure to properly configure your app to allow\n * background playback.\n *\n * Default is `false`.\n *\n * @remarks\n * - On Android, {@link MediaControlConfig.isEnabled} has to be `true` for\n * background playback to work.\n * - On tvOS, background playback is only supported for audio-only content.\n *\n * @example\n * ```\n * const player = new Player({\n * playbackConfig: {\n * isBackgroundPlaybackEnabled: true,\n * },\n * });\n * ```\n */\n isBackgroundPlaybackEnabled?: boolean;\n /**\n * Whether the Picture in Picture mode option is enabled or not. Default is `false`.\n * @example\n * ```\n * const player = new Player({\n * playbackConfig: {\n * isPictureInPictureEnabled: true,\n * },\n * });\n * ```\n * @deprecated Use {@link PictureInPictureConfig.isEnabled} instead.\n */\n isPictureInPictureEnabled?: boolean;\n\n /**\n * Configures decoder behaviour.\n *\n * @platform Android\n */\n decoderConfig?: DecoderConfig;\n}\n"]}
1
+ {"version":3,"file":"playbackConfig.js","sourceRoot":"","sources":["../src/playbackConfig.ts"],"names":[],"mappings":"","sourcesContent":["import { DecoderConfig } from './decoder/decoderConfig';\n\n/**\n * Configures the playback behaviour of the player.\n */\nexport interface PlaybackConfig {\n /**\n * Whether the player starts playing automatically after loading a source or not. Default is `false`.\n * @example\n * ```\n * const player = new Player({\n * playbackConfig: {\n * isAutoplayEnabled: true,\n * },\n * });\n * ```\n */\n isAutoplayEnabled?: boolean;\n /**\n * Whether the sound is muted on startup or not. Default value is `false`.\n * @example\n * ```\n * const player = new Player({\n * playbackConfig: {\n * isMuted: true,\n * },\n * });\n * ```\n */\n isMuted?: boolean;\n /**\n * Whether time shift / DVR for live streams is enabled or not. Default is `true`.\n * @example\n * ```\n * const player = new Player({\n * playbackConfig: {\n * isTimeShiftEnabled: false,\n * },\n * });\n * ```\n */\n isTimeShiftEnabled?: boolean;\n /**\n * Whether background playback is enabled or not.\n * Default is `false`.\n *\n * When set to `true`, playback is not automatically paused\n * anymore when the app moves to the background.\n * When set to `true`, also make sure to properly configure your app to allow\n * background playback.\n *\n * Default is `false`.\n *\n * @remarks\n * - On Android, {@link MediaControlConfig.isEnabled} has to be `true` for\n * background playback to work.\n * - On tvOS, background playback is only supported for audio-only content.\n *\n * @example\n * ```\n * const player = new Player({\n * playbackConfig: {\n * isBackgroundPlaybackEnabled: true,\n * },\n * });\n * ```\n */\n isBackgroundPlaybackEnabled?: boolean;\n /**\n * Whether to automate audio focus management, allowing the player to pause when other apps request focus.\n *\n * @defaultValue `false`\n * @platform Android\n */\n handleAudioFocus?: boolean;\n /**\n * Whether the Picture in Picture mode option is enabled or not. Default is `false`.\n * @example\n * ```\n * const player = new Player({\n * playbackConfig: {\n * isPictureInPictureEnabled: true,\n * },\n * });\n * ```\n * @deprecated Use {@link PictureInPictureConfig.isEnabled} instead.\n */\n isPictureInPictureEnabled?: boolean;\n\n /**\n * Configures decoder behaviour.\n *\n * @platform Android\n */\n decoderConfig?: DecoderConfig;\n}\n"]}
package/build/source.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { CmcdConfig } from './cmcdConfig';
1
2
  import { Drm, DrmConfig } from './drm';
2
3
  import NativeInstance, { NativeInstanceConfig } from './nativeInstance';
3
4
  import { SideLoadedSubtitleTrack } from './subtitleTrack';
@@ -126,6 +127,12 @@ export interface SourceConfig extends NativeInstanceConfig {
126
127
  * The `SourceMetadata` for the {@link Source} to setup custom analytics tracking
127
128
  */
128
129
  analyticsSourceMetadata?: SourceMetadata;
130
+ /**
131
+ * The CMCD (Common Media Client Data) configuration for this source.
132
+ *
133
+ * @platform iOS 18+, tvOS 18+
134
+ */
135
+ cmcdConfig?: CmcdConfig;
129
136
  }
130
137
  /**
131
138
  * The remote control config for a source.
@@ -1 +1 @@
1
- {"version":3,"file":"source.d.ts","sourceRoot":"","sources":["../src/source.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,cAAc,EAAE,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACxE,OAAO,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAG7C;;GAE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KAAK,CAAC;IAC/D,CAAC,CAAC;IAEF;;OAEG;IACH,kBAAkB,GAAG,KAAK,IAAsB,EAAE;QAChD,OAAO,CAAC,MAAM,YAAY,CAAC,kBAAkB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,IAAI,KAAK,CAAC;IACzE,CAAC,CAAC;IAEF;;OAEG;IACH,QAAQ,GAAG,KAAK,IAAyC,EAAE;QACzD,OAAO,YAAY,CAAC,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACjD,CAAC,CAAC;IAEF;;;;;OAKG;IACH,WAAW,GAAG,CAAC,QAAoC,EAAQ,EAAE;QAC3D,KAAK,YAAY,CAAC,WAAW,CAAC,IAAI,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IACzD,CAAC,CAAC;IAEF;;OAEG;IACH,YAAY,GAAG,KAAK,IAA2B,EAAE;QAC/C,OAAO,CACL,CAAC,MAAM,YAAY,CAAC,YAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,IAAI,YAAY,CAAC,QAAQ,CAC1E,CAAC;IACJ,CAAC,CAAC;IAEF;;;;;;;;;OASG;IACH,YAAY,GAAG,KAAK,EAAE,IAAY,EAA6B,EAAE;QAC/D,OAAO,YAAY,CAAC,YAAY,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;IACxD,CAAC,CAAC;CACH","sourcesContent":["import { Drm, DrmConfig } from './drm';\nimport NativeInstance, { NativeInstanceConfig } from './nativeInstance';\nimport { SideLoadedSubtitleTrack } from './subtitleTrack';\nimport { Thumbnail } from './thumbnail';\nimport { SourceMetadata } from './analytics';\nimport SourceModule from './modules/SourceModule';\n\n/**\n * Types of media that can be handled by the player.\n */\nexport enum SourceType {\n /**\n * Indicates a missing source type.\n */\n NONE = 'none',\n /**\n * Indicates media type HLS.\n */\n HLS = 'hls',\n /**\n * Indicates media type DASH.\n */\n DASH = 'dash',\n /**\n * Indicates media type Progressive MP4.\n */\n PROGRESSIVE = 'progressive',\n}\n\n/**\n * The different loading states a {@link Source} instance can be in.\n */\nexport enum LoadingState {\n /**\n * The source is unloaded.\n */\n UNLOADED = 0,\n /**\n * The source is currently loading.\n */\n LOADING = 1,\n /**\n * The source is loaded.\n */\n LOADED = 2,\n}\n\n/**\n * Types of SourceOptions.\n */\nexport interface SourceOptions {\n /**\n * The position where the stream should be started.\n * Number can be positive or negative depending on the used `TimelineReferencePoint`.\n * Invalid numbers will be corrected according to the stream boundaries.\n * For VOD this is applied at the time the stream is loaded, for LIVE when playback starts.\n */\n startOffset?: number;\n /**\n * Sets the Timeline reference point to calculate the startOffset from.\n * Default for live: `TimelineReferencePoint.END`.\n * Default for VOD: `TimelineReferencePoint.START`.\n */\n startOffsetTimelineReference?: TimelineReferencePoint;\n}\n\n/**\n Timeline reference point to calculate SourceOptions.startOffset from.\n Default for live: TimelineReferencePoint.EBD Default for VOD: TimelineReferencePoint.START.\n */\nexport enum TimelineReferencePoint {\n /**\n * Relative offset will be calculated from the beginning of the stream or DVR window.\n */\n START = 'start',\n /**\n * Relative offset will be calculated from the end of the stream or the live edge in case of a live stream with DVR window.\n */\n END = 'end',\n}\n\n/**\n * Represents a source configuration that be loaded into a player instance.\n */\nexport interface SourceConfig extends NativeInstanceConfig {\n /**\n * The url for this source configuration.\n */\n url: string;\n /**\n * The `SourceType` for this configuration.\n */\n type?: SourceType;\n /**\n * The title of the video source.\n */\n title?: string;\n /**\n * The description of the video source.\n */\n description?: string;\n /**\n * The URL to a preview image displayed until the video starts.\n */\n poster?: string;\n /**\n * Indicates whether to show the poster image during playback.\n * Useful, for example, for audio-only streams.\n */\n isPosterPersistent?: boolean;\n /**\n * The DRM config for the source.\n */\n drmConfig?: DrmConfig;\n /**\n * External subtitle tracks to be added into the player.\n */\n subtitleTracks?: SideLoadedSubtitleTrack[];\n /**\n * External thumbnails to be added into the player.\n */\n thumbnailTrack?: string;\n /**\n * The optional custom metadata. Also sent to the cast receiver when loading the Source.\n */\n metadata?: Record<string, string>;\n /**\n * The `SourceOptions` for this configuration.\n */\n options?: SourceOptions;\n /**\n * The `SourceMetadata` for the {@link Source} to setup custom analytics tracking\n */\n analyticsSourceMetadata?: SourceMetadata;\n}\n\n/**\n * The remote control config for a source.\n * @platform iOS\n */\nexport interface SourceRemoteControlConfig {\n /**\n * The `SourceConfig` for casting.\n * Enables to play different content when casting.\n * This can be useful when the remote playback device supports different streaming formats,\n * DRM systems, etc. than the local device.\n * If not set, the local source config will be used for casting.\n */\n castSourceConfig?: SourceConfig | null;\n}\n\n/**\n * Represents audio and video content that can be loaded into a player.\n */\nexport class Source extends NativeInstance<SourceConfig> {\n /**\n * Provides access to DRM runtime APIs for this source.\n * Use `drm.fairplay` to access {@link FairplayDrmApi} for FairPlay-specific APIs such as {@link FairplayDrmApi.renewExpiringLicense}.\n *\n * `undefined` if the source was created without a {@link DrmConfig}.\n */\n drm?: Drm;\n /**\n * The remote control config for this source.\n * This is only supported on iOS.\n *\n * @platform iOS\n */\n remoteControl: SourceRemoteControlConfig | null = null;\n /**\n * Whether the native {@link Source} object has been created.\n */\n isInitialized = false;\n /**\n * Whether the native {@link Source} object has been disposed.\n */\n isDestroyed = false;\n\n /**\n * Allocates the native {@link Source} instance and its resources natively.\n */\n initialize = async (): Promise<void> => {\n if (!this.isInitialized) {\n const sourceMetadata = this.config?.analyticsSourceMetadata;\n if (this.config?.drmConfig) {\n this.drm = new Drm(this.config.drmConfig, this.nativeId);\n await this.drm.initialize();\n }\n if (sourceMetadata) {\n await SourceModule.initializeWithAnalyticsConfig(\n this.nativeId,\n this.drm?.nativeId,\n this.config,\n this.remoteControl || undefined,\n sourceMetadata\n );\n } else {\n await SourceModule.initializeWithConfig(\n this.nativeId,\n this.drm?.nativeId,\n this.config,\n this.remoteControl || undefined\n );\n }\n this.isInitialized = true;\n }\n return Promise.resolve();\n };\n\n /**\n * Destroys the native {@link Source} and releases all of its allocated resources.\n */\n destroy = () => {\n if (!this.isDestroyed) {\n void SourceModule.destroy(this.nativeId);\n void this.drm?.destroy();\n this.isDestroyed = true;\n }\n };\n\n /**\n * The duration of the source in seconds if it’s a VoD or `INFINITY` if it’s a live stream.\n * Default value is `0` if the duration is not available or not known.\n */\n duration = async (): Promise<number> => {\n return (await SourceModule.duration(this.nativeId)) || 0;\n };\n\n /**\n * Whether the source is currently active in a player (i.e. playing back or paused).\n * Only one source can be active in the same player instance at any time.\n */\n isActive = async (): Promise<boolean> => {\n return (await SourceModule.isActive(this.nativeId)) ?? false;\n };\n\n /**\n * Whether the source is currently attached to a player instance.\n */\n isAttachedToPlayer = async (): Promise<boolean> => {\n return (await SourceModule.isAttachedToPlayer(this.nativeId)) ?? false;\n };\n\n /**\n * Metadata for the currently loaded source.\n */\n metadata = async (): Promise<Record<string, any> | null> => {\n return SourceModule.getMetadata(this.nativeId);\n };\n\n /**\n * Set metadata for the currently loaded source.\n * Setting the metadata to `null` clears the metadata object in native source.\n *\n * @param metadata metadata to be set.\n */\n setMetadata = (metadata: Record<string, any> | null): void => {\n void SourceModule.setMetadata(this.nativeId, metadata);\n };\n\n /**\n * The current `LoadingState` of the source.\n */\n loadingState = async (): Promise<LoadingState> => {\n return (\n (await SourceModule.loadingState(this.nativeId)) || LoadingState.UNLOADED\n );\n };\n\n /**\n * @returns a `Thumbnail` for the specified playback time if available.\n * Supported thumbnail formats are:\n * - `WebVtt` configured via {@link SourceConfig.thumbnailTrack}, on all supported platforms\n * - HLS `Image Media Playlist` in the multivariant playlist, Android-only\n * - DASH `Image Adaptation Set` as specified in DASH-IF IOP, Android-only\n * If a `WebVtt` thumbnail track is provided, any potential in-manifest thumbnails are ignored on Android.\n *\n * @param time - The time in seconds for which to retrieve the thumbnail.\n */\n getThumbnail = async (time: number): Promise<Thumbnail | null> => {\n return SourceModule.getThumbnail(this.nativeId, time);\n };\n}\n"]}
1
+ {"version":3,"file":"source.js","sourceRoot":"","sources":["../src/source.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAa,MAAM,OAAO,CAA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BAAkB,GAAG,KAAK,IAAsB,EAAE;QAChD,OAAO,CAAC,MAAM,YAAY,CAAC,kBAAkB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,IAAI,KAAK,CAAC;IACzE,CAAC,CAAC;IAEF;;OAEG;IACH,QAAQ,GAAG,KAAK,IAAyC,EAAE;QACzD,OAAO,YAAY,CAAC,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACjD,CAAC,CAAC;IAEF;;;;;OAKG;IACH,WAAW,GAAG,CAAC,QAAoC,EAAQ,EAAE;QAC3D,KAAK,YAAY,CAAC,WAAW,CAAC,IAAI,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IACzD,CAAC,CAAC;IAEF;;OAEG;IACH,YAAY,GAAG,KAAK,IAA2B,EAAE;QAC/C,OAAO,CACL,CAAC,MAAM,YAAY,CAAC,YAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,IAAI,YAAY,CAAC,QAAQ,CAC1E,CAAC;IACJ,CAAC,CAAC;IAEF;;;;;;;;;OASG;IACH,YAAY,GAAG,KAAK,EAAE,IAAY,EAA6B,EAAE;QAC/D,OAAO,YAAY,CAAC,YAAY,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;IACxD,CAAC,CAAC;CACH","sourcesContent":["import { CmcdConfig } from './cmcdConfig';\nimport { Drm, DrmConfig } from './drm';\nimport NativeInstance, { NativeInstanceConfig } from './nativeInstance';\nimport { SideLoadedSubtitleTrack } from './subtitleTrack';\nimport { Thumbnail } from './thumbnail';\nimport { SourceMetadata } from './analytics';\nimport SourceModule from './modules/SourceModule';\n\n/**\n * Types of media that can be handled by the player.\n */\nexport enum SourceType {\n /**\n * Indicates a missing source type.\n */\n NONE = 'none',\n /**\n * Indicates media type HLS.\n */\n HLS = 'hls',\n /**\n * Indicates media type DASH.\n */\n DASH = 'dash',\n /**\n * Indicates media type Progressive MP4.\n */\n PROGRESSIVE = 'progressive',\n}\n\n/**\n * The different loading states a {@link Source} instance can be in.\n */\nexport enum LoadingState {\n /**\n * The source is unloaded.\n */\n UNLOADED = 0,\n /**\n * The source is currently loading.\n */\n LOADING = 1,\n /**\n * The source is loaded.\n */\n LOADED = 2,\n}\n\n/**\n * Types of SourceOptions.\n */\nexport interface SourceOptions {\n /**\n * The position where the stream should be started.\n * Number can be positive or negative depending on the used `TimelineReferencePoint`.\n * Invalid numbers will be corrected according to the stream boundaries.\n * For VOD this is applied at the time the stream is loaded, for LIVE when playback starts.\n */\n startOffset?: number;\n /**\n * Sets the Timeline reference point to calculate the startOffset from.\n * Default for live: `TimelineReferencePoint.END`.\n * Default for VOD: `TimelineReferencePoint.START`.\n */\n startOffsetTimelineReference?: TimelineReferencePoint;\n}\n\n/**\n Timeline reference point to calculate SourceOptions.startOffset from.\n Default for live: TimelineReferencePoint.EBD Default for VOD: TimelineReferencePoint.START.\n */\nexport enum TimelineReferencePoint {\n /**\n * Relative offset will be calculated from the beginning of the stream or DVR window.\n */\n START = 'start',\n /**\n * Relative offset will be calculated from the end of the stream or the live edge in case of a live stream with DVR window.\n */\n END = 'end',\n}\n\n/**\n * Represents a source configuration that be loaded into a player instance.\n */\nexport interface SourceConfig extends NativeInstanceConfig {\n /**\n * The url for this source configuration.\n */\n url: string;\n /**\n * The `SourceType` for this configuration.\n */\n type?: SourceType;\n /**\n * The title of the video source.\n */\n title?: string;\n /**\n * The description of the video source.\n */\n description?: string;\n /**\n * The URL to a preview image displayed until the video starts.\n */\n poster?: string;\n /**\n * Indicates whether to show the poster image during playback.\n * Useful, for example, for audio-only streams.\n */\n isPosterPersistent?: boolean;\n /**\n * The DRM config for the source.\n */\n drmConfig?: DrmConfig;\n /**\n * External subtitle tracks to be added into the player.\n */\n subtitleTracks?: SideLoadedSubtitleTrack[];\n /**\n * External thumbnails to be added into the player.\n */\n thumbnailTrack?: string;\n /**\n * The optional custom metadata. Also sent to the cast receiver when loading the Source.\n */\n metadata?: Record<string, string>;\n /**\n * The `SourceOptions` for this configuration.\n */\n options?: SourceOptions;\n /**\n * The `SourceMetadata` for the {@link Source} to setup custom analytics tracking\n */\n analyticsSourceMetadata?: SourceMetadata;\n /**\n * The CMCD (Common Media Client Data) configuration for this source.\n *\n * @platform iOS 18+, tvOS 18+\n */\n cmcdConfig?: CmcdConfig;\n}\n\n/**\n * The remote control config for a source.\n * @platform iOS\n */\nexport interface SourceRemoteControlConfig {\n /**\n * The `SourceConfig` for casting.\n * Enables to play different content when casting.\n * This can be useful when the remote playback device supports different streaming formats,\n * DRM systems, etc. than the local device.\n * If not set, the local source config will be used for casting.\n */\n castSourceConfig?: SourceConfig | null;\n}\n\n/**\n * Represents audio and video content that can be loaded into a player.\n */\nexport class Source extends NativeInstance<SourceConfig> {\n /**\n * Provides access to DRM runtime APIs for this source.\n * Use `drm.fairplay` to access {@link FairplayDrmApi} for FairPlay-specific APIs such as {@link FairplayDrmApi.renewExpiringLicense}.\n *\n * `undefined` if the source was created without a {@link DrmConfig}.\n */\n drm?: Drm;\n /**\n * The remote control config for this source.\n * This is only supported on iOS.\n *\n * @platform iOS\n */\n remoteControl: SourceRemoteControlConfig | null = null;\n /**\n * Whether the native {@link Source} object has been created.\n */\n isInitialized = false;\n /**\n * Whether the native {@link Source} object has been disposed.\n */\n isDestroyed = false;\n\n /**\n * Allocates the native {@link Source} instance and its resources natively.\n */\n initialize = async (): Promise<void> => {\n if (!this.isInitialized) {\n const sourceMetadata = this.config?.analyticsSourceMetadata;\n if (this.config?.drmConfig) {\n this.drm = new Drm(this.config.drmConfig, this.nativeId);\n await this.drm.initialize();\n }\n if (sourceMetadata) {\n await SourceModule.initializeWithAnalyticsConfig(\n this.nativeId,\n this.drm?.nativeId,\n this.config,\n this.remoteControl || undefined,\n sourceMetadata\n );\n } else {\n await SourceModule.initializeWithConfig(\n this.nativeId,\n this.drm?.nativeId,\n this.config,\n this.remoteControl || undefined\n );\n }\n this.isInitialized = true;\n }\n return Promise.resolve();\n };\n\n /**\n * Destroys the native {@link Source} and releases all of its allocated resources.\n */\n destroy = () => {\n if (!this.isDestroyed) {\n void SourceModule.destroy(this.nativeId);\n void this.drm?.destroy();\n this.isDestroyed = true;\n }\n };\n\n /**\n * The duration of the source in seconds if it’s a VoD or `INFINITY` if it’s a live stream.\n * Default value is `0` if the duration is not available or not known.\n */\n duration = async (): Promise<number> => {\n return (await SourceModule.duration(this.nativeId)) || 0;\n };\n\n /**\n * Whether the source is currently active in a player (i.e. playing back or paused).\n * Only one source can be active in the same player instance at any time.\n */\n isActive = async (): Promise<boolean> => {\n return (await SourceModule.isActive(this.nativeId)) ?? false;\n };\n\n /**\n * Whether the source is currently attached to a player instance.\n */\n isAttachedToPlayer = async (): Promise<boolean> => {\n return (await SourceModule.isAttachedToPlayer(this.nativeId)) ?? false;\n };\n\n /**\n * Metadata for the currently loaded source.\n */\n metadata = async (): Promise<Record<string, any> | null> => {\n return SourceModule.getMetadata(this.nativeId);\n };\n\n /**\n * Set metadata for the currently loaded source.\n * Setting the metadata to `null` clears the metadata object in native source.\n *\n * @param metadata metadata to be set.\n */\n setMetadata = (metadata: Record<string, any> | null): void => {\n void SourceModule.setMetadata(this.nativeId, metadata);\n };\n\n /**\n * The current `LoadingState` of the source.\n */\n loadingState = async (): Promise<LoadingState> => {\n return (\n (await SourceModule.loadingState(this.nativeId)) || LoadingState.UNLOADED\n );\n };\n\n /**\n * @returns a `Thumbnail` for the specified playback time if available.\n * Supported thumbnail formats are:\n * - `WebVtt` configured via {@link SourceConfig.thumbnailTrack}, on all supported platforms\n * - HLS `Image Media Playlist` in the multivariant playlist, Android-only\n * - DASH `Image Adaptation Set` as specified in DASH-IF IOP, Android-only\n * If a `WebVtt` thumbnail track is provided, any potential in-manifest thumbnails are ignored on Android.\n *\n * @param time - The time in seconds for which to retrieve the thumbnail.\n */\n getThumbnail = async (time: number): Promise<Thumbnail | null> => {\n return SourceModule.getThumbnail(this.nativeId, time);\n };\n}\n"]}
@@ -90,7 +90,7 @@ extension TimeChangedEvent: JsonConvertible {
90
90
  }
91
91
 
92
92
  private protocol ErrorEventType: Event, JsonConvertible {
93
- associatedtype Code
93
+ associatedtype Code: RawRepresentable where Code.RawValue == Int
94
94
  var code: Code { get }
95
95
  var data: DeficiencyData? { get }
96
96
  var message: String { get }
@@ -100,7 +100,7 @@ extension ErrorEventType {
100
100
  func toJSON() -> [AnyHashable: Any] {
101
101
  toEventJSON {
102
102
  var json: [AnyHashable: Any] = [
103
- "code": code,
103
+ "code": code.rawValue,
104
104
  "message": message
105
105
  ]
106
106
  if let data {
@@ -370,6 +370,12 @@ extension RCTConvert {
370
370
  if let options = json["options"] as? [String: Any] {
371
371
  sourceConfig.options = RCTConvert.sourceOptions(options)
372
372
  }
373
+ if let cmcdConfigJson = json["cmcdConfig"] as? [String: Any],
374
+ let isEnabled = cmcdConfigJson["isEnabled"] as? Bool {
375
+ if #available(iOS 18, tvOS 18, visionOS 2, *) {
376
+ sourceConfig.cmcdConfig.isEnabled = isEnabled
377
+ }
378
+ }
373
379
  return sourceConfig
374
380
  }
375
381
 
@@ -28,7 +28,7 @@ Pod::Spec.new do |s|
28
28
  s.static_framework = true
29
29
 
30
30
  s.dependency 'ExpoModulesCore'
31
- s.dependency "BitmovinPlayer", "3.108.1"
31
+ s.dependency "BitmovinPlayer", "3.110.0"
32
32
  s.ios.dependency "GoogleAds-IMA-iOS-SDK", "3.26.1"
33
33
  s.tvos.dependency "GoogleAds-IMA-tvOS-SDK", "4.15.1"
34
34
 
@@ -30,6 +30,9 @@ public class RNPlayerView: ExpoView {
30
30
  if let requestedPictureInPictureValue {
31
31
  setPictureInPicture(enterPictureInPicture: requestedPictureInPictureValue)
32
32
  }
33
+ if let isPictureInPictureEnabledValue {
34
+ playerView.pictureInPicture.isEnabled = isPictureInPictureEnabledValue
35
+ }
33
36
  }
34
37
  }
35
38
 
@@ -39,6 +42,7 @@ public class RNPlayerView: ExpoView {
39
42
  private var scalingMode: ScalingMode?
40
43
  private var requestedFullscreenValue: Bool?
41
44
  private var requestedPictureInPictureValue: Bool?
45
+ private var isPictureInPictureEnabledValue: Bool?
42
46
  private var avPlayerViewControllerTransitionForced = false
43
47
 
44
48
  let onBmpEvent = EventDispatcher()
@@ -234,6 +238,11 @@ public class RNPlayerView: ExpoView {
234
238
  playerView.tweaks.hidePlaybackControlsInPictureInPicture = !actions.contains(.togglePlayback)
235
239
  #endif
236
240
  }
241
+
242
+ internal func setIsPictureInPictureEnabled(_ isEnabled: Bool) {
243
+ isPictureInPictureEnabledValue = isEnabled
244
+ playerView?.pictureInPicture.isEnabled = isEnabled
245
+ }
237
246
  }
238
247
 
239
248
  private extension RNPlayerView {
@@ -32,6 +32,9 @@ public class RNPlayerViewManager: Module {
32
32
  AsyncFunction("updatePictureInPictureActions") { (view: RNPlayerView, pictureInPictureActions: [String]) in
33
33
  view.updatePictureInPictureActions(actions: RCTConvert.pictureInPictureActions(pictureInPictureActions))
34
34
  }
35
+ AsyncFunction("setIsPictureInPictureEnabled") { (view: RNPlayerView, isEnabled: Bool) in
36
+ view.setIsPictureInPictureEnabled(isEnabled)
37
+ }
35
38
  Events(
36
39
  "onBmpEvent",
37
40
  "onBmpPlayerActive",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bitmovin-player-react-native",
3
- "version": "1.13.0",
3
+ "version": "1.15.0",
4
4
  "description": "Official React Native bindings for Bitmovin's mobile Player SDKs.",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Contains config values regarding Common Media Client Data (CMCD).
3
+ * More information about the Consumer Technology Association (CTA) Specification is available at https://cdn.cta.tech/cta/media/media/resources/standards/pdfs/cta-5004-final.pdf
4
+ *
5
+ * @platform iOS 18+, tvOS 18+
6
+ */
7
+ export interface CmcdConfig {
8
+ /**
9
+ * Enables sending Common Media Client Data (CMCD) on requests as HTTP headers.
10
+ *
11
+ * Note:
12
+ * - Common Media Client Data (CMCD) is only supported through HTTP headers.
13
+ * - By default, CMCD data is only sent on media (video and audio) requests.
14
+ * To enable them also for manifest requests, {@link TweaksConfig.isCustomHlsLoadingEnabled} needs to be disabled.
15
+ * - Only CMCD v1 is supported for now.
16
+ *
17
+ * Default is `false`.
18
+ *
19
+ * @platform iOS 18+, tvOS 18+
20
+ */
21
+ isEnabled?: boolean;
22
+ }
@@ -1,5 +1,5 @@
1
1
  import React, { RefObject, useEffect, useRef, useState } from 'react';
2
- import { StyleSheet } from 'react-native';
2
+ import { Platform, StyleSheet } from 'react-native';
3
3
  import { useKeepAwake } from 'expo-keep-awake';
4
4
  import { NativePlayerView, NativePlayerViewConfig } from './native';
5
5
  import { useProxy } from '../../hooks/useProxy';
@@ -35,6 +35,7 @@ export function PlayerView({
35
35
  scalingMode,
36
36
  isPictureInPictureRequested = false,
37
37
  pictureInPictureActions,
38
+ isPictureInPictureEnabled,
38
39
  ...props
39
40
  }: PlayerViewProps) {
40
41
  // Keep the device awake while the PlayerView is mounted
@@ -109,6 +110,18 @@ export function PlayerView({
109
110
  }
110
111
  }, [isPlayerInitialized, pictureInPictureActions]);
111
112
 
113
+ useEffect(() => {
114
+ if (
115
+ isPlayerInitialized &&
116
+ isPictureInPictureEnabled != null &&
117
+ Platform.OS === 'ios'
118
+ ) {
119
+ void nativeView.current?.setIsPictureInPictureEnabled(
120
+ isPictureInPictureEnabled
121
+ );
122
+ }
123
+ }, [isPlayerInitialized, isPictureInPictureEnabled]);
124
+
112
125
  if (!isPlayerInitialized) {
113
126
  return null;
114
127
  }
@@ -220,4 +233,9 @@ interface InternalPlayerViewRef extends RefObject<any> {
220
233
  updatePictureInPictureActions: (
221
234
  actions: PictureInPictureAction[]
222
235
  ) => Promise<void>;
236
+ /**
237
+ * Enables or disables Picture in Picture mode availability.
238
+ * Only applicable on iOS — `isPictureInPictureRequested` has no effect when disabled.
239
+ */
240
+ setIsPictureInPictureEnabled: (isEnabled: boolean) => Promise<void>;
223
241
  }
@@ -73,6 +73,16 @@ export interface BasePlayerViewProps {
73
73
  * - iOS: All actions enabled
74
74
  */
75
75
  pictureInPictureActions?: PictureInPictureAction[];
76
+
77
+ /**
78
+ * Enables or disables Picture in Picture mode availability.
79
+ * When disabled, `isPictureInPictureRequested` property has no effect.
80
+ *
81
+ * Can be changed dynamically after the player is initialized.
82
+ *
83
+ * @platform iOS, tvOS
84
+ */
85
+ isPictureInPictureEnabled?: boolean;
76
86
  }
77
87
 
78
88
  /**
package/src/index.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  export * from './adaptationConfig';
2
+ export * from './cmcdConfig';
2
3
  export * from './advertising';
3
4
  export * from './analytics';
4
5
  export * from './audioSession';
@@ -66,6 +66,13 @@ export interface PlaybackConfig {
66
66
  * ```
67
67
  */
68
68
  isBackgroundPlaybackEnabled?: boolean;
69
+ /**
70
+ * Whether to automate audio focus management, allowing the player to pause when other apps request focus.
71
+ *
72
+ * @defaultValue `false`
73
+ * @platform Android
74
+ */
75
+ handleAudioFocus?: boolean;
69
76
  /**
70
77
  * Whether the Picture in Picture mode option is enabled or not. Default is `false`.
71
78
  * @example
package/src/source.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { CmcdConfig } from './cmcdConfig';
1
2
  import { Drm, DrmConfig } from './drm';
2
3
  import NativeInstance, { NativeInstanceConfig } from './nativeInstance';
3
4
  import { SideLoadedSubtitleTrack } from './subtitleTrack';
@@ -132,6 +133,12 @@ export interface SourceConfig extends NativeInstanceConfig {
132
133
  * The `SourceMetadata` for the {@link Source} to setup custom analytics tracking
133
134
  */
134
135
  analyticsSourceMetadata?: SourceMetadata;
136
+ /**
137
+ * The CMCD (Common Media Client Data) configuration for this source.
138
+ *
139
+ * @platform iOS 18+, tvOS 18+
140
+ */
141
+ cmcdConfig?: CmcdConfig;
135
142
  }
136
143
 
137
144
  /**