bitmovin-player-react-native 0.44.1-alpha.0 → 1.0.0-alpha.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/.eslintignore +11 -0
- package/.eslintrc.js +7 -0
- package/.gitattributes +3 -0
- package/.prettierignore +11 -0
- package/.ruby-version +1 -0
- package/.swiftlint.yml +171 -0
- package/Brewfile +2 -0
- package/CHANGELOG.md +627 -0
- package/CONTRIBUTING.md +255 -0
- package/TODO.md +0 -0
- package/android/.editorconfig +8 -0
- package/android/build.gradle +78 -75
- package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/android/gradle/wrapper/gradle-wrapper.properties +7 -0
- package/android/gradle.properties +1 -0
- package/android/gradlew +248 -0
- package/android/gradlew.bat +92 -0
- package/android/ktlint.gradle +31 -0
- package/android/src/main/java/com/bitmovin/player/reactnative/ActivityLifecycleListener.kt +51 -0
- package/android/src/main/java/com/bitmovin/player/reactnative/BitmovinCastManagerModule.kt +32 -55
- package/android/src/main/java/com/bitmovin/player/reactnative/BufferModule.kt +33 -45
- package/android/src/main/java/com/bitmovin/player/reactnative/CustomMessageHandlerModule.kt +84 -0
- package/android/src/main/java/com/bitmovin/player/reactnative/DebugModule.kt +6 -14
- package/android/src/main/java/com/bitmovin/player/reactnative/DecoderConfigModule.kt +89 -44
- package/android/src/main/java/com/bitmovin/player/reactnative/DrmModule.kt +80 -99
- package/android/src/main/java/com/bitmovin/player/reactnative/EventSubscription.kt +22 -0
- package/android/src/main/java/com/bitmovin/player/reactnative/FullscreenHandlerModule.kt +100 -0
- package/android/src/main/java/com/bitmovin/player/reactnative/MediaSessionPlaybackManager.kt +5 -5
- package/android/src/main/java/com/bitmovin/player/reactnative/NetworkModule.kt +98 -56
- package/android/src/main/java/com/bitmovin/player/reactnative/OfflineModule.kt +132 -186
- package/android/src/main/java/com/bitmovin/player/reactnative/PlayerAnalyticsModule.kt +37 -36
- package/android/src/main/java/com/bitmovin/player/reactnative/PlayerModule.kt +252 -528
- package/android/src/main/java/com/bitmovin/player/reactnative/RNPlayerPackage.kt +11 -0
- package/android/src/main/java/com/bitmovin/player/reactnative/RNPlayerView.kt +558 -213
- package/android/src/main/java/com/bitmovin/player/reactnative/RNPlayerViewManager.kt +99 -286
- package/android/src/main/java/com/bitmovin/player/reactnative/ResultWaiter.kt +58 -0
- package/android/src/main/java/com/bitmovin/player/reactnative/SourceModule.kt +77 -151
- package/android/src/main/java/com/bitmovin/player/reactnative/Types.kt +44 -0
- package/android/src/main/java/com/bitmovin/player/reactnative/UuidModule.kt +12 -15
- package/android/src/main/java/com/bitmovin/player/reactnative/converter/JsonConverter.kt +296 -456
- package/android/src/main/java/com/bitmovin/player/reactnative/extensions/ListExtension.kt +89 -0
- package/android/src/main/java/com/bitmovin/player/reactnative/extensions/MapExtension.kt +95 -0
- package/android/src/main/java/com/bitmovin/player/reactnative/offline/OfflineContentManagerBridge.kt +20 -52
- package/android/src/main/java/com/bitmovin/player/reactnative/ui/CustomMessageHandlerBridge.kt +10 -20
- package/android/src/main/java/com/bitmovin/player/reactnative/ui/FullscreenHandlerBridge.kt +4 -9
- package/app.plugin.js +21 -0
- package/build/BitmovinPlayerReactNative.types.d.ts +18 -0
- package/build/BitmovinPlayerReactNative.types.d.ts.map +1 -0
- package/build/BitmovinPlayerReactNative.types.js +2 -0
- package/build/BitmovinPlayerReactNative.types.js.map +1 -0
- package/build/adaptationConfig.d.ts +18 -0
- package/build/adaptationConfig.d.ts.map +1 -0
- package/build/adaptationConfig.js +2 -0
- package/build/adaptationConfig.js.map +1 -0
- package/build/advertising.d.ts +175 -0
- package/build/advertising.d.ts.map +1 -0
- package/build/advertising.js +37 -0
- package/build/advertising.js.map +1 -0
- package/build/analytics/config.d.ts +194 -0
- package/build/analytics/config.d.ts.map +1 -0
- package/build/analytics/config.js +2 -0
- package/build/analytics/config.js.map +1 -0
- package/build/analytics/index.d.ts +3 -0
- package/build/analytics/index.d.ts.map +1 -0
- package/build/analytics/index.js +3 -0
- package/build/analytics/index.js.map +1 -0
- package/build/analytics/player.d.ts +24 -0
- package/build/analytics/player.d.ts.map +1 -0
- package/build/analytics/player.js +30 -0
- package/build/analytics/player.js.map +1 -0
- package/build/analytics/playerAnalyticsModule.d.ts +13 -0
- package/build/analytics/playerAnalyticsModule.d.ts.map +1 -0
- package/build/analytics/playerAnalyticsModule.js +3 -0
- package/build/analytics/playerAnalyticsModule.js.map +1 -0
- package/build/audioSession.d.ts +33 -0
- package/build/audioSession.d.ts.map +1 -0
- package/build/audioSession.js +21 -0
- package/build/audioSession.js.map +1 -0
- package/build/audioTrack.d.ts +39 -0
- package/build/audioTrack.d.ts.map +1 -0
- package/build/audioTrack.js +2 -0
- package/build/audioTrack.js.map +1 -0
- package/build/bitmovinCastManager.d.ts +58 -0
- package/build/bitmovinCastManager.d.ts.map +1 -0
- package/build/bitmovinCastManager.js +64 -0
- package/build/bitmovinCastManager.js.map +1 -0
- package/build/bufferApi.d.ts +85 -0
- package/build/bufferApi.d.ts.map +1 -0
- package/build/bufferApi.js +60 -0
- package/build/bufferApi.js.map +1 -0
- package/build/bufferConfig.d.ts +42 -0
- package/build/bufferConfig.d.ts.map +1 -0
- package/build/bufferConfig.js +2 -0
- package/build/bufferConfig.js.map +1 -0
- package/build/components/PlayerView/events.d.ts +310 -0
- package/build/components/PlayerView/events.d.ts.map +1 -0
- package/build/components/PlayerView/events.js +2 -0
- package/build/components/PlayerView/events.js.map +1 -0
- package/build/components/PlayerView/index.d.ts +10 -0
- package/build/components/PlayerView/index.d.ts.map +1 -0
- package/build/components/PlayerView/index.js +72 -0
- package/build/components/PlayerView/index.js.map +1 -0
- package/build/components/PlayerView/native.d.ts +30 -0
- package/build/components/PlayerView/native.d.ts.map +1 -0
- package/build/components/PlayerView/native.js +6 -0
- package/build/components/PlayerView/native.js.map +1 -0
- package/build/components/PlayerView/nativeEvents.d.ts +437 -0
- package/build/components/PlayerView/nativeEvents.d.ts.map +1 -0
- package/build/components/PlayerView/nativeEvents.js +2 -0
- package/build/components/PlayerView/nativeEvents.js.map +1 -0
- package/build/components/PlayerView/pictureInPictureConfig.d.ts +22 -0
- package/build/components/PlayerView/pictureInPictureConfig.d.ts.map +1 -0
- package/build/components/PlayerView/pictureInPictureConfig.js +2 -0
- package/build/components/PlayerView/pictureInPictureConfig.js.map +1 -0
- package/build/components/PlayerView/playerViewConfig.d.ts +111 -0
- package/build/components/PlayerView/playerViewConfig.d.ts.map +1 -0
- package/build/components/PlayerView/playerViewConfig.js +51 -0
- package/build/components/PlayerView/playerViewConfig.js.map +1 -0
- package/build/components/PlayerView/properties.d.ts +61 -0
- package/build/components/PlayerView/properties.d.ts.map +1 -0
- package/build/components/PlayerView/properties.js +2 -0
- package/build/components/PlayerView/properties.js.map +1 -0
- package/build/components/index.d.ts +5 -0
- package/build/components/index.d.ts.map +1 -0
- package/build/components/index.js +5 -0
- package/build/components/index.js.map +1 -0
- package/build/debug.d.ts +46 -0
- package/build/debug.d.ts.map +1 -0
- package/build/debug.js +52 -0
- package/build/debug.js.map +1 -0
- package/build/decoder/decoderConfig.d.ts +96 -0
- package/build/decoder/decoderConfig.d.ts.map +1 -0
- package/build/decoder/decoderConfig.js +6 -0
- package/build/decoder/decoderConfig.js.map +1 -0
- package/build/decoder/decoderConfigModule.d.ts +14 -0
- package/build/decoder/decoderConfigModule.d.ts.map +1 -0
- package/build/decoder/decoderConfigModule.js +31 -0
- package/build/decoder/decoderConfigModule.js.map +1 -0
- package/build/decoder/index.d.ts +26 -0
- package/build/decoder/index.d.ts.map +1 -0
- package/build/decoder/index.js +50 -0
- package/build/decoder/index.js.map +1 -0
- package/build/drm/drmModule.d.ts +55 -0
- package/build/drm/drmModule.d.ts.map +1 -0
- package/build/drm/drmModule.js +3 -0
- package/build/drm/drmModule.js.map +1 -0
- package/build/drm/fairplayConfig.d.ts +91 -0
- package/build/drm/fairplayConfig.d.ts.map +1 -0
- package/build/drm/fairplayConfig.js +2 -0
- package/build/drm/fairplayConfig.js.map +1 -0
- package/build/drm/index.d.ts +112 -0
- package/build/drm/index.d.ts.map +1 -0
- package/build/drm/index.js +191 -0
- package/build/drm/index.js.map +1 -0
- package/build/drm/widevineConfig.d.ts +58 -0
- package/build/drm/widevineConfig.d.ts.map +1 -0
- package/build/drm/widevineConfig.js +2 -0
- package/build/drm/widevineConfig.js.map +1 -0
- package/build/events.d.ts +692 -0
- package/build/events.d.ts.map +1 -0
- package/build/events.js +2 -0
- package/build/events.js.map +1 -0
- package/build/hooks/index.d.ts +2 -0
- package/build/hooks/index.d.ts.map +1 -0
- package/build/hooks/index.js +2 -0
- package/build/hooks/index.js.map +1 -0
- package/build/hooks/usePlayer.d.ts +8 -0
- package/build/hooks/usePlayer.d.ts.map +1 -0
- package/build/hooks/usePlayer.js +10 -0
- package/build/hooks/usePlayer.js.map +1 -0
- package/build/hooks/useProxy.d.ts +18 -0
- package/build/hooks/useProxy.d.ts.map +1 -0
- package/build/hooks/useProxy.js +16 -0
- package/build/hooks/useProxy.js.map +1 -0
- package/build/index.d.ts +32 -0
- package/build/index.d.ts.map +1 -0
- package/build/index.js +32 -0
- package/build/index.js.map +1 -0
- package/build/liveConfig.d.ts +13 -0
- package/build/liveConfig.d.ts.map +1 -0
- package/build/liveConfig.js +2 -0
- package/build/liveConfig.js.map +1 -0
- package/build/media.d.ts +85 -0
- package/build/media.d.ts.map +1 -0
- package/build/media.js +2 -0
- package/build/media.js.map +1 -0
- package/build/mediaControlConfig.d.ts +62 -0
- package/build/mediaControlConfig.d.ts.map +1 -0
- package/build/mediaControlConfig.js +2 -0
- package/build/mediaControlConfig.js.map +1 -0
- package/build/mediaTrackRole.d.ts +28 -0
- package/build/mediaTrackRole.d.ts.map +1 -0
- package/build/mediaTrackRole.js +2 -0
- package/build/mediaTrackRole.js.map +1 -0
- package/build/modules/AudioSessionModule.d.ts +8 -0
- package/build/modules/AudioSessionModule.d.ts.map +1 -0
- package/build/modules/AudioSessionModule.js +7 -0
- package/build/modules/AudioSessionModule.js.map +1 -0
- package/build/modules/BitmovinCastManagerModule.d.ts +11 -0
- package/build/modules/BitmovinCastManagerModule.d.ts.map +1 -0
- package/build/modules/BitmovinCastManagerModule.js +3 -0
- package/build/modules/BitmovinCastManagerModule.js.map +1 -0
- package/build/modules/BufferModule.d.ts +16 -0
- package/build/modules/BufferModule.d.ts.map +1 -0
- package/build/modules/BufferModule.js +3 -0
- package/build/modules/BufferModule.js.map +1 -0
- package/build/modules/DebugModule.d.ts +8 -0
- package/build/modules/DebugModule.d.ts.map +1 -0
- package/build/modules/DebugModule.js +3 -0
- package/build/modules/DebugModule.js.map +1 -0
- package/build/modules/PlayerModule.d.ts +188 -0
- package/build/modules/PlayerModule.d.ts.map +1 -0
- package/build/modules/PlayerModule.js +3 -0
- package/build/modules/PlayerModule.js.map +1 -0
- package/build/modules/SourceModule.d.ts +51 -0
- package/build/modules/SourceModule.d.ts.map +1 -0
- package/build/modules/SourceModule.js +3 -0
- package/build/modules/SourceModule.js.map +1 -0
- package/build/modules/UuidModule.d.ts +8 -0
- package/build/modules/UuidModule.d.ts.map +1 -0
- package/build/modules/UuidModule.js +3 -0
- package/build/modules/UuidModule.js.map +1 -0
- package/build/nativeInstance.d.ts +49 -0
- package/build/nativeInstance.d.ts.map +1 -0
- package/build/nativeInstance.js +20 -0
- package/build/nativeInstance.js.map +1 -0
- package/build/network/index.d.ts +50 -0
- package/build/network/index.d.ts.map +1 -0
- package/build/network/index.js +102 -0
- package/build/network/index.js.map +1 -0
- package/build/network/networkConfig.d.ts +151 -0
- package/build/network/networkConfig.d.ts.map +1 -0
- package/build/network/networkConfig.js +21 -0
- package/build/network/networkConfig.js.map +1 -0
- package/build/network/networkModule.d.ts +29 -0
- package/build/network/networkModule.d.ts.map +1 -0
- package/build/network/networkModule.js +3 -0
- package/build/network/networkModule.js.map +1 -0
- package/build/offline/index.d.ts +8 -0
- package/build/offline/index.d.ts.map +1 -0
- package/build/offline/index.js +8 -0
- package/build/offline/index.js.map +1 -0
- package/build/offline/offlineContentConfig.d.ts +18 -0
- package/build/offline/offlineContentConfig.d.ts.map +1 -0
- package/build/offline/offlineContentConfig.js +2 -0
- package/build/offline/offlineContentConfig.js.map +1 -0
- package/build/offline/offlineContentManager.d.ts +90 -0
- package/build/offline/offlineContentManager.d.ts.map +1 -0
- package/build/offline/offlineContentManager.js +177 -0
- package/build/offline/offlineContentManager.js.map +1 -0
- package/build/offline/offlineContentManagerListener.d.ts +174 -0
- package/build/offline/offlineContentManagerListener.d.ts.map +1 -0
- package/build/offline/offlineContentManagerListener.js +17 -0
- package/build/offline/offlineContentManagerListener.js.map +1 -0
- package/build/offline/offlineContentOptions.d.ts +29 -0
- package/build/offline/offlineContentOptions.d.ts.map +1 -0
- package/build/offline/offlineContentOptions.js +2 -0
- package/build/offline/offlineContentOptions.js.map +1 -0
- package/build/offline/offlineDownloadRequest.d.ts +19 -0
- package/build/offline/offlineDownloadRequest.d.ts.map +1 -0
- package/build/offline/offlineDownloadRequest.js +2 -0
- package/build/offline/offlineDownloadRequest.js.map +1 -0
- package/build/offline/offlineModule.d.ts +32 -0
- package/build/offline/offlineModule.d.ts.map +1 -0
- package/build/offline/offlineModule.js +3 -0
- package/build/offline/offlineModule.js.map +1 -0
- package/build/offline/offlineSourceOptions.d.ts +12 -0
- package/build/offline/offlineSourceOptions.d.ts.map +1 -0
- package/build/offline/offlineSourceOptions.js +2 -0
- package/build/offline/offlineSourceOptions.js.map +1 -0
- package/build/offline/offlineState.d.ts +23 -0
- package/build/offline/offlineState.d.ts.map +1 -0
- package/build/offline/offlineState.js +24 -0
- package/build/offline/offlineState.js.map +1 -0
- package/build/playbackConfig.d.ts +88 -0
- package/build/playbackConfig.d.ts.map +1 -0
- package/build/playbackConfig.js +2 -0
- package/build/playbackConfig.js.map +1 -0
- package/build/player.d.ts +308 -0
- package/build/player.d.ts.map +1 -0
- package/build/player.js +445 -0
- package/build/player.js.map +1 -0
- package/build/playerConfig.d.ts +83 -0
- package/build/playerConfig.d.ts.map +1 -0
- package/build/playerConfig.js +2 -0
- package/build/playerConfig.js.map +1 -0
- package/build/remoteControlConfig.d.ts +38 -0
- package/build/remoteControlConfig.d.ts.map +1 -0
- package/build/remoteControlConfig.js +2 -0
- package/build/remoteControlConfig.js.map +1 -0
- package/build/source.d.ts +216 -0
- package/build/source.d.ts.map +1 -0
- package/build/source.js +167 -0
- package/build/source.js.map +1 -0
- package/build/styleConfig.d.ts +120 -0
- package/build/styleConfig.d.ts.map +1 -0
- package/build/styleConfig.js +38 -0
- package/build/styleConfig.js.map +1 -0
- package/build/subtitleFormat.d.ts +27 -0
- package/build/subtitleFormat.d.ts.map +1 -0
- package/build/subtitleFormat.js +28 -0
- package/build/subtitleFormat.js.map +1 -0
- package/build/subtitleTrack.d.ts +55 -0
- package/build/subtitleTrack.d.ts.map +1 -0
- package/build/subtitleTrack.js +2 -0
- package/build/subtitleTrack.js.map +1 -0
- package/build/thumbnail.d.ts +38 -0
- package/build/thumbnail.d.ts.map +1 -0
- package/build/thumbnail.js +2 -0
- package/build/thumbnail.js.map +1 -0
- package/build/tweaksConfig.d.ts +197 -0
- package/build/tweaksConfig.d.ts.map +1 -0
- package/build/tweaksConfig.js +25 -0
- package/build/tweaksConfig.js.map +1 -0
- package/build/ui/customMessageHandlerModule.d.ts +27 -0
- package/build/ui/customMessageHandlerModule.d.ts.map +1 -0
- package/build/ui/customMessageHandlerModule.js +3 -0
- package/build/ui/customMessageHandlerModule.js.map +1 -0
- package/build/ui/custommessagehandler.d.ts +56 -0
- package/build/ui/custommessagehandler.d.ts.map +1 -0
- package/build/ui/custommessagehandler.js +54 -0
- package/build/ui/custommessagehandler.js.map +1 -0
- package/build/ui/custommessagehandlerbridge.d.ts +33 -0
- package/build/ui/custommessagehandlerbridge.d.ts.map +1 -0
- package/build/ui/custommessagehandlerbridge.js +72 -0
- package/build/ui/custommessagehandlerbridge.js.map +1 -0
- package/build/ui/custommessagesender.d.ts +5 -0
- package/build/ui/custommessagesender.d.ts.map +1 -0
- package/build/ui/custommessagesender.js +2 -0
- package/build/ui/custommessagesender.js.map +1 -0
- package/build/ui/fullscreenHandlerModule.d.ts +20 -0
- package/build/ui/fullscreenHandlerModule.d.ts.map +1 -0
- package/build/ui/fullscreenHandlerModule.js +3 -0
- package/build/ui/fullscreenHandlerModule.js.map +1 -0
- package/build/ui/fullscreenhandler.d.ts +18 -0
- package/build/ui/fullscreenhandler.d.ts.map +1 -0
- package/build/ui/fullscreenhandler.js +2 -0
- package/build/ui/fullscreenhandler.js.map +1 -0
- package/build/ui/fullscreenhandlerbridge.d.ts +26 -0
- package/build/ui/fullscreenhandlerbridge.d.ts.map +1 -0
- package/build/ui/fullscreenhandlerbridge.js +67 -0
- package/build/ui/fullscreenhandlerbridge.js.map +1 -0
- package/build/ui/index.d.ts +3 -0
- package/build/ui/index.d.ts.map +1 -0
- package/build/ui/index.js +3 -0
- package/build/ui/index.js.map +1 -0
- package/expo-module.config.json +40 -0
- package/ios/AppLifecycleDelegate.swift +25 -0
- package/ios/AudioSessionModule.swift +14 -40
- package/ios/BitmovinCastManagerModule.swift +30 -69
- package/ios/BufferModule.swift +26 -62
- package/ios/CustomMessageHandlerBridge.swift +11 -18
- package/ios/CustomMessageHandlerModule.swift +61 -63
- package/ios/DebugModule.swift +6 -27
- package/ios/DrmModule.swift +105 -379
- package/ios/Event+JSON.swift +1 -0
- package/ios/FullscreenHandlerBridge.swift +12 -5
- package/ios/FullscreenHandlerModule.swift +73 -57
- package/ios/LockedBox.swift +21 -0
- package/ios/ModuleRegistry+Generics.swift +11 -0
- package/ios/NetworkModule.swift +78 -82
- package/ios/OfflineContentManagerBridge.swift +11 -38
- package/ios/OfflineModule.swift +136 -454
- package/ios/PlayerAnalyticsModule.swift +24 -52
- package/ios/PlayerModule.swift +192 -770
- package/ios/RCTConvert+BitmovinPlayer.swift +38 -312
- package/ios/RNBitmovinPlayer.h +1 -8
- package/ios/RNBitmovinPlayer.podspec +47 -0
- package/ios/RNPlayerView.swift +600 -77
- package/ios/RNPlayerViewManager.swift +96 -210
- package/ios/Registry.swift +2 -2
- package/ios/ResultWaiter.swift +66 -0
- package/ios/SourceModule.swift +104 -223
- package/ios/UuidModule.swift +9 -18
- package/package.json +67 -71
- package/plugin/build/FeatureFlags.d.ts +24 -0
- package/plugin/build/FeatureFlags.js +2 -0
- package/plugin/build/index.d.ts +7 -0
- package/plugin/build/index.js +10 -0
- package/plugin/build/withAppGradleDependencies.d.ts +7 -0
- package/plugin/build/withAppGradleDependencies.js +49 -0
- package/plugin/build/withBitmovinAndroidConfig.d.ts +7 -0
- package/plugin/build/withBitmovinAndroidConfig.js +159 -0
- package/plugin/build/withBitmovinConfig.d.ts +7 -0
- package/plugin/build/withBitmovinConfig.js +21 -0
- package/plugin/build/withBitmovinIosConfig.d.ts +7 -0
- package/plugin/build/withBitmovinIosConfig.js +53 -0
- package/plugin/src/FeatureFlags.ts +21 -0
- package/plugin/src/index.ts +9 -0
- package/plugin/src/withAppGradleDependencies.ts +80 -0
- package/plugin/src/withBitmovinAndroidConfig.ts +224 -0
- package/plugin/src/withBitmovinConfig.ts +24 -0
- package/plugin/src/withBitmovinIosConfig.ts +71 -0
- package/plugin/tsconfig.json +9 -0
- package/plugin/tsconfig.tsbuildinfo +1 -0
- package/prettier.config.js +7 -0
- package/scripts/format-android.sh +2 -0
- package/scripts/format-swift.sh +3 -0
- package/scripts/lint-android.sh +2 -0
- package/scripts/lint-swift.sh +3 -0
- package/scripts/pre-commit.sh +14 -0
- package/scripts/setup-hooks.sh +58 -0
- package/src/BitmovinPlayerReactNative.types.ts +19 -0
- package/src/adaptationConfig.ts +1 -1
- package/src/advertising.ts +1 -1
- package/src/analytics/config.ts +4 -4
- package/src/analytics/player.ts +4 -6
- package/src/analytics/playerAnalyticsModule.ts +19 -0
- package/src/audioSession.ts +4 -6
- package/src/audioTrack.ts +1 -1
- package/src/bitmovinCastManager.ts +14 -10
- package/src/bufferApi.ts +1 -3
- package/src/bufferConfig.ts +2 -2
- package/src/components/PlayerView/events.ts +92 -94
- package/src/components/PlayerView/index.tsx +109 -159
- package/src/components/PlayerView/native.ts +24 -11
- package/src/components/PlayerView/nativeEvents.ts +113 -94
- package/src/components/PlayerView/pictureInPictureConfig.ts +1 -1
- package/src/components/PlayerView/playerViewConfig.ts +4 -8
- package/src/components/PlayerView/properties.ts +23 -22
- package/src/debug.ts +1 -3
- package/src/decoder/decoderConfig.ts +3 -3
- package/src/decoder/decoderConfigModule.ts +62 -0
- package/src/decoder/index.ts +32 -16
- package/src/drm/drmModule.ts +84 -0
- package/src/drm/fairplayConfig.ts +1 -1
- package/src/drm/index.ts +130 -40
- package/src/drm/widevineConfig.ts +5 -5
- package/src/events.ts +47 -41
- package/src/hooks/useProxy.ts +13 -20
- package/src/mediaControlConfig.ts +1 -1
- package/src/modules/AudioSessionModule.ts +13 -0
- package/src/modules/BitmovinCastManagerModule.ts +14 -0
- package/src/modules/BufferModule.ts +18 -0
- package/src/modules/DebugModule.ts +9 -0
- package/src/modules/PlayerModule.ts +251 -0
- package/src/modules/SourceModule.ts +74 -0
- package/src/modules/UuidModule.ts +9 -0
- package/src/nativeInstance.ts +3 -3
- package/src/network/index.ts +42 -15
- package/src/network/networkConfig.ts +3 -3
- package/src/network/networkModule.ts +51 -0
- package/src/offline/offlineContentConfig.ts +1 -1
- package/src/offline/offlineContentManager.ts +15 -50
- package/src/offline/offlineContentManagerListener.ts +20 -23
- package/src/offline/offlineContentOptions.ts +2 -2
- package/src/offline/offlineDownloadRequest.ts +1 -1
- package/src/offline/offlineModule.ts +46 -0
- package/src/offline/offlineSourceOptions.ts +2 -2
- package/src/offline/offlineState.ts +1 -1
- package/src/playbackConfig.ts +5 -6
- package/src/player.ts +53 -48
- package/src/source.ts +15 -14
- package/src/styleConfig.ts +5 -5
- package/src/subtitleFormat.ts +5 -5
- package/src/subtitleTrack.ts +1 -1
- package/src/tweaksConfig.ts +16 -16
- package/src/ui/customMessageHandlerModule.ts +46 -0
- package/src/ui/custommessagehandlerbridge.ts +45 -18
- package/src/ui/fullscreenHandlerModule.ts +35 -0
- package/src/ui/fullscreenhandlerbridge.ts +35 -15
- package/tsconfig.json +9 -0
- package/typedoc.json +23 -0
- package/RNBitmovinPlayer.podspec +0 -26
- package/android/src/main/java/com/bitmovin/player/reactnative/BitmovinBaseModule.kt +0 -114
- package/android/src/main/java/com/bitmovin/player/reactnative/EventRelay.kt +0 -47
- package/android/src/main/java/com/bitmovin/player/reactnative/RNPlayerViewPackage.kt +0 -48
- package/android/src/main/java/com/bitmovin/player/reactnative/extensions/ReactContextExtension.kt +0 -24
- package/android/src/main/java/com/bitmovin/player/reactnative/extensions/ReadableArray.kt +0 -20
- package/android/src/main/java/com/bitmovin/player/reactnative/extensions/ReadableMap.kt +0 -15
- package/android/src/main/java/com/bitmovin/player/reactnative/extensions/ReadableMapExtension.kt +0 -57
- package/android/src/main/java/com/bitmovin/player/reactnative/extensions/WritableMap.kt +0 -27
- package/android/src/main/java/com/bitmovin/player/reactnative/ui/CustomMessageHandlerModule.kt +0 -86
- package/android/src/main/java/com/bitmovin/player/reactnative/ui/FullscreenHandlerModule.kt +0 -78
- package/ios/AudioSessionModule.m +0 -10
- package/ios/BitmovinCastManagerModule.m +0 -14
- package/ios/BufferModule.m +0 -8
- package/ios/CustomMessageHandlerModule.m +0 -10
- package/ios/DebugModule.m +0 -7
- package/ios/DrmModule.m +0 -16
- package/ios/FullscreenHandlerModule.m +0 -10
- package/ios/NetworkModule.m +0 -10
- package/ios/OfflineModule.m +0 -19
- package/ios/PlayerAnalyticsModule.m +0 -8
- package/ios/PlayerModule.m +0 -130
- package/ios/PreprocessHttpRequestDelegateBridge.swift +0 -30
- package/ios/RCTBridge+Generics.swift +0 -6
- package/ios/RNBitmovinPlayer.xcodeproj/project.pbxproj +0 -303
- package/ios/RNPlayerView+PlayerListener.swift +0 -229
- package/ios/RNPlayerView+UserInterfaceListener.swift +0 -35
- package/ios/RNPlayerViewManager.m +0 -79
- package/ios/SourceModule.m +0 -42
- package/ios/UuidModule.m +0 -9
- package/lib/index.d.mts +0 -4303
- package/lib/index.d.ts +0 -4303
- package/lib/index.js +0 -1895
- package/lib/index.mjs +0 -1836
package/src/decoder/index.ts
CHANGED
|
@@ -1,18 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import BatchedBridge from 'react-native/Libraries/BatchedBridge/BatchedBridge';
|
|
1
|
+
import { EventSubscription } from 'expo-modules-core';
|
|
3
2
|
import { DecoderConfig, DecoderContext, MediaCodecInfo } from './decoderConfig';
|
|
4
3
|
import NativeInstance from '../nativeInstance';
|
|
5
|
-
|
|
6
|
-
const DecoderConfigModule = NativeModules.DecoderConfigModule;
|
|
4
|
+
import DecoderConfigModule from './decoderConfigModule';
|
|
7
5
|
|
|
8
6
|
/**
|
|
9
7
|
* Takes care of JS/Native communication for a `DecoderConfig`.
|
|
10
8
|
*/
|
|
11
9
|
export class DecoderConfigBridge extends NativeInstance<DecoderConfig> {
|
|
12
|
-
constructor(decoderConfig: DecoderConfig) {
|
|
13
|
-
super(decoderConfig);
|
|
14
|
-
}
|
|
15
|
-
|
|
16
10
|
/**
|
|
17
11
|
* Whether this object's native instance has been created.
|
|
18
12
|
*/
|
|
@@ -22,14 +16,35 @@ export class DecoderConfigBridge extends NativeInstance<DecoderConfig> {
|
|
|
22
16
|
*/
|
|
23
17
|
isDestroyed = false;
|
|
24
18
|
|
|
19
|
+
private onOverrideDecodersPrioritySubscription?: EventSubscription;
|
|
20
|
+
|
|
25
21
|
initialize() {
|
|
26
22
|
if (!this.isInitialized) {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
23
|
+
// Set up event listener for decoder priority override
|
|
24
|
+
this.onOverrideDecodersPrioritySubscription =
|
|
25
|
+
DecoderConfigModule.addListener(
|
|
26
|
+
'onOverrideDecodersPriority',
|
|
27
|
+
({
|
|
28
|
+
nativeId,
|
|
29
|
+
context,
|
|
30
|
+
preferredDecoders,
|
|
31
|
+
}: {
|
|
32
|
+
nativeId: string;
|
|
33
|
+
context: DecoderContext;
|
|
34
|
+
preferredDecoders: MediaCodecInfo[];
|
|
35
|
+
}) => {
|
|
36
|
+
if (nativeId !== this.nativeId) {
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
this.overrideDecodersPriority(context, preferredDecoders);
|
|
40
|
+
}
|
|
41
|
+
);
|
|
42
|
+
|
|
31
43
|
// Create native configuration object.
|
|
32
|
-
DecoderConfigModule.
|
|
44
|
+
DecoderConfigModule.initializeWithConfig(
|
|
45
|
+
this.nativeId,
|
|
46
|
+
this.config || {}
|
|
47
|
+
);
|
|
33
48
|
this.isInitialized = true;
|
|
34
49
|
}
|
|
35
50
|
}
|
|
@@ -40,17 +55,18 @@ export class DecoderConfigBridge extends NativeInstance<DecoderConfig> {
|
|
|
40
55
|
destroy() {
|
|
41
56
|
if (!this.isDestroyed) {
|
|
42
57
|
DecoderConfigModule.destroy(this.nativeId);
|
|
58
|
+
this.onOverrideDecodersPrioritySubscription?.remove();
|
|
59
|
+
this.onOverrideDecodersPrioritySubscription = undefined;
|
|
43
60
|
this.isDestroyed = true;
|
|
44
61
|
}
|
|
45
62
|
}
|
|
46
63
|
|
|
47
|
-
// noinspection JSUnusedGlobalSymbols
|
|
48
64
|
/**
|
|
49
65
|
* Called by native code, when the decoder priority should be evaluated.
|
|
50
66
|
*/
|
|
51
|
-
overrideDecodersPriority(
|
|
67
|
+
private overrideDecodersPriority(
|
|
52
68
|
context: DecoderContext,
|
|
53
|
-
preferredDecoders: [
|
|
69
|
+
preferredDecoders: MediaCodecInfo[]
|
|
54
70
|
): void {
|
|
55
71
|
const orderedPriority =
|
|
56
72
|
this.config?.decoderPriorityProvider?.overrideDecodersPriority(
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { NativeModule, requireNativeModule } from 'expo-modules-core';
|
|
2
|
+
import { DrmConfig } from './index';
|
|
3
|
+
|
|
4
|
+
export type DrmModuleEvents = {
|
|
5
|
+
onPrepareCertificate: ({
|
|
6
|
+
nativeId,
|
|
7
|
+
id,
|
|
8
|
+
certificate,
|
|
9
|
+
}: {
|
|
10
|
+
nativeId: string;
|
|
11
|
+
id: string;
|
|
12
|
+
certificate: string;
|
|
13
|
+
}) => void;
|
|
14
|
+
onPrepareMessage: ({
|
|
15
|
+
nativeId,
|
|
16
|
+
id,
|
|
17
|
+
data,
|
|
18
|
+
message,
|
|
19
|
+
assetId,
|
|
20
|
+
}: {
|
|
21
|
+
nativeId: string;
|
|
22
|
+
id: string;
|
|
23
|
+
data?: string;
|
|
24
|
+
message?: string;
|
|
25
|
+
assetId?: string;
|
|
26
|
+
}) => void;
|
|
27
|
+
onPrepareSyncMessage: ({
|
|
28
|
+
nativeId,
|
|
29
|
+
id,
|
|
30
|
+
syncMessage,
|
|
31
|
+
assetId,
|
|
32
|
+
}: {
|
|
33
|
+
nativeId: string;
|
|
34
|
+
id: string;
|
|
35
|
+
syncMessage: string;
|
|
36
|
+
assetId: string;
|
|
37
|
+
}) => void;
|
|
38
|
+
onPrepareLicense: ({
|
|
39
|
+
nativeId,
|
|
40
|
+
id,
|
|
41
|
+
data,
|
|
42
|
+
license,
|
|
43
|
+
}: {
|
|
44
|
+
nativeId: string;
|
|
45
|
+
id: string;
|
|
46
|
+
data?: string;
|
|
47
|
+
license?: string;
|
|
48
|
+
}) => void;
|
|
49
|
+
onPrepareLicenseServerUrl: ({
|
|
50
|
+
nativeId,
|
|
51
|
+
id,
|
|
52
|
+
licenseServerUrl,
|
|
53
|
+
}: {
|
|
54
|
+
nativeId: string;
|
|
55
|
+
id: string;
|
|
56
|
+
licenseServerUrl: string;
|
|
57
|
+
}) => void;
|
|
58
|
+
onPrepareContentId: ({
|
|
59
|
+
nativeId,
|
|
60
|
+
id,
|
|
61
|
+
contentId,
|
|
62
|
+
}: {
|
|
63
|
+
nativeId: string;
|
|
64
|
+
id: string;
|
|
65
|
+
contentId: string;
|
|
66
|
+
}) => void;
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Native DrmModule using Expo modules API.
|
|
71
|
+
* Provides modern async/await interface while maintaining backward compatibility.
|
|
72
|
+
*/
|
|
73
|
+
declare class DrmModule extends NativeModule<DrmModuleEvents> {
|
|
74
|
+
initializeWithConfig(nativeId: string, config: DrmConfig): Promise<void>;
|
|
75
|
+
destroy(nativeId: string): Promise<void>;
|
|
76
|
+
setPreparedCertificate(id: string, certificate: string): any;
|
|
77
|
+
setPreparedMessage(id: string, message?: string): any;
|
|
78
|
+
setPreparedSyncMessage(id: string, syncMessage?: string): any;
|
|
79
|
+
setPreparedLicense(id: string, license?: string): any;
|
|
80
|
+
setPreparedLicenseServerUrl(id: string, url?: string): any;
|
|
81
|
+
setPreparedContentId(id: string, contentId?: string): any;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export default requireNativeModule<DrmModule>('DrmModule');
|
|
@@ -51,7 +51,7 @@ export interface FairplayConfig {
|
|
|
51
51
|
* Note that both the passed `syncMessage` data and this block return value should be a Base64
|
|
52
52
|
* string. So use whatever solution suits you best to handle Base64 in React Native.
|
|
53
53
|
*
|
|
54
|
-
* @param
|
|
54
|
+
* @param syncMessage - Base64 encoded message data.
|
|
55
55
|
* @param assetId - Asset ID.
|
|
56
56
|
* @returns The processed Base64 encoded sync message.
|
|
57
57
|
*/
|
package/src/drm/index.ts
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import { Platform } from 'react-native';
|
|
2
|
+
import { EventSubscription } from 'expo-modules-core';
|
|
3
3
|
import NativeInstance, { NativeInstanceConfig } from '../nativeInstance';
|
|
4
4
|
import { FairplayConfig } from './fairplayConfig';
|
|
5
5
|
import { WidevineConfig } from './widevineConfig';
|
|
6
|
+
import DrmModule from './drmModule';
|
|
6
7
|
|
|
7
8
|
// Export config types from DRM module.
|
|
8
9
|
export { FairplayConfig, WidevineConfig };
|
|
9
10
|
|
|
10
|
-
const DrmModule = NativeModules.DrmModule;
|
|
11
|
-
|
|
12
11
|
/**
|
|
13
12
|
* Represents the general Streaming DRM config.
|
|
14
13
|
*/
|
|
@@ -16,13 +15,13 @@ export interface DrmConfig extends NativeInstanceConfig {
|
|
|
16
15
|
/**
|
|
17
16
|
* FairPlay specific configuration.
|
|
18
17
|
*
|
|
19
|
-
* @
|
|
18
|
+
* @remarks Platform: iOS
|
|
20
19
|
*/
|
|
21
20
|
fairplay?: FairplayConfig;
|
|
22
21
|
/**
|
|
23
22
|
* Widevine specific configuration.
|
|
24
23
|
*
|
|
25
|
-
* @
|
|
24
|
+
* @remarks Platform: Android, iOS (only for casting).
|
|
26
25
|
*/
|
|
27
26
|
widevine?: WidevineConfig;
|
|
28
27
|
}
|
|
@@ -41,16 +40,20 @@ export class Drm extends NativeInstance<DrmConfig> {
|
|
|
41
40
|
*/
|
|
42
41
|
isDestroyed = false;
|
|
43
42
|
|
|
43
|
+
private eventSubscriptions: EventSubscription[] = [];
|
|
44
|
+
|
|
44
45
|
/**
|
|
45
46
|
* Allocates the DRM config instance and its resources natively.
|
|
46
47
|
*/
|
|
47
|
-
initialize = () => {
|
|
48
|
+
initialize = async () => {
|
|
48
49
|
if (!this.isInitialized) {
|
|
49
|
-
//
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
// Create native configuration object.
|
|
53
|
-
|
|
50
|
+
// Set up event listeners for DRM preparation callbacks
|
|
51
|
+
this.setupEventListeners();
|
|
52
|
+
|
|
53
|
+
// Create native configuration object using Expo module.
|
|
54
|
+
if (this.config) {
|
|
55
|
+
await DrmModule.initializeWithConfig(this.nativeId, this.config);
|
|
56
|
+
}
|
|
54
57
|
this.isInitialized = true;
|
|
55
58
|
}
|
|
56
59
|
};
|
|
@@ -58,13 +61,85 @@ export class Drm extends NativeInstance<DrmConfig> {
|
|
|
58
61
|
/**
|
|
59
62
|
* Destroys the native DRM config and releases all of its allocated resources.
|
|
60
63
|
*/
|
|
61
|
-
destroy = () => {
|
|
64
|
+
destroy = async () => {
|
|
62
65
|
if (!this.isDestroyed) {
|
|
63
|
-
DrmModule.destroy(this.nativeId);
|
|
66
|
+
await DrmModule.destroy(this.nativeId);
|
|
67
|
+
// Clean up event subscriptions
|
|
68
|
+
this.eventSubscriptions.forEach((subscription) => subscription.remove());
|
|
69
|
+
this.eventSubscriptions = [];
|
|
64
70
|
this.isDestroyed = true;
|
|
65
71
|
}
|
|
66
72
|
};
|
|
67
73
|
|
|
74
|
+
/**
|
|
75
|
+
* Sets up event listeners for all DRM preparation callbacks
|
|
76
|
+
*/
|
|
77
|
+
private setupEventListeners() {
|
|
78
|
+
// iOS-only events
|
|
79
|
+
this.eventSubscriptions.push(
|
|
80
|
+
DrmModule.addListener(
|
|
81
|
+
'onPrepareCertificate',
|
|
82
|
+
({ nativeId, id, certificate }) => {
|
|
83
|
+
if (nativeId !== this.nativeId) return;
|
|
84
|
+
this.onPrepareCertificate(id, certificate);
|
|
85
|
+
}
|
|
86
|
+
)
|
|
87
|
+
);
|
|
88
|
+
|
|
89
|
+
this.eventSubscriptions.push(
|
|
90
|
+
DrmModule.addListener(
|
|
91
|
+
'onPrepareSyncMessage',
|
|
92
|
+
({ nativeId, id, syncMessage, assetId }) => {
|
|
93
|
+
if (nativeId !== this.nativeId) return;
|
|
94
|
+
this.onPrepareSyncMessage(id, syncMessage, assetId);
|
|
95
|
+
}
|
|
96
|
+
)
|
|
97
|
+
);
|
|
98
|
+
|
|
99
|
+
this.eventSubscriptions.push(
|
|
100
|
+
DrmModule.addListener(
|
|
101
|
+
'onPrepareLicenseServerUrl',
|
|
102
|
+
({ nativeId, id, licenseServerUrl }) => {
|
|
103
|
+
if (nativeId !== this.nativeId) return;
|
|
104
|
+
this.onPrepareLicenseServerUrl(id, licenseServerUrl);
|
|
105
|
+
}
|
|
106
|
+
)
|
|
107
|
+
);
|
|
108
|
+
|
|
109
|
+
this.eventSubscriptions.push(
|
|
110
|
+
DrmModule.addListener(
|
|
111
|
+
'onPrepareContentId',
|
|
112
|
+
({ nativeId, id, contentId }) => {
|
|
113
|
+
if (nativeId !== this.nativeId) return;
|
|
114
|
+
this.onPrepareContentId(id, contentId);
|
|
115
|
+
}
|
|
116
|
+
)
|
|
117
|
+
);
|
|
118
|
+
|
|
119
|
+
// Cross-platform events
|
|
120
|
+
this.eventSubscriptions.push(
|
|
121
|
+
DrmModule.addListener(
|
|
122
|
+
'onPrepareMessage',
|
|
123
|
+
({ nativeId, id, data, message, assetId }) => {
|
|
124
|
+
if (nativeId !== this.nativeId) return;
|
|
125
|
+
// Android sends 'data', iOS sends 'message'
|
|
126
|
+
this.onPrepareMessage(id, data || message, assetId);
|
|
127
|
+
}
|
|
128
|
+
)
|
|
129
|
+
);
|
|
130
|
+
|
|
131
|
+
this.eventSubscriptions.push(
|
|
132
|
+
DrmModule.addListener(
|
|
133
|
+
'onPrepareLicense',
|
|
134
|
+
({ nativeId, id, data, license }) => {
|
|
135
|
+
if (nativeId !== this.nativeId) return;
|
|
136
|
+
// Android sends 'data', iOS sends 'license'
|
|
137
|
+
this.onPrepareLicense(id, data || license);
|
|
138
|
+
}
|
|
139
|
+
)
|
|
140
|
+
);
|
|
141
|
+
}
|
|
142
|
+
|
|
68
143
|
/**
|
|
69
144
|
* iOS only.
|
|
70
145
|
*
|
|
@@ -75,12 +150,10 @@ export class Drm extends NativeInstance<DrmConfig> {
|
|
|
75
150
|
*
|
|
76
151
|
* @param certificate - Base64 encoded certificate data.
|
|
77
152
|
*/
|
|
78
|
-
onPrepareCertificate = (certificate: string) => {
|
|
153
|
+
private onPrepareCertificate = (id: string, certificate: string) => {
|
|
79
154
|
if (this.config?.fairplay?.prepareCertificate) {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
this.config?.fairplay?.prepareCertificate?.(certificate)
|
|
83
|
-
);
|
|
155
|
+
const result = this.config?.fairplay?.prepareCertificate?.(certificate);
|
|
156
|
+
DrmModule.setPreparedCertificate(id, result);
|
|
84
157
|
}
|
|
85
158
|
};
|
|
86
159
|
|
|
@@ -93,16 +166,23 @@ export class Drm extends NativeInstance<DrmConfig> {
|
|
|
93
166
|
* @param message - Base64 encoded message data.
|
|
94
167
|
* @param assetId - Optional asset ID. Only sent by iOS.
|
|
95
168
|
*/
|
|
96
|
-
onPrepareMessage = (
|
|
169
|
+
private onPrepareMessage = (
|
|
170
|
+
id: string,
|
|
171
|
+
message?: string,
|
|
172
|
+
assetId?: string
|
|
173
|
+
) => {
|
|
174
|
+
if (!message) {
|
|
175
|
+
DrmModule.setPreparedMessage(id, undefined);
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
97
178
|
const config =
|
|
98
179
|
Platform.OS === 'ios' ? this.config?.fairplay : this.config?.widevine;
|
|
99
180
|
if (config && config.prepareMessage) {
|
|
100
|
-
|
|
101
|
-
this.nativeId,
|
|
181
|
+
const result =
|
|
102
182
|
Platform.OS === 'ios'
|
|
103
183
|
? (config as FairplayConfig).prepareMessage?.(message, assetId!)
|
|
104
|
-
: (config as WidevineConfig).prepareMessage?.(message)
|
|
105
|
-
);
|
|
184
|
+
: (config as WidevineConfig).prepareMessage?.(message);
|
|
185
|
+
DrmModule.setPreparedMessage(id, result);
|
|
106
186
|
}
|
|
107
187
|
};
|
|
108
188
|
|
|
@@ -116,12 +196,17 @@ export class Drm extends NativeInstance<DrmConfig> {
|
|
|
116
196
|
*
|
|
117
197
|
* @param syncMessage - Base64 encoded sync SPC message data.
|
|
118
198
|
*/
|
|
119
|
-
onPrepareSyncMessage = (
|
|
199
|
+
private onPrepareSyncMessage = (
|
|
200
|
+
id: string,
|
|
201
|
+
syncMessage: string,
|
|
202
|
+
assetId: string
|
|
203
|
+
) => {
|
|
120
204
|
if (this.config?.fairplay?.prepareSyncMessage) {
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
205
|
+
const result = this.config?.fairplay?.prepareSyncMessage?.(
|
|
206
|
+
syncMessage,
|
|
207
|
+
assetId
|
|
124
208
|
);
|
|
209
|
+
DrmModule.setPreparedSyncMessage(id, result);
|
|
125
210
|
}
|
|
126
211
|
};
|
|
127
212
|
|
|
@@ -133,13 +218,17 @@ export class Drm extends NativeInstance<DrmConfig> {
|
|
|
133
218
|
*
|
|
134
219
|
* @param license - Base64 encoded license data.
|
|
135
220
|
*/
|
|
136
|
-
onPrepareLicense = (
|
|
221
|
+
private onPrepareLicense = (id: string, license?: string) => {
|
|
222
|
+
if (!license) {
|
|
223
|
+
DrmModule.setPreparedLicense(id, undefined);
|
|
224
|
+
return;
|
|
225
|
+
}
|
|
137
226
|
const prepareLicense =
|
|
138
227
|
Platform.OS === 'ios'
|
|
139
228
|
? this.config?.fairplay?.prepareLicense
|
|
140
229
|
: this.config?.widevine?.prepareLicense;
|
|
141
230
|
if (prepareLicense) {
|
|
142
|
-
DrmModule.setPreparedLicense(
|
|
231
|
+
DrmModule.setPreparedLicense(id, prepareLicense(license));
|
|
143
232
|
}
|
|
144
233
|
};
|
|
145
234
|
|
|
@@ -153,12 +242,14 @@ export class Drm extends NativeInstance<DrmConfig> {
|
|
|
153
242
|
*
|
|
154
243
|
* @param licenseServerUrl - The license server URL string.
|
|
155
244
|
*/
|
|
156
|
-
onPrepareLicenseServerUrl = (
|
|
245
|
+
private onPrepareLicenseServerUrl = (
|
|
246
|
+
id: string,
|
|
247
|
+
licenseServerUrl: string
|
|
248
|
+
) => {
|
|
157
249
|
if (this.config?.fairplay?.prepareLicenseServerUrl) {
|
|
158
|
-
|
|
159
|
-
this.
|
|
160
|
-
|
|
161
|
-
);
|
|
250
|
+
const result =
|
|
251
|
+
this.config?.fairplay?.prepareLicenseServerUrl?.(licenseServerUrl);
|
|
252
|
+
DrmModule.setPreparedLicenseServerUrl(id, result);
|
|
162
253
|
}
|
|
163
254
|
};
|
|
164
255
|
|
|
@@ -172,12 +263,11 @@ export class Drm extends NativeInstance<DrmConfig> {
|
|
|
172
263
|
*
|
|
173
264
|
* @param contentId - The extracted contentId string.
|
|
174
265
|
*/
|
|
175
|
-
onPrepareContentId = (contentId: string) => {
|
|
266
|
+
private onPrepareContentId = (id: string, contentId: string) => {
|
|
267
|
+
console.log('onPrepareContentId', contentId);
|
|
176
268
|
if (this.config?.fairplay?.prepareContentId) {
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
this.config?.fairplay?.prepareContentId?.(contentId)
|
|
180
|
-
);
|
|
269
|
+
const result = this.config?.fairplay?.prepareContentId?.(contentId);
|
|
270
|
+
DrmModule.setPreparedContentId(id, result);
|
|
181
271
|
}
|
|
182
272
|
};
|
|
183
273
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Represents a Widevine Streaming DRM config.
|
|
3
|
-
* @
|
|
3
|
+
* @remarks Platform: Android, iOS (only for casting).
|
|
4
4
|
*/
|
|
5
5
|
export interface WidevineConfig {
|
|
6
6
|
/**
|
|
@@ -19,7 +19,7 @@ export interface WidevineConfig {
|
|
|
19
19
|
* Note that both the passed `message` data and this block return value should be a Base64 string.
|
|
20
20
|
* So use whatever solution suits you best to handle Base64 in React Native.
|
|
21
21
|
*
|
|
22
|
-
* @
|
|
22
|
+
* @remarks Platform: Android
|
|
23
23
|
*
|
|
24
24
|
* @param message - Base64 encoded message data.
|
|
25
25
|
* @returns The processed Base64 encoded message.
|
|
@@ -33,7 +33,7 @@ export interface WidevineConfig {
|
|
|
33
33
|
* Note that both the passed `license` data and this block return value should be a Base64 string.
|
|
34
34
|
* So use whatever solution suits you best to handle Base64 in React Native.
|
|
35
35
|
*
|
|
36
|
-
* @
|
|
36
|
+
* @remarks Platform: Android
|
|
37
37
|
*
|
|
38
38
|
* @param license - Base64 encoded license data.
|
|
39
39
|
* @returns The processed Base64 encoded license.
|
|
@@ -42,7 +42,7 @@ export interface WidevineConfig {
|
|
|
42
42
|
/**
|
|
43
43
|
* Set widevine's preferred security level.
|
|
44
44
|
*
|
|
45
|
-
* @
|
|
45
|
+
* @remarks Platform: Android
|
|
46
46
|
*/
|
|
47
47
|
preferredSecurityLevel?: string;
|
|
48
48
|
/**
|
|
@@ -51,7 +51,7 @@ export interface WidevineConfig {
|
|
|
51
51
|
* as the same DRM scheme information.
|
|
52
52
|
* Default: `false`
|
|
53
53
|
*
|
|
54
|
-
* @
|
|
54
|
+
* @remarks Platform: Android
|
|
55
55
|
*/
|
|
56
56
|
shouldKeepDrmSessionsAlive?: boolean;
|
|
57
57
|
}
|