bitmovin-player-react-native 1.9.0 → 1.10.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.
- package/.eslintrc.js +11 -0
- package/CHANGELOG.md +25 -0
- package/android/build.gradle +2 -2
- package/android/src/main/java/com/bitmovin/player/reactnative/RNPlayerViewManager.kt +35 -1
- package/android/src/main/java/com/bitmovin/player/reactnative/converter/JsonConverter.kt +47 -28
- package/build/advertising.d.ts +3 -3
- package/build/advertising.js.map +1 -1
- package/build/components/PlayerView/events.d.ts +7 -1
- package/build/components/PlayerView/events.d.ts.map +1 -1
- package/build/components/PlayerView/events.js.map +1 -1
- package/build/components/PlayerView/index.d.ts.map +1 -1
- package/build/components/PlayerView/index.js +3 -3
- package/build/components/PlayerView/index.js.map +1 -1
- package/build/components/PlayerView/nativeEvents.d.ts +9 -1
- package/build/components/PlayerView/nativeEvents.d.ts.map +1 -1
- package/build/components/PlayerView/nativeEvents.js.map +1 -1
- package/build/drm/fairplayDrmApi.d.ts +21 -0
- package/build/drm/fairplayDrmApi.d.ts.map +1 -0
- package/build/drm/fairplayDrmApi.js +30 -0
- package/build/drm/fairplayDrmApi.js.map +1 -0
- package/build/drm/index.d.ts +9 -1
- package/build/drm/index.d.ts.map +1 -1
- package/build/drm/index.js +13 -0
- package/build/drm/index.js.map +1 -1
- package/build/events.d.ts +37 -3
- package/build/events.d.ts.map +1 -1
- package/build/events.js.map +1 -1
- package/build/metadata.d.ts.map +1 -1
- package/build/metadata.js.map +1 -1
- package/build/modules/SourceModule.d.ts +6 -0
- package/build/modules/SourceModule.d.ts.map +1 -1
- package/build/modules/SourceModule.js.map +1 -1
- package/build/network/index.js +4 -12
- package/build/network/index.js.map +1 -1
- package/build/offline/offlineContentManager.js +1 -1
- package/build/offline/offlineContentManager.js.map +1 -1
- package/build/offline/offlineContentManagerListener.d.ts.map +1 -1
- package/build/offline/offlineContentManagerListener.js.map +1 -1
- package/build/player.js +24 -24
- package/build/player.js.map +1 -1
- package/build/source.d.ts +6 -3
- package/build/source.d.ts.map +1 -1
- package/build/source.js +8 -5
- package/build/source.js.map +1 -1
- package/build/tweaksConfig.d.ts +8 -0
- package/build/tweaksConfig.d.ts.map +1 -1
- package/build/tweaksConfig.js.map +1 -1
- package/build/ui/custommessagehandlerbridge.d.ts.map +1 -1
- package/build/ui/custommessagehandlerbridge.js +4 -4
- package/build/ui/custommessagehandlerbridge.js.map +1 -1
- package/build/ui/fullscreenhandlerbridge.js +5 -5
- package/build/ui/fullscreenhandlerbridge.js.map +1 -1
- package/ios/Event+JSON.swift +20 -1
- package/ios/FairplayContentKeyRequestRegistry.swift +39 -0
- package/ios/NetworkModule.swift +1 -0
- package/ios/PlayerModule.swift +3 -3
- package/ios/RCTConvert+BitmovinPlayer.swift +1 -0
- package/ios/RNBitmovinPlayer.podspec +1 -1
- package/ios/RNPlayerView.swift +5 -0
- package/ios/RNPlayerViewManager.swift +2 -1
- package/ios/SourceModule.swift +24 -0
- package/package.json +2 -2
- package/src/advertising.ts +3 -3
- package/src/components/PlayerView/events.ts +7 -0
- package/src/components/PlayerView/index.tsx +3 -2
- package/src/components/PlayerView/nativeEvents.ts +9 -0
- package/src/drm/fairplayDrmApi.ts +36 -0
- package/src/drm/index.ts +14 -2
- package/src/events.ts +40 -3
- package/src/metadata.ts +2 -4
- package/src/modules/SourceModule.ts +10 -0
- package/src/network/index.ts +12 -12
- package/src/offline/offlineContentManager.ts +1 -1
- package/src/offline/offlineContentManagerListener.ts +3 -6
- package/src/player.ts +24 -24
- package/src/source.ts +9 -6
- package/src/tweaksConfig.ts +8 -0
- package/src/ui/custommessagehandlerbridge.ts +7 -4
- package/src/ui/fullscreenhandlerbridge.ts +5 -5
package/build/player.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"player.js","sourceRoot":"","sources":["../src/player.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,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AAC,QAAQ,EAAE,SAAS,CAAC,CAAC;IACzD,CAAC,CAAC;IAEF;;;;;;;;;;;;;;;OAeG;IACH,gBAAgB,GAAG,CAAC,aAAqB,EAAE,EAAE;QAC3C,YAAY,CAAC,gBAAgB,CAAC,IAAI,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC;IAC9D,CAAC,CAAC;IAEF;;;OAGG;IACH,gBAAgB,GAAG,KAAK,IAAqB,EAAE;QAC7C,OAAO,CAAC,MAAM,YAAY,CAAC,gBAAgB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC;IACnE,CAAC,CAAC;IAEF;;;;;OAKG;IACH,sBAAsB,GAAG,KAAK,EAC5B,aAAqB,EACS,EAAE;QAChC,IAAI,QAAQ,CAAC,EAAE,KAAK,SAAS,EAAE,CAAC;YAC9B,OAAO,CAAC,IAAI,CACV,WAAW,IAAI,CAAC,QAAQ,0FAA0F,CACnH,CAAC;YACF,OAAO,SAAS,CAAC;QACnB,CAAC;QACD,OAAO,CACL,CAAC,MAAM,YAAY,CAAC,sBAAsB,CACxC,IAAI,CAAC,QAAQ,EACb,aAAa,CACd,CAAC,IAAI,KAAK,CACZ,CAAC;IACJ,CAAC,CAAC;IAEM,sBAAsB,GAAG,GAAG,EAAE;QACpC,IAAI,IAAI,CAAC,MAAM,EAAE,cAAc,EAAE,aAAa,IAAI,IAAI,EAAE,CAAC;YACvD,OAAO;QACT,CAAC;QACD,IAAI,QAAQ,CAAC,EAAE,KAAK,KAAK,EAAE,CAAC;YAC1B,OAAO;QACT,CAAC;QAED,IAAI,CAAC,aAAa,GAAG,IAAI,mBAAmB,CAC1C,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,aAAa,CACzC,CAAC;QACF,IAAI,CAAC,aAAa,CAAC,UAAU,EAAE,CAAC;IAClC,CAAC,CAAC;CACH","sourcesContent":["import { EventSubscription } from 'expo-modules-core';\nimport { Platform } from 'react-native';\nimport PlayerModule from './modules/PlayerModule';\nimport NativeInstance from './nativeInstance';\nimport { Source, SourceConfig } from './source';\nimport { AudioTrack } from './audioTrack';\nimport { SubtitleTrack } from './subtitleTrack';\nimport { OfflineContentManager, OfflineSourceOptions } from './offline';\nimport { Thumbnail } from './thumbnail';\nimport { AnalyticsApi } from './analytics/player';\nimport { PlayerConfig } from './playerConfig';\nimport { AdItem, ImaSettings } from './advertising';\nimport { BufferApi } from './bufferApi';\nimport { VideoQuality } from './media';\nimport { Network } from './network';\nimport { DecoderConfigBridge } from './decoder';\n\n/**\n * Loads, controls and renders audio and video content represented through {@link Source}s. A player\n * instance can be created via the {@link usePlayer} hook and will idle until one or more {@link Source}s are\n * loaded. Once {@link Player.load} or {@link Player.loadSource} is called, the player becomes active and initiates necessary downloads to\n * start playback of the loaded source(s).\n *\n * Can be attached to {@link PlayerView} component in order to use Bitmovin's Player Web UI.\n * @see PlayerView\n */\nexport class Player extends NativeInstance<PlayerConfig> {\n /**\n * Whether the native `Player` object has been created.\n */\n isInitialized = false;\n /**\n * Whether the native `Player` object has been disposed.\n */\n isDestroyed = false;\n /**\n * Currently active source, or `null` if none is active.\n */\n source?: Source;\n /**\n * The `AnalyticsApi` for interactions regarding the `Player`'s analytics.\n *\n * `undefined` if the player was created without analytics support.\n */\n analytics?: AnalyticsApi = undefined;\n /**\n * The {@link BufferApi} for interactions regarding the buffer.\n */\n buffer: BufferApi = new BufferApi(this.nativeId);\n\n private network?: Network;\n\n private decoderConfig?: DecoderConfigBridge;\n private onImaBeforeInitializationSubscription?: EventSubscription;\n /**\n * Allocates the native `Player` instance and its resources natively.\n */\n initialize = async (): Promise<void> => {\n if (!this.isInitialized) {\n this.ensureImaBeforeInitializationListener();\n if (this.config?.networkConfig) {\n this.network = new Network(this.config.networkConfig);\n await this.network.initialize();\n }\n await this.maybeInitDecoderConfig();\n const analyticsConfig = this.config?.analyticsConfig;\n if (analyticsConfig) {\n await PlayerModule.initializeWithAnalyticsConfig(\n this.nativeId,\n analyticsConfig,\n this.config,\n this.network?.nativeId,\n this.decoderConfig?.nativeId\n );\n this.analytics = new AnalyticsApi(this.nativeId);\n } else {\n await PlayerModule.initializeWithConfig(\n this.nativeId,\n this.config,\n this.network?.nativeId,\n this.decoderConfig?.nativeId\n );\n }\n\n this.isInitialized = true;\n }\n return Promise.resolve();\n };\n\n /**\n * Destroys the native `Player` and releases all of its allocated resources.\n */\n destroy = () => {\n if (!this.isDestroyed) {\n PlayerModule.destroy(this.nativeId);\n this.source?.destroy();\n this.network?.destroy();\n this.decoderConfig?.destroy();\n this.onImaBeforeInitializationSubscription?.remove();\n this.onImaBeforeInitializationSubscription = undefined;\n this.isDestroyed = true;\n }\n };\n\n /**\n * Loads a new {@link Source} from `sourceConfig` into the player.\n */\n load = (sourceConfig: SourceConfig) => {\n this.loadSource(new Source(sourceConfig));\n };\n\n /**\n * Loads the downloaded content from {@link OfflineContentManager} into the player.\n */\n loadOfflineContent = (\n offlineContentManager: OfflineContentManager,\n options?: OfflineSourceOptions\n ) => {\n PlayerModule.loadOfflineContent(\n this.nativeId,\n offlineContentManager.nativeId,\n options\n );\n };\n\n /**\n * Loads the given {@link Source} into the player.\n */\n loadSource = (source: Source) => {\n this.source = source;\n source.initialize().then(() => {\n PlayerModule.loadSource(this.nativeId, source.nativeId);\n });\n };\n\n /**\n * Unloads all {@link Source}s from the player.\n */\n unload = () => {\n PlayerModule.unload(this.nativeId);\n };\n\n /**\n * Starts or resumes playback after being paused. Has no effect if the player is already playing.\n */\n play = () => {\n PlayerModule.play(this.nativeId);\n };\n\n /**\n * Pauses the video if it is playing. Has no effect if the player is already paused.\n */\n pause = () => {\n PlayerModule.pause(this.nativeId);\n };\n\n /**\n * Seeks to the given playback time specified by the parameter `time` in seconds. Must not be\n * greater than the total duration of the video. Has no effect when watching a live stream since\n * seeking is not possible.\n *\n * @param time - The time to seek to in seconds.\n */\n seek = (time: number) => {\n PlayerModule.seek(this.nativeId, time);\n };\n\n /**\n * Shifts the time to the given `offset` in seconds from the live edge. The resulting offset has to be within the\n * timeShift window as specified by `maxTimeShift` (which is a negative value) and 0. When the provided `offset` is\n * positive, it will be interpreted as a UNIX timestamp in seconds and converted to fit into the timeShift window.\n * When the provided `offset` is negative, but lower than `maxTimeShift`, then it will be clamped to `maxTimeShift`.\n * Has no effect for VoD.\n *\n * Has no effect if no sources are loaded.\n *\n * @param offset - Target offset from the live edge in seconds.\n */\n timeShift = (offset: number) => {\n PlayerModule.timeShift(this.nativeId, offset);\n };\n\n /**\n * Mutes the player if an audio track is available. Has no effect if the player is already muted.\n */\n mute = () => {\n PlayerModule.mute(this.nativeId);\n };\n\n /**\n * Unmutes the player if it is muted. Has no effect if the player is already unmuted.\n */\n unmute = () => {\n PlayerModule.unmute(this.nativeId);\n };\n\n /**\n * Sets the player's volume between 0 (silent) and 100 (max volume).\n *\n * @param volume - The volume level to set.\n */\n setVolume = (volume: number) => {\n PlayerModule.setVolume(this.nativeId, volume);\n };\n\n private ensureImaBeforeInitializationListener = () => {\n const callback = this.config?.advertisingConfig?.ima?.beforeInitialization;\n if (!callback) {\n return;\n }\n if (this.onImaBeforeInitializationSubscription) {\n return;\n }\n this.onImaBeforeInitializationSubscription = PlayerModule.addListener(\n 'onImaBeforeInitialization',\n ({ nativeId, id, settings }) => {\n if (nativeId !== this.nativeId) {\n return;\n }\n const cloned: ImaSettings = { ...settings };\n let prepared = cloned;\n try {\n const result = callback(cloned);\n prepared =\n result && typeof result === 'object'\n ? { ...cloned, ...result }\n : cloned;\n } catch {\n prepared = cloned;\n }\n PlayerModule.setPreparedImaSettings(id, prepared);\n }\n );\n };\n\n /**\n * @returns The player's current volume level.\n */\n getVolume = async (): Promise<number> => {\n return (await PlayerModule.getVolume(this.nativeId)) ?? 0;\n };\n\n /**\n * @returns The current playback time in seconds.\n *\n * For VoD streams the returned time ranges between 0 and the duration of the asset.\n *\n * For live streams it can be specified if an absolute UNIX timestamp or a value\n * relative to the playback start should be returned.\n *\n * @param mode - The time mode to specify: an absolute UNIX timestamp ('absolute') or relative time ('relative').\n */\n getCurrentTime = async (\n mode: 'relative' | 'absolute' = 'absolute'\n ): Promise<number> => {\n return (await PlayerModule.currentTime(this.nativeId, mode)) ?? 0;\n };\n\n /**\n * @returns The total duration in seconds of the current video or INFINITY if it’s a live stream.\n */\n getDuration = async (): Promise<number> => {\n return (await PlayerModule.duration(this.nativeId)) ?? 0;\n };\n\n /**\n * @returns `true` if the player is muted.\n */\n isMuted = async (): Promise<boolean> => {\n return (await PlayerModule.isMuted(this.nativeId)) ?? false;\n };\n\n /**\n * @returns `true` if the player is currently playing, i.e. has started and is not paused.\n */\n isPlaying = async (): Promise<boolean> => {\n return (await PlayerModule.isPlaying(this.nativeId)) ?? false;\n };\n\n /**\n * @returns `true` if the player has started playback but it's currently paused.\n */\n isPaused = async (): Promise<boolean> => {\n return (await PlayerModule.isPaused(this.nativeId)) ?? false;\n };\n\n /**\n * @returns `true` if the displayed video is a live stream.\n */\n isLive = async (): Promise<boolean> => {\n return (await PlayerModule.isLive(this.nativeId)) ?? false;\n };\n\n /**\n * @platform iOS\n * @returns `true` when media is played externally using AirPlay.\n */\n isAirPlayActive = async (): Promise<boolean> => {\n if (Platform.OS === 'android') {\n console.warn(\n `[Player ${this.nativeId}] Method isAirPlayActive is not available for Android. Only iOS devices.`\n );\n return false;\n }\n return (await PlayerModule.isAirPlayActive(this.nativeId)) ?? false;\n };\n\n /**\n * @platform iOS\n * @returns `true` when AirPlay is available.\n */\n isAirPlayAvailable = async (): Promise<boolean> => {\n if (Platform.OS === 'android') {\n console.warn(\n `[Player ${this.nativeId}] Method isAirPlayAvailable is not available for Android. Only iOS devices.`\n );\n return false;\n }\n return (await PlayerModule.isAirPlayAvailable(this.nativeId)) ?? false;\n };\n\n /**\n * @returns The currently selected audio track or `null`.\n */\n getAudioTrack = async (): Promise<AudioTrack | null> => {\n return PlayerModule.getAudioTrack(this.nativeId);\n };\n\n /**\n * @returns An array containing {@link AudioTrack} objects for all available audio tracks.\n */\n getAvailableAudioTracks = async (): Promise<AudioTrack[]> => {\n return PlayerModule.getAvailableAudioTracks(this.nativeId);\n };\n\n /**\n * Sets the audio track to the ID specified by trackIdentifier. A list can be retrieved by calling getAvailableAudioTracks.\n *\n * @param trackIdentifier - The {@link AudioTrack.identifier} to be set.\n */\n setAudioTrack = async (trackIdentifier: string): Promise<void> => {\n return PlayerModule.setAudioTrack(this.nativeId, trackIdentifier);\n };\n\n /**\n * @returns The currently selected {@link SubtitleTrack} or `null`.\n */\n getSubtitleTrack = async (): Promise<SubtitleTrack | null> => {\n return PlayerModule.getSubtitleTrack(this.nativeId);\n };\n\n /**\n * @returns An array containing SubtitleTrack objects for all available subtitle tracks.\n */\n getAvailableSubtitles = async (): Promise<SubtitleTrack[]> => {\n return PlayerModule.getAvailableSubtitles(this.nativeId);\n };\n\n /**\n * Sets the subtitle track to the ID specified by trackIdentifier. A list can be retrieved by calling getAvailableSubtitles.\n * Pass `undefined` to disable subtitles.\n *\n * @param trackIdentifier - The {@link SubtitleTrack.identifier} to be set.\n */\n setSubtitleTrack = async (\n trackIdentifier: string | undefined\n ): Promise<void> => {\n return PlayerModule.setSubtitleTrack(\n this.nativeId,\n trackIdentifier ?? null\n );\n };\n\n /**\n * Dynamically schedules the {@link AdItem} for playback.\n * Has no effect if there is no active playback session.\n *\n * @param adItem - Ad to be scheduled for playback.\n *\n * @platform iOS, Android\n */\n scheduleAd = (adItem: AdItem) => {\n PlayerModule.scheduleAd(this.nativeId, adItem);\n };\n\n /**\n * Skips the current ad.\n * Has no effect if the current ad is not skippable or if no ad is being played back.\n *\n * @platform iOS, Android\n */\n skipAd = () => {\n PlayerModule.skipAd(this.nativeId);\n };\n\n /**\n * @returns `true` while an ad is being played back or when main content playback has been paused for ad playback.\n * @platform iOS, Android\n */\n isAd = async (): Promise<boolean> => {\n return (await PlayerModule.isAd(this.nativeId)) ?? false;\n };\n\n /**\n * The current time shift of the live stream in seconds. This value is always 0 if the active {@link Source} is not a\n * live stream or no sources are loaded.\n */\n getTimeShift = async (): Promise<number> => {\n return (await PlayerModule.getTimeShift(this.nativeId)) ?? 0;\n };\n\n /**\n * The limit in seconds for time shifting. This value is either negative or 0 and it is always 0 if the active\n * {@link Source} is not a live stream or no sources are loaded.\n */\n getMaxTimeShift = async (): Promise<number> => {\n return (await PlayerModule.getMaxTimeShift(this.nativeId)) ?? 0;\n };\n\n /**\n * Sets the upper bitrate boundary for video qualities. All qualities with a bitrate\n * that is higher than this threshold will not be eligible for automatic quality selection.\n *\n * Can be set to `null` for no limitation.\n */\n setMaxSelectableBitrate = (bitrate: number | null) => {\n PlayerModule.setMaxSelectableBitrate(this.nativeId, bitrate || -1);\n };\n\n /**\n * @returns a {@link Thumbnail} for the specified playback time for the currently active source 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 PlayerModule.getThumbnail(this.nativeId, time);\n };\n\n /**\n * Whether casting to a cast-compatible remote device is available. {@link CastAvailableEvent} signals when\n * casting becomes available.\n *\n * @platform iOS, Android\n */\n isCastAvailable = async (): Promise<boolean> => {\n return (await PlayerModule.isCastAvailable(this.nativeId)) ?? false;\n };\n\n /**\n * Whether video is currently being casted to a remote device and not played locally.\n *\n * @platform iOS, Android\n */\n isCasting = async (): Promise<boolean> => {\n return (await PlayerModule.isCasting(this.nativeId)) ?? false;\n };\n\n /**\n * Initiates casting the current video to a cast-compatible remote device. The user has to choose to which device it\n * should be sent.\n *\n * @platform iOS, Android\n */\n castVideo = () => {\n PlayerModule.castVideo(this.nativeId);\n };\n\n /**\n * Stops casting the current video. Has no effect if {@link Player.isCasting} is `false`.\n *\n * @platform iOS, Android\n */\n castStop = () => {\n PlayerModule.castStop(this.nativeId);\n };\n\n /**\n * Returns the currently selected video quality.\n * @returns The currently selected video quality.\n */\n getVideoQuality = async (): Promise<VideoQuality> => {\n return PlayerModule.getVideoQuality(this.nativeId);\n };\n\n /**\n * Returns an array containing all available video qualities the player can adapt between.\n * @returns An array containing all available video qualities the player can adapt between.\n */\n getAvailableVideoQualities = async (): Promise<VideoQuality[]> => {\n return PlayerModule.getAvailableVideoQualities(this.nativeId);\n };\n\n /**\n * Sets the video quality.\n * @platform Android\n *\n * @param qualityId value obtained from {@link VideoQuality}'s `id` property, which can be obtained via `Player.getAvailableVideoQualities()` to select a specific quality. To use automatic quality selection, 'auto' can be passed here.\n */\n setVideoQuality = (qualityId: string) => {\n if (Platform.OS !== 'android') {\n console.warn(\n `[Player ${this.nativeId}] Method setVideoQuality is not available for iOS and tvOS devices. Only Android devices.`\n );\n return;\n }\n PlayerModule.setVideoQuality(this.nativeId, qualityId);\n };\n\n /**\n * Sets the playback speed of the player. Fast forward, slow motion and reverse playback are supported.\n * @remarks\n * Platform: iOS, tvOS\n *\n * - Slow motion is indicated by values between `0` and `1`.\n * - Fast forward by values greater than `1`.\n * - Slow reverse is used by values between `0` and `-1`, and fast reverse is used by values less than `-1`. iOS and tvOS only.\n * - Negative values are ignored during Casting and on Android.\n * - During reverse playback the playback will continue until the beginning of the active source is\n * reached. When reaching the beginning of the source, playback will be paused and the playback\n * speed will be reset to its default value of `1`. No {@link PlaybackFinishedEvent} will be\n * emitted in this case.\n *\n * @param playbackSpeed - The playback speed to set.\n */\n setPlaybackSpeed = (playbackSpeed: number) => {\n PlayerModule.setPlaybackSpeed(this.nativeId, playbackSpeed);\n };\n\n /**\n * @see {@link setPlaybackSpeed} for details on which values playback speed can assume.\n * @returns The player's current playback speed.\n */\n getPlaybackSpeed = async (): Promise<number> => {\n return (await PlayerModule.getPlaybackSpeed(this.nativeId)) ?? 0;\n };\n\n /**\n * Checks the possibility to play the media at specified playback speed.\n * @param playbackSpeed - The playback speed to check.\n * @returns `true` if it's possible to play the media at the specified playback speed, otherwise `false`. On Android it always returns `undefined`.\n * @platform iOS, tvOS\n */\n canPlayAtPlaybackSpeed = async (\n playbackSpeed: number\n ): Promise<boolean | undefined> => {\n if (Platform.OS === 'android') {\n console.warn(\n `[Player ${this.nativeId}] Method canPlayAtPlaybackSpeed is not available for Android. Only iOS and tvOS devices.`\n );\n return undefined;\n }\n return (\n (await PlayerModule.canPlayAtPlaybackSpeed(\n this.nativeId,\n playbackSpeed\n )) ?? false\n );\n };\n\n private maybeInitDecoderConfig = () => {\n if (this.config?.playbackConfig?.decoderConfig == null) {\n return;\n }\n if (Platform.OS === 'ios') {\n return;\n }\n\n this.decoderConfig = new DecoderConfigBridge(\n this.config.playbackConfig.decoderConfig\n );\n this.decoderConfig.initialize();\n };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"player.js","sourceRoot":"","sources":["../src/player.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,YAAY,MAAM,wBAAwB,CAAC;AAClD,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAgB,MAAM,UAAU,CAAC;AAKhD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAGlD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAEhD;;;;;;;;GAQG;AACH,MAAM,OAAO,MAAO,SAAQ,cAA4B;IACtD;;OAEG;IACH,aAAa,GAAG,KAAK,CAAC;IACtB;;OAEG;IACH,WAAW,GAAG,KAAK,CAAC;IACpB;;OAEG;IACH,MAAM,CAAU;IAChB;;;;OAIG;IACH,SAAS,GAAkB,SAAS,CAAC;IACrC;;OAEG;IACH,MAAM,GAAc,IAAI,SAAS,CAAC,IAAI,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,QAAQ,CAAC,EAAE,KAAK,SAAS,EAAE,CAAC;YAC9B,OAAO,CAAC,IAAI,CACV,WAAW,IAAI,CAAC,QAAQ,0FAA0F,CACnH,CAAC;YACF,OAAO,SAAS,CAAC;QACnB,CAAC;QACD,OAAO,CACL,CAAC,MAAM,YAAY,CAAC,sBAAsB,CACxC,IAAI,CAAC,QAAQ,EACb,aAAa,CACd,CAAC,IAAI,KAAK,CACZ,CAAC;IACJ,CAAC,CAAC;IAEM,sBAAsB,GAAG,GAAG,EAAE;QACpC,IAAI,IAAI,CAAC,MAAM,EAAE,cAAc,EAAE,aAAa,IAAI,IAAI,EAAE,CAAC;YACvD,OAAO;QACT,CAAC;QACD,IAAI,QAAQ,CAAC,EAAE,KAAK,KAAK,EAAE,CAAC;YAC1B,OAAO;QACT,CAAC;QAED,IAAI,CAAC,aAAa,GAAG,IAAI,mBAAmB,CAC1C,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,aAAa,CACzC,CAAC;QACF,IAAI,CAAC,aAAa,CAAC,UAAU,EAAE,CAAC;IAClC,CAAC,CAAC;CACH","sourcesContent":["import { EventSubscription } from 'expo-modules-core';\nimport { Platform } from 'react-native';\nimport PlayerModule from './modules/PlayerModule';\nimport NativeInstance from './nativeInstance';\nimport { Source, SourceConfig } from './source';\nimport { AudioTrack } from './audioTrack';\nimport { SubtitleTrack } from './subtitleTrack';\nimport { OfflineContentManager, OfflineSourceOptions } from './offline';\nimport { Thumbnail } from './thumbnail';\nimport { AnalyticsApi } from './analytics/player';\nimport { PlayerConfig } from './playerConfig';\nimport { AdItem, ImaSettings } from './advertising';\nimport { BufferApi } from './bufferApi';\nimport { VideoQuality } from './media';\nimport { Network } from './network';\nimport { DecoderConfigBridge } from './decoder';\n\n/**\n * Loads, controls and renders audio and video content represented through {@link Source}s. A player\n * instance can be created via the {@link usePlayer} hook and will idle until one or more {@link Source}s are\n * loaded. Once {@link Player.load} or {@link Player.loadSource} is called, the player becomes active and initiates necessary downloads to\n * start playback of the loaded source(s).\n *\n * Can be attached to {@link PlayerView} component in order to use Bitmovin's Player Web UI.\n * @see PlayerView\n */\nexport class Player extends NativeInstance<PlayerConfig> {\n /**\n * Whether the native `Player` object has been created.\n */\n isInitialized = false;\n /**\n * Whether the native `Player` object has been disposed.\n */\n isDestroyed = false;\n /**\n * Currently active source, or `null` if none is active.\n */\n source?: Source;\n /**\n * The `AnalyticsApi` for interactions regarding the `Player`'s analytics.\n *\n * `undefined` if the player was created without analytics support.\n */\n analytics?: AnalyticsApi = undefined;\n /**\n * The {@link BufferApi} for interactions regarding the buffer.\n */\n buffer: BufferApi = new BufferApi(this.nativeId);\n\n private network?: Network;\n\n private decoderConfig?: DecoderConfigBridge;\n private onImaBeforeInitializationSubscription?: EventSubscription;\n /**\n * Allocates the native `Player` instance and its resources natively.\n */\n initialize = async (): Promise<void> => {\n if (!this.isInitialized) {\n this.ensureImaBeforeInitializationListener();\n if (this.config?.networkConfig) {\n this.network = new Network(this.config.networkConfig);\n await this.network.initialize();\n }\n await this.maybeInitDecoderConfig();\n const analyticsConfig = this.config?.analyticsConfig;\n if (analyticsConfig) {\n await PlayerModule.initializeWithAnalyticsConfig(\n this.nativeId,\n analyticsConfig,\n this.config,\n this.network?.nativeId,\n this.decoderConfig?.nativeId\n );\n this.analytics = new AnalyticsApi(this.nativeId);\n } else {\n await PlayerModule.initializeWithConfig(\n this.nativeId,\n this.config,\n this.network?.nativeId,\n this.decoderConfig?.nativeId\n );\n }\n\n this.isInitialized = true;\n }\n return Promise.resolve();\n };\n\n /**\n * Destroys the native `Player` and releases all of its allocated resources.\n */\n destroy = () => {\n if (!this.isDestroyed) {\n void PlayerModule.destroy(this.nativeId);\n void this.source?.destroy();\n void this.network?.destroy();\n void this.decoderConfig?.destroy();\n this.onImaBeforeInitializationSubscription?.remove();\n this.onImaBeforeInitializationSubscription = undefined;\n this.isDestroyed = true;\n }\n };\n\n /**\n * Loads a new {@link Source} from `sourceConfig` into the player.\n */\n load = (sourceConfig: SourceConfig) => {\n this.loadSource(new Source(sourceConfig));\n };\n\n /**\n * Loads the downloaded content from {@link OfflineContentManager} into the player.\n */\n loadOfflineContent = (\n offlineContentManager: OfflineContentManager,\n options?: OfflineSourceOptions\n ) => {\n void PlayerModule.loadOfflineContent(\n this.nativeId,\n offlineContentManager.nativeId,\n options\n );\n };\n\n /**\n * Loads the given {@link Source} into the player.\n */\n loadSource = (source: Source) => {\n this.source = source;\n void source\n .initialize()\n .then(() => PlayerModule.loadSource(this.nativeId, source.nativeId));\n };\n\n /**\n * Unloads all {@link Source}s from the player.\n */\n unload = () => {\n void PlayerModule.unload(this.nativeId);\n };\n\n /**\n * Starts or resumes playback after being paused. Has no effect if the player is already playing.\n */\n play = () => {\n void PlayerModule.play(this.nativeId);\n };\n\n /**\n * Pauses the video if it is playing. Has no effect if the player is already paused.\n */\n pause = () => {\n void PlayerModule.pause(this.nativeId);\n };\n\n /**\n * Seeks to the given playback time specified by the parameter `time` in seconds. Must not be\n * greater than the total duration of the video. Has no effect when watching a live stream since\n * seeking is not possible.\n *\n * @param time - The time to seek to in seconds.\n */\n seek = (time: number) => {\n void PlayerModule.seek(this.nativeId, time);\n };\n\n /**\n * Shifts the time to the given `offset` in seconds from the live edge. The resulting offset has to be within the\n * timeShift window as specified by `maxTimeShift` (which is a negative value) and 0. When the provided `offset` is\n * positive, it will be interpreted as a UNIX timestamp in seconds and converted to fit into the timeShift window.\n * When the provided `offset` is negative, but lower than `maxTimeShift`, then it will be clamped to `maxTimeShift`.\n * Has no effect for VoD.\n *\n * Has no effect if no sources are loaded.\n *\n * @param offset - Target offset from the live edge in seconds.\n */\n timeShift = (offset: number) => {\n void PlayerModule.timeShift(this.nativeId, offset);\n };\n\n /**\n * Mutes the player if an audio track is available. Has no effect if the player is already muted.\n */\n mute = () => {\n void PlayerModule.mute(this.nativeId);\n };\n\n /**\n * Unmutes the player if it is muted. Has no effect if the player is already unmuted.\n */\n unmute = () => {\n void PlayerModule.unmute(this.nativeId);\n };\n\n /**\n * Sets the player's volume between 0 (silent) and 100 (max volume).\n *\n * @param volume - The volume level to set.\n */\n setVolume = (volume: number) => {\n void PlayerModule.setVolume(this.nativeId, volume);\n };\n\n private ensureImaBeforeInitializationListener = () => {\n const callback = this.config?.advertisingConfig?.ima?.beforeInitialization;\n if (!callback) {\n return;\n }\n if (this.onImaBeforeInitializationSubscription) {\n return;\n }\n this.onImaBeforeInitializationSubscription = PlayerModule.addListener(\n 'onImaBeforeInitialization',\n ({ nativeId, id, settings }) => {\n if (nativeId !== this.nativeId) {\n return;\n }\n const cloned: ImaSettings = { ...settings };\n let prepared = cloned;\n try {\n const result = callback(cloned);\n prepared =\n result && typeof result === 'object'\n ? { ...cloned, ...result }\n : cloned;\n } catch {\n prepared = cloned;\n }\n void PlayerModule.setPreparedImaSettings(id, prepared);\n }\n );\n };\n\n /**\n * @returns The player's current volume level.\n */\n getVolume = async (): Promise<number> => {\n return (await PlayerModule.getVolume(this.nativeId)) ?? 0;\n };\n\n /**\n * @returns The current playback time in seconds.\n *\n * For VoD streams the returned time ranges between 0 and the duration of the asset.\n *\n * For live streams it can be specified if an absolute UNIX timestamp or a value\n * relative to the playback start should be returned.\n *\n * @param mode - The time mode to specify: an absolute UNIX timestamp ('absolute') or relative time ('relative').\n */\n getCurrentTime = async (\n mode: 'relative' | 'absolute' = 'absolute'\n ): Promise<number> => {\n return (await PlayerModule.currentTime(this.nativeId, mode)) ?? 0;\n };\n\n /**\n * @returns The total duration in seconds of the current video or INFINITY if it’s a live stream.\n */\n getDuration = async (): Promise<number> => {\n return (await PlayerModule.duration(this.nativeId)) ?? 0;\n };\n\n /**\n * @returns `true` if the player is muted.\n */\n isMuted = async (): Promise<boolean> => {\n return (await PlayerModule.isMuted(this.nativeId)) ?? false;\n };\n\n /**\n * @returns `true` if the player is currently playing, i.e. has started and is not paused.\n */\n isPlaying = async (): Promise<boolean> => {\n return (await PlayerModule.isPlaying(this.nativeId)) ?? false;\n };\n\n /**\n * @returns `true` if the player has started playback but it's currently paused.\n */\n isPaused = async (): Promise<boolean> => {\n return (await PlayerModule.isPaused(this.nativeId)) ?? false;\n };\n\n /**\n * @returns `true` if the displayed video is a live stream.\n */\n isLive = async (): Promise<boolean> => {\n return (await PlayerModule.isLive(this.nativeId)) ?? false;\n };\n\n /**\n * @platform iOS\n * @returns `true` when media is played externally using AirPlay.\n */\n isAirPlayActive = async (): Promise<boolean> => {\n if (Platform.OS === 'android') {\n console.warn(\n `[Player ${this.nativeId}] Method isAirPlayActive is not available for Android. Only iOS devices.`\n );\n return false;\n }\n return (await PlayerModule.isAirPlayActive(this.nativeId)) ?? false;\n };\n\n /**\n * @platform iOS\n * @returns `true` when AirPlay is available.\n */\n isAirPlayAvailable = async (): Promise<boolean> => {\n if (Platform.OS === 'android') {\n console.warn(\n `[Player ${this.nativeId}] Method isAirPlayAvailable is not available for Android. Only iOS devices.`\n );\n return false;\n }\n return (await PlayerModule.isAirPlayAvailable(this.nativeId)) ?? false;\n };\n\n /**\n * @returns The currently selected audio track or `null`.\n */\n getAudioTrack = async (): Promise<AudioTrack | null> => {\n return PlayerModule.getAudioTrack(this.nativeId);\n };\n\n /**\n * @returns An array containing {@link AudioTrack} objects for all available audio tracks.\n */\n getAvailableAudioTracks = async (): Promise<AudioTrack[]> => {\n return PlayerModule.getAvailableAudioTracks(this.nativeId);\n };\n\n /**\n * Sets the audio track to the ID specified by trackIdentifier. A list can be retrieved by calling getAvailableAudioTracks.\n *\n * @param trackIdentifier - The {@link AudioTrack.identifier} to be set.\n */\n setAudioTrack = async (trackIdentifier: string): Promise<void> => {\n return PlayerModule.setAudioTrack(this.nativeId, trackIdentifier);\n };\n\n /**\n * @returns The currently selected {@link SubtitleTrack} or `null`.\n */\n getSubtitleTrack = async (): Promise<SubtitleTrack | null> => {\n return PlayerModule.getSubtitleTrack(this.nativeId);\n };\n\n /**\n * @returns An array containing SubtitleTrack objects for all available subtitle tracks.\n */\n getAvailableSubtitles = async (): Promise<SubtitleTrack[]> => {\n return PlayerModule.getAvailableSubtitles(this.nativeId);\n };\n\n /**\n * Sets the subtitle track to the ID specified by trackIdentifier. A list can be retrieved by calling getAvailableSubtitles.\n * Pass `undefined` to disable subtitles.\n *\n * @param trackIdentifier - The {@link SubtitleTrack.identifier} to be set.\n */\n setSubtitleTrack = async (\n trackIdentifier: string | undefined\n ): Promise<void> => {\n return PlayerModule.setSubtitleTrack(\n this.nativeId,\n trackIdentifier ?? null\n );\n };\n\n /**\n * Dynamically schedules the {@link AdItem} for playback.\n * Has no effect if there is no active playback session.\n *\n * @param adItem - Ad to be scheduled for playback.\n *\n * @platform iOS, Android\n */\n scheduleAd = (adItem: AdItem) => {\n void PlayerModule.scheduleAd(this.nativeId, adItem);\n };\n\n /**\n * Skips the current ad.\n * Has no effect if the current ad is not skippable or if no ad is being played back.\n *\n * @platform iOS, Android\n */\n skipAd = () => {\n void PlayerModule.skipAd(this.nativeId);\n };\n\n /**\n * @returns `true` while an ad is being played back or when main content playback has been paused for ad playback.\n * @platform iOS, Android\n */\n isAd = async (): Promise<boolean> => {\n return (await PlayerModule.isAd(this.nativeId)) ?? false;\n };\n\n /**\n * The current time shift of the live stream in seconds. This value is always 0 if the active {@link Source} is not a\n * live stream or no sources are loaded.\n */\n getTimeShift = async (): Promise<number> => {\n return (await PlayerModule.getTimeShift(this.nativeId)) ?? 0;\n };\n\n /**\n * The limit in seconds for time shifting. This value is either negative or 0 and it is always 0 if the active\n * {@link Source} is not a live stream or no sources are loaded.\n */\n getMaxTimeShift = async (): Promise<number> => {\n return (await PlayerModule.getMaxTimeShift(this.nativeId)) ?? 0;\n };\n\n /**\n * Sets the upper bitrate boundary for video qualities. All qualities with a bitrate\n * that is higher than this threshold will not be eligible for automatic quality selection.\n *\n * Can be set to `null` for no limitation.\n */\n setMaxSelectableBitrate = (bitrate: number | null) => {\n void PlayerModule.setMaxSelectableBitrate(this.nativeId, bitrate || -1);\n };\n\n /**\n * @returns a {@link Thumbnail} for the specified playback time for the currently active source 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 PlayerModule.getThumbnail(this.nativeId, time);\n };\n\n /**\n * Whether casting to a cast-compatible remote device is available. {@link CastAvailableEvent} signals when\n * casting becomes available.\n *\n * @platform iOS, Android\n */\n isCastAvailable = async (): Promise<boolean> => {\n return (await PlayerModule.isCastAvailable(this.nativeId)) ?? false;\n };\n\n /**\n * Whether video is currently being casted to a remote device and not played locally.\n *\n * @platform iOS, Android\n */\n isCasting = async (): Promise<boolean> => {\n return (await PlayerModule.isCasting(this.nativeId)) ?? false;\n };\n\n /**\n * Initiates casting the current video to a cast-compatible remote device. The user has to choose to which device it\n * should be sent.\n *\n * @platform iOS, Android\n */\n castVideo = () => {\n void PlayerModule.castVideo(this.nativeId);\n };\n\n /**\n * Stops casting the current video. Has no effect if {@link Player.isCasting} is `false`.\n *\n * @platform iOS, Android\n */\n castStop = () => {\n void PlayerModule.castStop(this.nativeId);\n };\n\n /**\n * Returns the currently selected video quality.\n * @returns The currently selected video quality.\n */\n getVideoQuality = async (): Promise<VideoQuality> => {\n return PlayerModule.getVideoQuality(this.nativeId);\n };\n\n /**\n * Returns an array containing all available video qualities the player can adapt between.\n * @returns An array containing all available video qualities the player can adapt between.\n */\n getAvailableVideoQualities = async (): Promise<VideoQuality[]> => {\n return PlayerModule.getAvailableVideoQualities(this.nativeId);\n };\n\n /**\n * Sets the video quality.\n * @platform Android\n *\n * @param qualityId value obtained from {@link VideoQuality}'s `id` property, which can be obtained via `Player.getAvailableVideoQualities()` to select a specific quality. To use automatic quality selection, 'auto' can be passed here.\n */\n setVideoQuality = (qualityId: string) => {\n if (Platform.OS !== 'android') {\n console.warn(\n `[Player ${this.nativeId}] Method setVideoQuality is not available for iOS and tvOS devices. Only Android devices.`\n );\n return;\n }\n void PlayerModule.setVideoQuality(this.nativeId, qualityId);\n };\n\n /**\n * Sets the playback speed of the player. Fast forward, slow motion and reverse playback are supported.\n * @remarks\n * Platform: iOS, tvOS\n *\n * - Slow motion is indicated by values between `0` and `1`.\n * - Fast forward by values greater than `1`.\n * - Slow reverse is used by values between `0` and `-1`, and fast reverse is used by values less than `-1`. iOS and tvOS only.\n * - Negative values are ignored during Casting and on Android.\n * - During reverse playback the playback will continue until the beginning of the active source is\n * reached. When reaching the beginning of the source, playback will be paused and the playback\n * speed will be reset to its default value of `1`. No {@link PlaybackFinishedEvent} will be\n * emitted in this case.\n *\n * @param playbackSpeed - The playback speed to set.\n */\n setPlaybackSpeed = (playbackSpeed: number) => {\n void PlayerModule.setPlaybackSpeed(this.nativeId, playbackSpeed);\n };\n\n /**\n * @see {@link setPlaybackSpeed} for details on which values playback speed can assume.\n * @returns The player's current playback speed.\n */\n getPlaybackSpeed = async (): Promise<number> => {\n return (await PlayerModule.getPlaybackSpeed(this.nativeId)) ?? 0;\n };\n\n /**\n * Checks the possibility to play the media at specified playback speed.\n * @param playbackSpeed - The playback speed to check.\n * @returns `true` if it's possible to play the media at the specified playback speed, otherwise `false`. On Android it always returns `undefined`.\n * @platform iOS, tvOS\n */\n canPlayAtPlaybackSpeed = async (\n playbackSpeed: number\n ): Promise<boolean | undefined> => {\n if (Platform.OS === 'android') {\n console.warn(\n `[Player ${this.nativeId}] Method canPlayAtPlaybackSpeed is not available for Android. Only iOS and tvOS devices.`\n );\n return undefined;\n }\n return (\n (await PlayerModule.canPlayAtPlaybackSpeed(\n this.nativeId,\n playbackSpeed\n )) ?? false\n );\n };\n\n private maybeInitDecoderConfig = () => {\n if (this.config?.playbackConfig?.decoderConfig == null) {\n return;\n }\n if (Platform.OS === 'ios') {\n return;\n }\n\n this.decoderConfig = new DecoderConfigBridge(\n this.config.playbackConfig.decoderConfig\n );\n this.decoderConfig.initialize();\n };\n}\n"]}
|
package/build/source.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DrmConfig } from './drm';
|
|
1
|
+
import { Drm, DrmConfig } from './drm';
|
|
2
2
|
import NativeInstance, { NativeInstanceConfig } from './nativeInstance';
|
|
3
3
|
import { SideLoadedSubtitleTrack } from './subtitleTrack';
|
|
4
4
|
import { Thumbnail } from './thumbnail';
|
|
@@ -146,9 +146,12 @@ export interface SourceRemoteControlConfig {
|
|
|
146
146
|
*/
|
|
147
147
|
export declare class Source extends NativeInstance<SourceConfig> {
|
|
148
148
|
/**
|
|
149
|
-
*
|
|
149
|
+
* Provides access to DRM runtime APIs for this source.
|
|
150
|
+
* Use `drm.fairplay` to access {@link FairplayDrmApi} for FairPlay-specific APIs such as {@link FairplayDrmApi.renewExpiringLicense}.
|
|
151
|
+
*
|
|
152
|
+
* `undefined` if the source was created without a {@link DrmConfig}.
|
|
150
153
|
*/
|
|
151
|
-
|
|
154
|
+
drm?: Drm;
|
|
152
155
|
/**
|
|
153
156
|
* The remote control config for this source.
|
|
154
157
|
* This is only supported on iOS.
|
package/build/source.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"source.d.ts","sourceRoot":"","sources":["../src/source.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
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;;GAEG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yB;IACxC;;;;;;OAMG;IACH,gBAAgB,CAAC,EAAE,YAAY,GAAG,IAAI,CAAC;CACxC;AAED;;GAEG;AACH,qBAAa,MAAO,SAAQ,cAAc,CAAC,YAAY,CAAC;IACtD;;;;;OAKG;IACH,GAAG,CAAC,EAAE,GAAG,CAAC;IACV;;;;;OAKG;IACH,aAAa,EAAE,yBAAyB,GAAG,IAAI,CAAQ;IACvD;;OAEG;IACH,aAAa,UAAS;IACtB;;OAEG;IACH,WAAW,UAAS;IAEpB;;OAEG;IACH,UAAU,QAAa,OAAO,CAAC,IAAI,CAAC,CA0BlC;IAEF;;OAEG;IACH,OAAO,aAML;IAEF;;;OAGG;IACH,QAAQ,QAAa,OAAO,CAAC,MAAM,CAAC,CAElC;IAEF;;;OAGG;IACH,QAAQ,QAAa,OAAO,CAAC,OAAO,CAAC,CAEnC;IAEF;;OAEG;IACH,kBAAkB,QAAa,OAAO,CAAC,OAAO,CAAC,CAE7C;IAEF;;OAEG;IACH,QAAQ,QAAa,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC,CAEtD;IAEF;;;;;OAKG;IACH,WAAW,GAAI,UAAU,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,KAAG,IAAI,CAExD;IAEF;;OAEG;IACH,YAAY,QAAa,OAAO,CAAC,YAAY,CAAC,CAI5C;IAEF;;;;;;;;;OASG;IACH,YAAY,GAAU,MAAM,MAAM,KAAG,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC,CAE5D;CACH"}
|
package/build/source.js
CHANGED
|
@@ -61,7 +61,10 @@ export var TimelineReferencePoint;
|
|
|
61
61
|
*/
|
|
62
62
|
export class Source extends NativeInstance {
|
|
63
63
|
/**
|
|
64
|
-
*
|
|
64
|
+
* Provides access to DRM runtime APIs for this source.
|
|
65
|
+
* Use `drm.fairplay` to access {@link FairplayDrmApi} for FairPlay-specific APIs such as {@link FairplayDrmApi.renewExpiringLicense}.
|
|
66
|
+
*
|
|
67
|
+
* `undefined` if the source was created without a {@link DrmConfig}.
|
|
65
68
|
*/
|
|
66
69
|
drm;
|
|
67
70
|
/**
|
|
@@ -86,7 +89,7 @@ export class Source extends NativeInstance {
|
|
|
86
89
|
if (!this.isInitialized) {
|
|
87
90
|
const sourceMetadata = this.config?.analyticsSourceMetadata;
|
|
88
91
|
if (this.config?.drmConfig) {
|
|
89
|
-
this.drm = new Drm(this.config.drmConfig);
|
|
92
|
+
this.drm = new Drm(this.config.drmConfig, this.nativeId);
|
|
90
93
|
await this.drm.initialize();
|
|
91
94
|
}
|
|
92
95
|
if (sourceMetadata) {
|
|
@@ -104,8 +107,8 @@ export class Source extends NativeInstance {
|
|
|
104
107
|
*/
|
|
105
108
|
destroy = () => {
|
|
106
109
|
if (!this.isDestroyed) {
|
|
107
|
-
SourceModule.destroy(this.nativeId);
|
|
108
|
-
this.drm?.destroy();
|
|
110
|
+
void SourceModule.destroy(this.nativeId);
|
|
111
|
+
void this.drm?.destroy();
|
|
109
112
|
this.isDestroyed = true;
|
|
110
113
|
}
|
|
111
114
|
};
|
|
@@ -142,7 +145,7 @@ export class Source extends NativeInstance {
|
|
|
142
145
|
* @param metadata metadata to be set.
|
|
143
146
|
*/
|
|
144
147
|
setMetadata = (metadata) => {
|
|
145
|
-
SourceModule.setMetadata(this.nativeId, metadata);
|
|
148
|
+
void SourceModule.setMetadata(this.nativeId, metadata);
|
|
146
149
|
};
|
|
147
150
|
/**
|
|
148
151
|
* The current `LoadingState` of the source.
|
package/build/source.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"source.js","sourceRoot":"","sources":["../src/source.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAa,MAAM,OAAO,CAAC;AACvC,OAAO,cAAwC,MAAM,kBAAkB,CAAC;AAIxE,OAAO,YAAY,MAAM,wBAAwB,CAAC;AAElD;;GAEG;AACH,MAAM,CAAN,IAAY,UAiBX;AAjBD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AQ,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,YAAY,CAAC,WAAW,CAAC,IAAI,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IACpD,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 * The native DRM config reference of this source.\n */\n private 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);\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 SourceModule.destroy(this.nativeId);\n 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 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":"AAAA,OAAO,EAAE,GAAG,EAAa,MAAM,OAAO,CAAC;AACvC,OAAO,cAAwC,MAAM,kBAAkB,CAAC;AAIxE,OAAO,YAAY,MAAM,wBAAwB,CAAC;AAElD;;GAEG;AACH,MAAM,CAAN,IAAY,UAiBX;AAjBD,WAAY,UAAU;IACpB;;OAEG;IACH,2BAAa,CAAA;IACb;;OAEG;IACH,yBAAW,CAAA;IACX;;OAEG;IACH,2BAAa,CAAA;IACb;;OAEG;IACH,yCAA2B,CAAA;AAC7B,CAAC,EAjBW,UAAU,KAAV,UAAU,QAiBrB;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,YAa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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"]}
|
package/build/tweaksConfig.d.ts
CHANGED
|
@@ -165,6 +165,14 @@ export interface TweaksConfig {
|
|
|
165
165
|
* @platform Android
|
|
166
166
|
*/
|
|
167
167
|
useFiletypeExtractorFallbackForHls?: boolean;
|
|
168
|
+
/**
|
|
169
|
+
* If enabled, the player will retry renewing a DRM license in case the first renewal attempt fails.
|
|
170
|
+
* This can help maintain playback for long-running sessions where the license might expire.
|
|
171
|
+
*
|
|
172
|
+
* @defaultValue `false`
|
|
173
|
+
* @platform Android
|
|
174
|
+
*/
|
|
175
|
+
enableDrmLicenseRenewRetry?: boolean;
|
|
168
176
|
/**
|
|
169
177
|
* Determines whether `AVKit` should update Now Playing information automatically when using System UI.
|
|
170
178
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tweaksConfig.d.ts","sour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AC,EAAE,OAAO,CAAC;IACrC;;;;;;;;;;;OAWG;IACH,2BAA2B,CAAC,EAAE,OAAO,CAAC;IAEtC;;;;;;;;;;;;OAYG;IACH,2BAA2B,CAAC,EAAE,0BAA0B,EAAE,CAAC;CAC5D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tweaksConfig.js","sourceRoot":"","sources":["../src/tweaksConfig.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,MAAM,CAAN,IAAY,0BAaX;AAbD,WAAY,0BAA0B;IACpC;;OAEG;IACH,qEAAuC,CAAA;IACvC;;OAEG;IACH,2EAA6C,CAAA;IAC7C;;OAEG;IACH,6EAA+C,CAAA;AACjD,CAAC,EAbW,0BAA0B,KAA1B,0BAA0B,QAarC","sourcesContent":["/**\n * When switching the video quality, the video decoder's configuration might change\n * as the player can't always know if the codec supports such configuration change, it destroys and recreates it.\n * This behaviour can cause brief black screens when switching between video qualities as codec recreation can be slow.\n *\n * If a codec is know to support a given configuration change without issues,\n * the configuration can be added to the `TweaksConfig.forceReuseVideoCodecReasons`\n * to always reuse the video codec and avoid the black screen.\n */\nexport enum ForceReuseVideoCodecReason {\n /**\n * The new video quality color information is not compatible.\n */\n ColorInfoMismatch = 'ColorInfoMismatch',\n /**\n * The new video quality exceed the decoder's configured maximum sample size.\n */\n MaxInputSizeExceeded = 'MaxInputSizeExceeded',\n /**\n * The new video quality exceed the decoder's configured maximum resolution.\n */\n MaxResolutionExceeded = 'MaxResolutionExceeded',\n}\n\n/**\n * This configuration is used as an incubator for experimental features. Tweaks are not officially\n * supported and are not guaranteed to be stable, i.e. their naming, functionality and API can\n * change at any time within the tweaks or when being promoted to an official feature and moved\n * into its final configuration namespace.\n */\nexport interface TweaksConfig {\n /**\n * The frequency in seconds `onTimeChanged` is called with `TimeChangedEvent`s.\n *\n * Default value in iOS is `1.0`.\n * Default value in Android is `0.2`.\n *\n * @platform iOS, Android\n */\n timeChangedInterval?: number;\n /**\n * If enabled, HLS playlists will be parsed and additional features and events are enabled. This includes:\n *\n * - {@link MetadataEvent}s carrying segment-specific metadata for custom HLS tags, like `#EXT-X-SCTE35`\n * - {@link MetadataParsedEvent}s carrying segment-specific metadata for custom HLS tags, like `#EXT-X-SCTE35`\n * - DrmDataParsedEvents when a `#EXT-X-KEY` is found\n * - {@link Player.getAvailableVideoQualities} includes additional information\n * - Automatic retries when HLS playlist requests failed with non-2xx HTTP status code\n *\n * @defaultValue `false`\n * @platform iOS\n */\n isNativeHlsParsingEnabled?: boolean;\n /**\n * If enabled, playlists will be downloaded by the Bitmovin Player SDK instead of AVFoundation.\n * This enables additional features and events, like:\n *\n * - DownloadFinishedEvents for playlist downloads.\n * - SourceWarningEvents when no `#EXT-X-PLAYLIST-TYPE` is found If set to false, enabling\n * nativeHlsParsingEnabled won’t have any effect.\n *\n * Default is true.\n *\n * @platform iOS\n */\n isCustomHlsLoadingEnabled?: boolean;\n /**\n * The threshold which will be applied when seeking to the end in seconds. This value will be used\n * to calculate the maximum seekable time when calling `player.seek(time:)` or `player.playlist.seek(source:time:)`,\n * so the maximum value will be duration - seekToEndThreshold.\n *\n * This is useful if the duration of the segments does not match the duration specified in the\n * manifest. In this case, if we try to seek to the end, AVPlayer could get stuck and might stall\n * forever Therefore increasing this value could help.\n *\n * Default is 0.5.\n *\n * @platform iOS\n */\n seekToEndThreshold?: number;\n /**\n * Specifies the player behaviour when `Player.play` is called. Default is 'relaxed'.\n *\n * - 'relaxed': Starts playback when enough media data is buffered and continuous playback without stalling can be ensured. If insufficient media data is buffered for playback to start, the player will act as if the buffer became empty during playback.\n * - 'aggressive': When the buffer is not empty, this setting will cause the player to start playback of available media immediately. If insufficient media data is buffered for playback to start, the player will act as if the buffer became empty during playback.\n *\n * @platform iOS\n */\n playbackStartBehaviour?: 'relaxed' | 'aggressive';\n /**\n * Specifies the player behaviour when stalling should be exited. Default is 'relaxed'.\n *\n * - 'relaxed': The player will wait until the buffer is filled that it can, most likely, ensure continuous playback without another stalling right after playback continued.\n * - 'aggressive': The player will try to unstall as soon as some media data became available and will start playback of this media immediately.\n *\n * @platform iOS\n */\n unstallingBehaviour?: 'relaxed' | 'aggressive';\n /**\n * Constantly aggregated and weighted bandwidth samples are summed up to this weight limit to calculate an bandwidth estimation. Remaining samples (i.e. that would lead to exceeding the limit) are dropped from memory as they are not relevant anymore.\n * Default is 2000.\n *\n * @platform Android\n */\n bandwidthEstimateWeightLimit?: number;\n /**\n * Some devices have an incorrect implementation of MediaCodec.setOutputSurface. This leads to failure when the surface changes. To prevent failure, the codec will be released and re-instantiated in those scenarios.\n *\n * @platform Android\n */\n devicesThatRequireSurfaceWorkaround?: {\n /**\n * A device name as reported by Build.DEVICE.\n *\n * @see Build.DEVICE: https://developer.android.com/reference/kotlin/android/os/Build.html#DEVICE--\n */\n deviceNames?: string[];\n /**\n * A model name as reported by Build.MODEL.\n *\n * @see Build.MODEL: https://developer.android.com/reference/kotlin/android/os/Build.html#MODEL--\n */\n modelNames?: string[];\n };\n /**\n * Specifies if the language property on DASH Representations, HLS Renditions and SmoothStreaming QualityLevels is normalized.\n * If enabled, language properties are normalized to IETF BCP 47 language tags. Default is true.\n *\n * Examples:\n * - \"ENG\" is normalized to \"en\"\n * - \"en_us\" is normalized to \"en-us\"\n * - \"en-US-x-lvariant-POSIX\" is normalized to \"en-us-posix\"\n *\n * @platform Android\n */\n languagePropertyNormalization?: boolean;\n /**\n * The interval in which dynamic DASH windows are updated locally. I.e. The rate by which the\n * playback window is moved forward on the timeline.\n *\n * @platform Android\n */\n localDynamicDashWindowUpdateInterval?: number;\n /**\n * Specifies whether a DRM session should be used for clear tracks of type video and audio. Using\n * DRM sessions for clear content avoids the recreation of decoders when transitioning between clear\n * and encrypted sections of content. Default is false.\n *\n * @platform Android\n */\n useDrmSessionForClearPeriods?: boolean;\n /**\n * Specifies whether a DRM session should be used for clear tracks of type video and audio in a clear\n * source that follows after a DRM protected source. In addition, a DRM session will be used for clear\n * periods in a DRM protected source. Using DRM sessions for clear content avoids the recreation of\n * decoders when transitioning between clear and encrypted sections of content. Default is false.\n *\n * @platform Android\n */\n useDrmSessionForClearSources?: boolean;\n /**\n * Specifies if the player should always fall back to an extractor matching the file type, if no\n * matching extractor was found. If the fallback is applied, this will ignore potential incompatibilities\n * with streams and thus can result in unstable or failing playback.\n *\n * @platform Android\n */\n useFiletypeExtractorFallbackForHls?: boolean;\n /**\n * Determines whether `AVKit` should update Now Playing information automatically when using System UI.\n *\n * - If set to `false`, the automatic updates of Now Playing Info sent by `AVKit` are disabled.\n * This prevents interference with manual updates you may want to perform.\n * - If set to `true`, the default behaviour is maintained, allowing `AVKit` to handle Now Playing updates.\n *\n * Default is `true`.\n *\n * @deprecated To enable the Now Playing information use {@link MediaControlConfig.isEnabled}\n * @platform iOS\n */\n updatesNowPlayingInfoCenter?: boolean;\n\n /**\n * When switching between video formats (eg: adapting between video qualities)\n * the codec might be recreated due to several reasons.\n * This behaviour can cause brief black screens when switching between video qualities as codec recreation can be\n * slow.\n *\n * If a device is know to support video format changes and keep the current decoder without issues,\n * this set can be filled with multiple `ForceReuseVideoCodecReason` and avoid the black screen.\n *\n * Default is `null` i.e not set\n *\n * @platform Android\n */\n forceReuseVideoCodecReasons?: ForceReuseVideoCodecReason[];\n}\n"]}
|
|
1
|
+
{"version":3,"file":"tweaksConfig.js","sourceRoot":"","sources":["../src/tweaksConfig.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,MAAM,CAAN,IAAY,0BAaX;AAbD,WAAY,0BAA0B;IACpC;;OAEG;IACH,qEAAuC,CAAA;IACvC;;OAEG;IACH,2EAA6C,CAAA;IAC7C;;OAEG;IACH,6EAA+C,CAAA;AACjD,CAAC,EAbW,0BAA0B,KAA1B,0BAA0B,QAarC","sourcesContent":["/**\n * When switching the video quality, the video decoder's configuration might change\n * as the player can't always know if the codec supports such configuration change, it destroys and recreates it.\n * This behaviour can cause brief black screens when switching between video qualities as codec recreation can be slow.\n *\n * If a codec is know to support a given configuration change without issues,\n * the configuration can be added to the `TweaksConfig.forceReuseVideoCodecReasons`\n * to always reuse the video codec and avoid the black screen.\n */\nexport enum ForceReuseVideoCodecReason {\n /**\n * The new video quality color information is not compatible.\n */\n ColorInfoMismatch = 'ColorInfoMismatch',\n /**\n * The new video quality exceed the decoder's configured maximum sample size.\n */\n MaxInputSizeExceeded = 'MaxInputSizeExceeded',\n /**\n * The new video quality exceed the decoder's configured maximum resolution.\n */\n MaxResolutionExceeded = 'MaxResolutionExceeded',\n}\n\n/**\n * This configuration is used as an incubator for experimental features. Tweaks are not officially\n * supported and are not guaranteed to be stable, i.e. their naming, functionality and API can\n * change at any time within the tweaks or when being promoted to an official feature and moved\n * into its final configuration namespace.\n */\nexport interface TweaksConfig {\n /**\n * The frequency in seconds `onTimeChanged` is called with `TimeChangedEvent`s.\n *\n * Default value in iOS is `1.0`.\n * Default value in Android is `0.2`.\n *\n * @platform iOS, Android\n */\n timeChangedInterval?: number;\n /**\n * If enabled, HLS playlists will be parsed and additional features and events are enabled. This includes:\n *\n * - {@link MetadataEvent}s carrying segment-specific metadata for custom HLS tags, like `#EXT-X-SCTE35`\n * - {@link MetadataParsedEvent}s carrying segment-specific metadata for custom HLS tags, like `#EXT-X-SCTE35`\n * - DrmDataParsedEvents when a `#EXT-X-KEY` is found\n * - {@link Player.getAvailableVideoQualities} includes additional information\n * - Automatic retries when HLS playlist requests failed with non-2xx HTTP status code\n *\n * @defaultValue `false`\n * @platform iOS\n */\n isNativeHlsParsingEnabled?: boolean;\n /**\n * If enabled, playlists will be downloaded by the Bitmovin Player SDK instead of AVFoundation.\n * This enables additional features and events, like:\n *\n * - DownloadFinishedEvents for playlist downloads.\n * - SourceWarningEvents when no `#EXT-X-PLAYLIST-TYPE` is found If set to false, enabling\n * nativeHlsParsingEnabled won’t have any effect.\n *\n * Default is true.\n *\n * @platform iOS\n */\n isCustomHlsLoadingEnabled?: boolean;\n /**\n * The threshold which will be applied when seeking to the end in seconds. This value will be used\n * to calculate the maximum seekable time when calling `player.seek(time:)` or `player.playlist.seek(source:time:)`,\n * so the maximum value will be duration - seekToEndThreshold.\n *\n * This is useful if the duration of the segments does not match the duration specified in the\n * manifest. In this case, if we try to seek to the end, AVPlayer could get stuck and might stall\n * forever Therefore increasing this value could help.\n *\n * Default is 0.5.\n *\n * @platform iOS\n */\n seekToEndThreshold?: number;\n /**\n * Specifies the player behaviour when `Player.play` is called. Default is 'relaxed'.\n *\n * - 'relaxed': Starts playback when enough media data is buffered and continuous playback without stalling can be ensured. If insufficient media data is buffered for playback to start, the player will act as if the buffer became empty during playback.\n * - 'aggressive': When the buffer is not empty, this setting will cause the player to start playback of available media immediately. If insufficient media data is buffered for playback to start, the player will act as if the buffer became empty during playback.\n *\n * @platform iOS\n */\n playbackStartBehaviour?: 'relaxed' | 'aggressive';\n /**\n * Specifies the player behaviour when stalling should be exited. Default is 'relaxed'.\n *\n * - 'relaxed': The player will wait until the buffer is filled that it can, most likely, ensure continuous playback without another stalling right after playback continued.\n * - 'aggressive': The player will try to unstall as soon as some media data became available and will start playback of this media immediately.\n *\n * @platform iOS\n */\n unstallingBehaviour?: 'relaxed' | 'aggressive';\n /**\n * Constantly aggregated and weighted bandwidth samples are summed up to this weight limit to calculate an bandwidth estimation. Remaining samples (i.e. that would lead to exceeding the limit) are dropped from memory as they are not relevant anymore.\n * Default is 2000.\n *\n * @platform Android\n */\n bandwidthEstimateWeightLimit?: number;\n /**\n * Some devices have an incorrect implementation of MediaCodec.setOutputSurface. This leads to failure when the surface changes. To prevent failure, the codec will be released and re-instantiated in those scenarios.\n *\n * @platform Android\n */\n devicesThatRequireSurfaceWorkaround?: {\n /**\n * A device name as reported by Build.DEVICE.\n *\n * @see Build.DEVICE: https://developer.android.com/reference/kotlin/android/os/Build.html#DEVICE--\n */\n deviceNames?: string[];\n /**\n * A model name as reported by Build.MODEL.\n *\n * @see Build.MODEL: https://developer.android.com/reference/kotlin/android/os/Build.html#MODEL--\n */\n modelNames?: string[];\n };\n /**\n * Specifies if the language property on DASH Representations, HLS Renditions and SmoothStreaming QualityLevels is normalized.\n * If enabled, language properties are normalized to IETF BCP 47 language tags. Default is true.\n *\n * Examples:\n * - \"ENG\" is normalized to \"en\"\n * - \"en_us\" is normalized to \"en-us\"\n * - \"en-US-x-lvariant-POSIX\" is normalized to \"en-us-posix\"\n *\n * @platform Android\n */\n languagePropertyNormalization?: boolean;\n /**\n * The interval in which dynamic DASH windows are updated locally. I.e. The rate by which the\n * playback window is moved forward on the timeline.\n *\n * @platform Android\n */\n localDynamicDashWindowUpdateInterval?: number;\n /**\n * Specifies whether a DRM session should be used for clear tracks of type video and audio. Using\n * DRM sessions for clear content avoids the recreation of decoders when transitioning between clear\n * and encrypted sections of content. Default is false.\n *\n * @platform Android\n */\n useDrmSessionForClearPeriods?: boolean;\n /**\n * Specifies whether a DRM session should be used for clear tracks of type video and audio in a clear\n * source that follows after a DRM protected source. In addition, a DRM session will be used for clear\n * periods in a DRM protected source. Using DRM sessions for clear content avoids the recreation of\n * decoders when transitioning between clear and encrypted sections of content. Default is false.\n *\n * @platform Android\n */\n useDrmSessionForClearSources?: boolean;\n /**\n * Specifies if the player should always fall back to an extractor matching the file type, if no\n * matching extractor was found. If the fallback is applied, this will ignore potential incompatibilities\n * with streams and thus can result in unstable or failing playback.\n *\n * @platform Android\n */\n useFiletypeExtractorFallbackForHls?: boolean;\n /**\n * If enabled, the player will retry renewing a DRM license in case the first renewal attempt fails.\n * This can help maintain playback for long-running sessions where the license might expire.\n *\n * @defaultValue `false`\n * @platform Android\n */\n enableDrmLicenseRenewRetry?: boolean;\n /**\n * Determines whether `AVKit` should update Now Playing information automatically when using System UI.\n *\n * - If set to `false`, the automatic updates of Now Playing Info sent by `AVKit` are disabled.\n * This prevents interference with manual updates you may want to perform.\n * - If set to `true`, the default behaviour is maintained, allowing `AVKit` to handle Now Playing updates.\n *\n * Default is `true`.\n *\n * @deprecated To enable the Now Playing information use {@link MediaControlConfig.isEnabled}\n * @platform iOS\n */\n updatesNowPlayingInfoCenter?: boolean;\n\n /**\n * When switching between video formats (eg: adapting between video qualities)\n * the codec might be recreated due to several reasons.\n * This behaviour can cause brief black screens when switching between video qualities as codec recreation can be\n * slow.\n *\n * If a device is know to support video format changes and keep the current decoder without issues,\n * this set can be filled with multiple `ForceReuseVideoCodecReason` and avoid the black screen.\n *\n * Default is `null` i.e not set\n *\n * @platform Android\n */\n forceReuseVideoCodecReasons?: ForceReuseVideoCodecReason[];\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"custommessagehandlerbridge.d.ts","sourceRoot":"","sources":["../../src/ui/custommessagehandlerbridge.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAI5D;;GAEG;AACH,qBAAa,0BAA2B,YAAW,mBAAmB;IACpE,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,OAAO,CAAC,oBAAoB,CAAC,CAAuB;IACpD,OAAO,CAAC,WAAW,CAAU;IAE7B,OAAO,CAAC,wCAAwC,CAAC,CAAoB;IACrE,OAAO,CAAC,yCAAyC,CAAC,CAAoB;gBAE1D,QAAQ,CAAC,EAAE,MAAM;IA8B7B,uBAAuB,CAAC,oBAAoB,EAAE,oBAAoB;IAKlE;;OAEG;IACH,OAAO;IAWP;;;OAGG;IACH,OAAO,CAAC,0BAA0B;
|
|
1
|
+
{"version":3,"file":"custommessagehandlerbridge.d.ts","sourceRoot":"","sources":["../../src/ui/custommessagehandlerbridge.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAI5D;;GAEG;AACH,qBAAa,0BAA2B,YAAW,mBAAmB;IACpE,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,OAAO,CAAC,oBAAoB,CAAC,CAAuB;IACpD,OAAO,CAAC,WAAW,CAAU;IAE7B,OAAO,CAAC,wCAAwC,CAAC,CAAoB;IACrE,OAAO,CAAC,yCAAyC,CAAC,CAAoB;gBAE1D,QAAQ,CAAC,EAAE,MAAM;IA8B7B,uBAAuB,CAAC,oBAAoB,EAAE,oBAAoB;IAKlE;;OAEG;IACH,OAAO;IAWP;;;OAGG;IACH,OAAO,CAAC,0BAA0B;IAelC;;;OAGG;IACH,OAAO,CAAC,2BAA2B;IAQnC;;OAEG;IACH,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI;CAG7D"}
|
|
@@ -27,7 +27,7 @@ export class CustomMessageHandlerBridge {
|
|
|
27
27
|
}
|
|
28
28
|
this.receivedAsynchronousMessage(message, data);
|
|
29
29
|
});
|
|
30
|
-
CustomMessageHandlerModule.registerHandler(this.nativeId);
|
|
30
|
+
void CustomMessageHandlerModule.registerHandler(this.nativeId);
|
|
31
31
|
}
|
|
32
32
|
setCustomMessageHandler(customMessageHandler) {
|
|
33
33
|
this.customMessageHandler = customMessageHandler;
|
|
@@ -38,7 +38,7 @@ export class CustomMessageHandlerBridge {
|
|
|
38
38
|
*/
|
|
39
39
|
destroy() {
|
|
40
40
|
if (!this.isDestroyed) {
|
|
41
|
-
CustomMessageHandlerModule.destroy(this.nativeId);
|
|
41
|
+
void CustomMessageHandlerModule.destroy(this.nativeId);
|
|
42
42
|
this.onReceivedSynchronousMessageSubscription?.remove();
|
|
43
43
|
this.onReceivedAsynchronousMessageSubscription?.remove();
|
|
44
44
|
this.onReceivedSynchronousMessageSubscription = undefined;
|
|
@@ -52,7 +52,7 @@ export class CustomMessageHandlerBridge {
|
|
|
52
52
|
*/
|
|
53
53
|
receivedSynchronousMessage(id, message, data) {
|
|
54
54
|
const result = this.customMessageHandler?.receivedSynchronousMessage(message, data);
|
|
55
|
-
CustomMessageHandlerModule.onReceivedSynchronousMessageResult(id, result);
|
|
55
|
+
void CustomMessageHandlerModule.onReceivedSynchronousMessageResult(id, result);
|
|
56
56
|
}
|
|
57
57
|
/**
|
|
58
58
|
* Called by native code, when the UI sends an asynchronous message.
|
|
@@ -66,7 +66,7 @@ export class CustomMessageHandlerBridge {
|
|
|
66
66
|
* Called by CustomMessageHandler, when sending a message to the UI.
|
|
67
67
|
*/
|
|
68
68
|
sendMessage(message, data) {
|
|
69
|
-
CustomMessageHandlerModule.sendMessage(this.nativeId, message, data);
|
|
69
|
+
void CustomMessageHandlerModule.sendMessage(this.nativeId, message, data);
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
72
|
//# sourceMappingURL=custommessagehandlerbridge.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"custommessagehandlerbridge.js","sourceRoot":"","sources":["../../src/ui/custommessagehandlerbridge.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AACtC,OAAO,0BAA0B,MAAM,8BAA8B,CAAC;AAEtE;;GAEG;AACH,MAAM,OAAO,0BAA0B;IAC5B,QAAQ,CAAS;IAClB,oBAAoB,CAAwB;IAC5C,WAAW,CAAU;IAErB,wCAAwC,CAAqB;IAC7D,yCAAyC,CAAqB;IAEtE,YAAY,QAAiB;QAC3B,IAAI,CAAC,QAAQ,GAAG,QAAQ,IAAI,MAAM,CAAC,UAAU,EAAE,CAAC;QAChD,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC;QAEzB,mEAAmE;QACnE,IAAI,CAAC,wCAAwC;YAC3C,0BAA0B,CAAC,WAAW,CACpC,8BAA8B,EAC9B,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE;gBAClC,IAAI,QAAQ,KAAK,IAAI,CAAC,QAAQ,EAAE,CAAC;oBAC/B,OAAO;gBACT,CAAC;gBACD,IAAI,CAAC,0BAA0B,CAAC,EAAE,EAAE,OAAO,EAAE,IAA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AAoB,EAAE,2BAA2B,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IACxE,CAAC;IAED,qCAAqC;IACrC;;OAEG;IACH,WAAW,CAAC,OAAe,EAAE,IAAwB;QACnD,KAAK,0BAA0B,CAAC,WAAW,CAAC,IAAI,CAAC,QAAQ,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;IAC5E,CAAC;CACF","sourcesContent":["import { EventSubscription } from 'expo-modules-core';\nimport { CustomMessageHandler } from './custommessagehandler';\nimport { CustomMessageSender } from './custommessagesender';\nimport * as Crypto from 'expo-crypto';\nimport CustomMessageHandlerModule from './customMessageHandlerModule';\n\n/**\n * Takes care of JS/Native communication for a CustomMessageHandler.\n */\nexport class CustomMessageHandlerBridge implements CustomMessageSender {\n readonly nativeId: string;\n private customMessageHandler?: CustomMessageHandler;\n private isDestroyed: boolean;\n\n private onReceivedSynchronousMessageSubscription?: EventSubscription;\n private onReceivedAsynchronousMessageSubscription?: EventSubscription;\n\n constructor(nativeId?: string) {\n this.nativeId = nativeId ?? Crypto.randomUUID();\n this.isDestroyed = false;\n\n // Set up event listeners for synchronous and asynchronous messages\n this.onReceivedSynchronousMessageSubscription =\n CustomMessageHandlerModule.addListener(\n 'onReceivedSynchronousMessage',\n ({ nativeId, id, message, data }) => {\n if (nativeId !== this.nativeId) {\n return;\n }\n this.receivedSynchronousMessage(id, message, data);\n }\n );\n\n this.onReceivedAsynchronousMessageSubscription =\n CustomMessageHandlerModule.addListener(\n 'onReceivedAsynchronousMessage',\n ({ nativeId, message, data }) => {\n if (nativeId !== this.nativeId) {\n return;\n }\n this.receivedAsynchronousMessage(message, data);\n }\n );\n\n void CustomMessageHandlerModule.registerHandler(this.nativeId);\n }\n\n setCustomMessageHandler(customMessageHandler: CustomMessageHandler) {\n this.customMessageHandler = customMessageHandler;\n this.customMessageHandler.customMessageSender = this;\n }\n\n /**\n * Destroys the native CustomMessageHandler\n */\n destroy() {\n if (!this.isDestroyed) {\n void CustomMessageHandlerModule.destroy(this.nativeId);\n this.onReceivedSynchronousMessageSubscription?.remove();\n this.onReceivedAsynchronousMessageSubscription?.remove();\n this.onReceivedSynchronousMessageSubscription = undefined;\n this.onReceivedAsynchronousMessageSubscription = undefined;\n this.isDestroyed = true;\n }\n }\n\n /**\n * Called by native code, when the UI sends a synchronous message.\n * @internal\n */\n private receivedSynchronousMessage(\n id: number,\n message: string,\n data: string | undefined\n ): void {\n const result = this.customMessageHandler?.receivedSynchronousMessage(\n message,\n data\n );\n void CustomMessageHandlerModule.onReceivedSynchronousMessageResult(\n id,\n result\n );\n }\n\n /**\n * Called by native code, when the UI sends an asynchronous message.\n * @internal\n */\n private receivedAsynchronousMessage(\n message: string,\n data: string | undefined\n ): void {\n this.customMessageHandler?.receivedAsynchronousMessage(message, data);\n }\n\n // noinspection JSUnusedGlobalSymbols\n /**\n * Called by CustomMessageHandler, when sending a message to the UI.\n */\n sendMessage(message: string, data: string | undefined): void {\n void CustomMessageHandlerModule.sendMessage(this.nativeId, message, data);\n }\n}\n"]}
|
|
@@ -24,7 +24,7 @@ export class FullscreenHandlerBridge {
|
|
|
24
24
|
}
|
|
25
25
|
this.exitFullscreen(id);
|
|
26
26
|
});
|
|
27
|
-
FullscreenHandlerModule.registerHandler(this.nativeId);
|
|
27
|
+
void FullscreenHandlerModule.registerHandler(this.nativeId);
|
|
28
28
|
}
|
|
29
29
|
setFullscreenHandler(fullscreenHandler) {
|
|
30
30
|
if (this.fullscreenHandler === fullscreenHandler) {
|
|
@@ -32,14 +32,14 @@ export class FullscreenHandlerBridge {
|
|
|
32
32
|
}
|
|
33
33
|
this.fullscreenHandler = fullscreenHandler;
|
|
34
34
|
// synchronize current state from fullscreenHandler to native
|
|
35
|
-
FullscreenHandlerModule.setIsFullscreenActive(this.nativeId, fullscreenHandler?.isFullscreenActive ?? false);
|
|
35
|
+
void FullscreenHandlerModule.setIsFullscreenActive(this.nativeId, fullscreenHandler?.isFullscreenActive ?? false);
|
|
36
36
|
}
|
|
37
37
|
/**
|
|
38
38
|
* Destroys the native FullscreenHandler
|
|
39
39
|
*/
|
|
40
40
|
destroy() {
|
|
41
41
|
if (!this.isDestroyed) {
|
|
42
|
-
FullscreenHandlerModule.destroy(this.nativeId);
|
|
42
|
+
void FullscreenHandlerModule.destroy(this.nativeId);
|
|
43
43
|
this.onEnterFullScreenSubscription?.remove();
|
|
44
44
|
this.onExitFullScreenSubscription?.remove();
|
|
45
45
|
this.onEnterFullScreenSubscription = undefined;
|
|
@@ -53,7 +53,7 @@ export class FullscreenHandlerBridge {
|
|
|
53
53
|
*/
|
|
54
54
|
enterFullscreen(id) {
|
|
55
55
|
this.fullscreenHandler?.enterFullscreen();
|
|
56
|
-
FullscreenHandlerModule.notifyFullscreenChanged(id, this.fullscreenHandler?.isFullscreenActive ?? false);
|
|
56
|
+
void FullscreenHandlerModule.notifyFullscreenChanged(id, this.fullscreenHandler?.isFullscreenActive ?? false);
|
|
57
57
|
}
|
|
58
58
|
// noinspection JSUnusedGlobalSymbols
|
|
59
59
|
/**
|
|
@@ -61,7 +61,7 @@ export class FullscreenHandlerBridge {
|
|
|
61
61
|
*/
|
|
62
62
|
exitFullscreen(id) {
|
|
63
63
|
this.fullscreenHandler?.exitFullscreen();
|
|
64
|
-
FullscreenHandlerModule.notifyFullscreenChanged(id, this.fullscreenHandler?.isFullscreenActive ?? false);
|
|
64
|
+
void FullscreenHandlerModule.notifyFullscreenChanged(id, this.fullscreenHandler?.isFullscreenActive ?? false);
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
//# sourceMappingURL=fullscreenhandlerbridge.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fullscreenhandlerbridge.js","sourceRoot":"","sources":["../../src/ui/fullscreenhandlerbridge.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AACtC,OAAO,uBAAuB,MAAM,2BAA2B,CAAC;AAEhE;;GAEG;AACH,MAAM,OAAO,uBAAuB;IACz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,EAAE,MAAM,EAAE,CAAC;YAC5C,IAAI,CAAC,6BAA6B,GAAG,SAAS,CAAC;YAC/C,IAAI,CAAC,4BAA4B,GAAG,SAAS,CAAC;YAC9C,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;QAC1B,CAAC;IACH,CAAC;IAED,qCAAqC;IACrC;;OAEG;IACK,eAAe,CAAC,EAAU;QAChC,IAAI,CAAC,iBAAiB,EAAE,eAAe,EAAE,CAAC;QAC1C,KAAK,uBAAuB,CAAC,uBAAuB,CAClD,EAAE,EACF,IAAI,CAAC,iBAAiB,EAAE,kBAAkB,IAAI,KAAK,CACpD,CAAC;IACJ,CAAC;IAED,qCAAqC;IACrC;;OAEG;IACK,cAAc,CAAC,EAAU;QAC/B,IAAI,CAAC,iBAAiB,EAAE,cAAc,EAAE,CAAC;QACzC,KAAK,uBAAuB,CAAC,uBAAuB,CAClD,EAAE,EACF,IAAI,CAAC,iBAAiB,EAAE,kBAAkB,IAAI,KAAK,CACpD,CAAC;IACJ,CAAC;CACF","sourcesContent":["import { EventSubscription } from 'expo-modules-core';\nimport { FullscreenHandler } from './fullscreenhandler';\nimport * as Crypto from 'expo-crypto';\nimport FullscreenHandlerModule from './fullscreenHandlerModule';\n\n/**\n * Takes care of JS/Native communication for a FullscreenHandler.\n */\nexport class FullscreenHandlerBridge {\n readonly nativeId: string;\n fullscreenHandler?: FullscreenHandler;\n isDestroyed: boolean;\n\n private onEnterFullScreenSubscription?: EventSubscription;\n private onExitFullScreenSubscription?: EventSubscription;\n\n constructor(nativeId?: string) {\n this.nativeId = nativeId ?? Crypto.randomUUID();\n this.isDestroyed = false;\n\n this.onEnterFullScreenSubscription = FullscreenHandlerModule.addListener(\n 'onEnterFullscreen',\n ({ nativeId, id }) => {\n if (nativeId !== this.nativeId) {\n return;\n }\n this.enterFullscreen(id);\n }\n );\n this.onExitFullScreenSubscription = FullscreenHandlerModule.addListener(\n 'onExitFullscreen',\n ({ nativeId, id }) => {\n if (nativeId !== this.nativeId) {\n return;\n }\n this.exitFullscreen(id);\n }\n );\n void FullscreenHandlerModule.registerHandler(this.nativeId);\n }\n\n setFullscreenHandler(fullscreenHandler: FullscreenHandler | undefined) {\n if (this.fullscreenHandler === fullscreenHandler) {\n return;\n }\n\n this.fullscreenHandler = fullscreenHandler;\n\n // synchronize current state from fullscreenHandler to native\n void FullscreenHandlerModule.setIsFullscreenActive(\n this.nativeId,\n fullscreenHandler?.isFullscreenActive ?? false\n );\n }\n\n /**\n * Destroys the native FullscreenHandler\n */\n destroy() {\n if (!this.isDestroyed) {\n void FullscreenHandlerModule.destroy(this.nativeId);\n this.onEnterFullScreenSubscription?.remove();\n this.onExitFullScreenSubscription?.remove();\n this.onEnterFullScreenSubscription = undefined;\n this.onExitFullScreenSubscription = undefined;\n this.isDestroyed = true;\n }\n }\n\n // noinspection JSUnusedGlobalSymbols\n /**\n * Called by native code, when the UI should enter fullscreen.\n */\n private enterFullscreen(id: number): void {\n this.fullscreenHandler?.enterFullscreen();\n void FullscreenHandlerModule.notifyFullscreenChanged(\n id,\n this.fullscreenHandler?.isFullscreenActive ?? false\n );\n }\n\n // noinspection JSUnusedGlobalSymbols\n /**\n * Called by native code, when the UI should exit fullscreen.\n */\n private exitFullscreen(id: number): void {\n this.fullscreenHandler?.exitFullscreen();\n void FullscreenHandlerModule.notifyFullscreenChanged(\n id,\n this.fullscreenHandler?.isFullscreenActive ?? false\n );\n }\n}\n"]}
|
package/ios/Event+JSON.swift
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
// swiftlint:disable file_length
|
|
2
|
+
|
|
1
3
|
import BitmovinPlayer
|
|
2
4
|
|
|
3
5
|
extension Source {
|
|
@@ -28,11 +30,15 @@ extension NSError: JsonConvertible {
|
|
|
28
30
|
|
|
29
31
|
extension DeficiencyData: JsonConvertible {
|
|
30
32
|
func toJSON() -> [AnyHashable: Any] {
|
|
31
|
-
[
|
|
33
|
+
var json: [AnyHashable: Any] = [
|
|
32
34
|
"code": code,
|
|
33
35
|
"message": message,
|
|
34
36
|
"underlyingError": underlyingError.toJSON()
|
|
35
37
|
]
|
|
38
|
+
if let response {
|
|
39
|
+
json["httpResponse"] = RCTConvert.toJson(httpResponse: response)
|
|
40
|
+
}
|
|
41
|
+
return json
|
|
36
42
|
}
|
|
37
43
|
}
|
|
38
44
|
|
|
@@ -382,6 +388,7 @@ extension CastWaitingForDeviceEvent: JsonConvertible {
|
|
|
382
388
|
}
|
|
383
389
|
}
|
|
384
390
|
}
|
|
391
|
+
|
|
385
392
|
#endif
|
|
386
393
|
|
|
387
394
|
extension DownloadFinishedEvent: JsonConvertible {
|
|
@@ -468,6 +475,18 @@ extension MetadataParsedEvent: JsonConvertible {
|
|
|
468
475
|
}
|
|
469
476
|
}
|
|
470
477
|
|
|
478
|
+
extension FairplayLicenseAcquiredEvent: JsonConvertible {
|
|
479
|
+
func toJSON() -> [AnyHashable: Any] {
|
|
480
|
+
toEventJSON {
|
|
481
|
+
[
|
|
482
|
+
"contentKeyRequest": [
|
|
483
|
+
"skdUri": contentKeyRequest.skdUri
|
|
484
|
+
]
|
|
485
|
+
]
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
|
|
471
490
|
extension PlayerActiveEvent: DefaultJsonConvertibleEvent {}
|
|
472
491
|
extension PlayerInactiveEvent: DefaultJsonConvertibleEvent {}
|
|
473
492
|
extension DestroyEvent: DefaultJsonConvertibleEvent {}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import BitmovinPlayer
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Registry for `FairplayContentKeyRequest` instances.
|
|
5
|
+
*
|
|
6
|
+
* `FairplayContentKeyRequest` wraps an `AVContentKeyRequest`, which is a native iOS/tvOS object
|
|
7
|
+
* that cannot be serialized across the React Native bridge. This registry retains the native
|
|
8
|
+
* instances so they can be retrieved when `renewExpiringLicense` is called from the JS layer
|
|
9
|
+
* using only the `skdUri` string.
|
|
10
|
+
*
|
|
11
|
+
* Instances are keyed by a composite of the source's `NativeId` and the `skdUri` to prevent
|
|
12
|
+
* collisions across multiple sources.
|
|
13
|
+
*/
|
|
14
|
+
internal final class FairplayContentKeyRequestRegistry {
|
|
15
|
+
private var requests: [String: FairplayContentKeyRequest] = [:]
|
|
16
|
+
private let lock = NSRecursiveLock()
|
|
17
|
+
|
|
18
|
+
func store(nativeId: String, contentKeyRequest: FairplayContentKeyRequest) {
|
|
19
|
+
lock.withLock {
|
|
20
|
+
requests[key(nativeId: nativeId, skdUri: contentKeyRequest.skdUri)] = contentKeyRequest
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
func retrieve(nativeId: String, skdUri: String) -> FairplayContentKeyRequest? {
|
|
25
|
+
lock.withLock {
|
|
26
|
+
requests[key(nativeId: nativeId, skdUri: skdUri)]
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
func removeAll(nativeId: String) {
|
|
31
|
+
lock.withLock {
|
|
32
|
+
requests = requests.filter { !$0.key.hasPrefix("\(nativeId)_") }
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
private func key(nativeId: String, skdUri: String) -> String {
|
|
37
|
+
"\(nativeId)_\(skdUri)"
|
|
38
|
+
}
|
|
39
|
+
}
|
package/ios/NetworkModule.swift
CHANGED
package/ios/PlayerModule.swift
CHANGED
|
@@ -195,10 +195,10 @@ public class PlayerModule: Module {
|
|
|
195
195
|
}.runOnQueue(.main)
|
|
196
196
|
AsyncFunction(
|
|
197
197
|
"initializeWithAnalyticsConfig"
|
|
198
|
-
) { [weak self] (nativeId: NativeId,
|
|
198
|
+
) { [weak self] (nativeId: NativeId, analyticsConfigJson: [String: Any]?, config: [String: Any]?, networkNativeId: NativeId?, _: String?) in // swiftlint:disable:this line_length
|
|
199
199
|
guard !PlayerRegistry.hasPlayer(nativeId: nativeId),
|
|
200
200
|
let playerConfig = RCTConvert.playerConfig(config),
|
|
201
|
-
let analyticsConfig = RCTConvert.analyticsConfig(
|
|
201
|
+
let analyticsConfig = RCTConvert.analyticsConfig(analyticsConfigJson) else { return }
|
|
202
202
|
#if os(iOS)
|
|
203
203
|
self?.setupRemoteControlConfig(playerConfig.remoteControlConfig)
|
|
204
204
|
#endif
|
|
@@ -206,7 +206,7 @@ public class PlayerModule: Module {
|
|
|
206
206
|
playerConfig.networkConfig = networkConfig
|
|
207
207
|
}
|
|
208
208
|
self?.setupImaBeforeInitialization(nativeId: nativeId, config: config, playerConfig: playerConfig)
|
|
209
|
-
let defaultMetadata = RCTConvert.analyticsDefaultMetadataFromAnalyticsConfig(
|
|
209
|
+
let defaultMetadata = RCTConvert.analyticsDefaultMetadataFromAnalyticsConfig(analyticsConfigJson)
|
|
210
210
|
let player = PlayerFactory.create(
|
|
211
211
|
playerConfig: playerConfig,
|
|
212
212
|
analyticsConfig: analyticsConfig,
|