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
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import NativeInstance from '../nativeInstance';
|
|
2
|
+
import DecoderConfigModule from './decoderConfigModule';
|
|
3
|
+
/**
|
|
4
|
+
* Takes care of JS/Native communication for a `DecoderConfig`.
|
|
5
|
+
*/
|
|
6
|
+
export class DecoderConfigBridge extends NativeInstance {
|
|
7
|
+
/**
|
|
8
|
+
* Whether this object's native instance has been created.
|
|
9
|
+
*/
|
|
10
|
+
isInitialized = false;
|
|
11
|
+
/**
|
|
12
|
+
* Whether this object's native instance has been disposed.
|
|
13
|
+
*/
|
|
14
|
+
isDestroyed = false;
|
|
15
|
+
onOverrideDecodersPrioritySubscription;
|
|
16
|
+
initialize() {
|
|
17
|
+
if (!this.isInitialized) {
|
|
18
|
+
// Set up event listener for decoder priority override
|
|
19
|
+
this.onOverrideDecodersPrioritySubscription =
|
|
20
|
+
DecoderConfigModule.addListener('onOverrideDecodersPriority', ({ nativeId, context, preferredDecoders, }) => {
|
|
21
|
+
if (nativeId !== this.nativeId) {
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
this.overrideDecodersPriority(context, preferredDecoders);
|
|
25
|
+
});
|
|
26
|
+
// Create native configuration object.
|
|
27
|
+
DecoderConfigModule.initializeWithConfig(this.nativeId, this.config || {});
|
|
28
|
+
this.isInitialized = true;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Destroys the native `DecoderConfig`
|
|
33
|
+
*/
|
|
34
|
+
destroy() {
|
|
35
|
+
if (!this.isDestroyed) {
|
|
36
|
+
DecoderConfigModule.destroy(this.nativeId);
|
|
37
|
+
this.onOverrideDecodersPrioritySubscription?.remove();
|
|
38
|
+
this.onOverrideDecodersPrioritySubscription = undefined;
|
|
39
|
+
this.isDestroyed = true;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Called by native code, when the decoder priority should be evaluated.
|
|
44
|
+
*/
|
|
45
|
+
overrideDecodersPriority(context, preferredDecoders) {
|
|
46
|
+
const orderedPriority = this.config?.decoderPriorityProvider?.overrideDecodersPriority(context, preferredDecoders) ?? preferredDecoders;
|
|
47
|
+
DecoderConfigModule.overrideDecoderPriorityProviderComplete(this.nativeId, orderedPriority);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/decoder/index.ts"],"names":[],"mappings":"AAEA,OAAO,cAAc,MAAM,mBAAmB,CAAC;AAC/C,OAAO,mBAAmB,MAAM,uBAAuB,CAAC;AAExD;;GAEG;AACH,MAAM,OAAO,mBAAoB,SAAQ,cAA6B;IACpE;;OAEG;IACH,aAAa,GAAG,KAAK,CAAC;IACtB;;OAEG;IACH,WAAW,GAAG,KAAK,CAAC;IAEZ,sCAAsC,CAAqB;IAEnE,UAAU;QACR,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,CAAC;YACxB,sDAAsD;YACtD,IAAI,CAAC,sCAAsC;gBACzC,mBAAmB,CAAC,WAAW,CAC7B,4BAA4B,EAC5B,CAAC,EACC,QAAQ,EACR,OAAO,EACP,iBAAiB,GAKlB,EAAE,EAAE;oBACH,IAAI,QAAQ,KAAK,IAAI,CAAC,QAAQ,EAAE,CAAC;wBAC/B,OAAO;oBACT,CAAC;oBACD,IAAI,CAAC,wBAAwB,CAAC,OAAO,EAAE,iBAAiB,CAAC,CAAC;gBAC5D,CAAC,CACF,CAAC;YAEJ,sCAAsC;YACtC,mBAAmB,CAAC,oBAAoB,CACtC,IAAI,CAAC,QAAQ,EACb,IAAI,CAAC,MAAM,IAAI,EAAE,CAClB,CAAC;YACF,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC;QAC5B,CAAC;IACH,CAAC;IAED;;OAEG;IACH,OAAO;QACL,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;YACtB,mBAAmB,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YAC3C,IAAI,CAAC,sCAAsC,EAAE,MAAM,EAAE,CAAC;YACtD,IAAI,CAAC,sCAAsC,GAAG,SAAS,CAAC;YACxD,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;QAC1B,CAAC;IACH,CAAC;IAED;;OAEG;IACK,wBAAwB,CAC9B,OAAuB,EACvB,iBAAmC;QAEnC,MAAM,eAAe,GACnB,IAAI,CAAC,MAAM,EAAE,uBAAuB,EAAE,wBAAwB,CAC5D,OAAO,EACP,iBAAiB,CAClB,IAAI,iBAAiB,CAAC;QAEzB,mBAAmB,CAAC,uCAAuC,CACzD,IAAI,CAAC,QAAQ,EACb,eAAe,CAChB,CAAC;IACJ,CAAC;CACF","sourcesContent":["import { EventSubscription } from 'expo-modules-core';\nimport { DecoderConfig, DecoderContext, MediaCodecInfo } from './decoderConfig';\nimport NativeInstance from '../nativeInstance';\nimport DecoderConfigModule from './decoderConfigModule';\n\n/**\n * Takes care of JS/Native communication for a `DecoderConfig`.\n */\nexport class DecoderConfigBridge extends NativeInstance<DecoderConfig> {\n /**\n * Whether this object's native instance has been created.\n */\n isInitialized = false;\n /**\n * Whether this object's native instance has been disposed.\n */\n isDestroyed = false;\n\n private onOverrideDecodersPrioritySubscription?: EventSubscription;\n\n initialize() {\n if (!this.isInitialized) {\n // Set up event listener for decoder priority override\n this.onOverrideDecodersPrioritySubscription =\n DecoderConfigModule.addListener(\n 'onOverrideDecodersPriority',\n ({\n nativeId,\n context,\n preferredDecoders,\n }: {\n nativeId: string;\n context: DecoderContext;\n preferredDecoders: MediaCodecInfo[];\n }) => {\n if (nativeId !== this.nativeId) {\n return;\n }\n this.overrideDecodersPriority(context, preferredDecoders);\n }\n );\n\n // Create native configuration object.\n DecoderConfigModule.initializeWithConfig(\n this.nativeId,\n this.config || {}\n );\n this.isInitialized = true;\n }\n }\n\n /**\n * Destroys the native `DecoderConfig`\n */\n destroy() {\n if (!this.isDestroyed) {\n DecoderConfigModule.destroy(this.nativeId);\n this.onOverrideDecodersPrioritySubscription?.remove();\n this.onOverrideDecodersPrioritySubscription = undefined;\n this.isDestroyed = true;\n }\n }\n\n /**\n * Called by native code, when the decoder priority should be evaluated.\n */\n private overrideDecodersPriority(\n context: DecoderContext,\n preferredDecoders: MediaCodecInfo[]\n ): void {\n const orderedPriority =\n this.config?.decoderPriorityProvider?.overrideDecodersPriority(\n context,\n preferredDecoders\n ) ?? preferredDecoders;\n\n DecoderConfigModule.overrideDecoderPriorityProviderComplete(\n this.nativeId,\n orderedPriority\n );\n }\n}\n"]}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { NativeModule } from 'expo-modules-core';
|
|
2
|
+
import { DrmConfig } from './index';
|
|
3
|
+
export type DrmModuleEvents = {
|
|
4
|
+
onPrepareCertificate: ({ nativeId, id, certificate, }: {
|
|
5
|
+
nativeId: string;
|
|
6
|
+
id: string;
|
|
7
|
+
certificate: string;
|
|
8
|
+
}) => void;
|
|
9
|
+
onPrepareMessage: ({ nativeId, id, data, message, assetId, }: {
|
|
10
|
+
nativeId: string;
|
|
11
|
+
id: string;
|
|
12
|
+
data?: string;
|
|
13
|
+
message?: string;
|
|
14
|
+
assetId?: string;
|
|
15
|
+
}) => void;
|
|
16
|
+
onPrepareSyncMessage: ({ nativeId, id, syncMessage, assetId, }: {
|
|
17
|
+
nativeId: string;
|
|
18
|
+
id: string;
|
|
19
|
+
syncMessage: string;
|
|
20
|
+
assetId: string;
|
|
21
|
+
}) => void;
|
|
22
|
+
onPrepareLicense: ({ nativeId, id, data, license, }: {
|
|
23
|
+
nativeId: string;
|
|
24
|
+
id: string;
|
|
25
|
+
data?: string;
|
|
26
|
+
license?: string;
|
|
27
|
+
}) => void;
|
|
28
|
+
onPrepareLicenseServerUrl: ({ nativeId, id, licenseServerUrl, }: {
|
|
29
|
+
nativeId: string;
|
|
30
|
+
id: string;
|
|
31
|
+
licenseServerUrl: string;
|
|
32
|
+
}) => void;
|
|
33
|
+
onPrepareContentId: ({ nativeId, id, contentId, }: {
|
|
34
|
+
nativeId: string;
|
|
35
|
+
id: string;
|
|
36
|
+
contentId: string;
|
|
37
|
+
}) => void;
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* Native DrmModule using Expo modules API.
|
|
41
|
+
* Provides modern async/await interface while maintaining backward compatibility.
|
|
42
|
+
*/
|
|
43
|
+
declare class DrmModule extends NativeModule<DrmModuleEvents> {
|
|
44
|
+
initializeWithConfig(nativeId: string, config: DrmConfig): Promise<void>;
|
|
45
|
+
destroy(nativeId: string): Promise<void>;
|
|
46
|
+
setPreparedCertificate(id: string, certificate: string): any;
|
|
47
|
+
setPreparedMessage(id: string, message?: string): any;
|
|
48
|
+
setPreparedSyncMessage(id: string, syncMessage?: string): any;
|
|
49
|
+
setPreparedLicense(id: string, license?: string): any;
|
|
50
|
+
setPreparedLicenseServerUrl(id: string, url?: string): any;
|
|
51
|
+
setPreparedContentId(id: string, contentId?: string): any;
|
|
52
|
+
}
|
|
53
|
+
declare const _default: DrmModule;
|
|
54
|
+
export default _default;
|
|
55
|
+
//# sourceMappingURL=drmModule.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drmModule.d.ts","sourceRoot":"","sources":["../../src/drm/drmModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAuB,MAAM,mBAAmB,CAAC;AACtE,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEpC,MAAM,MAAM,eAAe,GAAG;IAC5B,oBAAoB,EAAE,CAAC,EACrB,QAAQ,EACR,EAAE,EACF,WAAW,GACZ,EAAE;QACD,QAAQ,EAAE,MAAM,CAAC;QACjB,EAAE,EAAE,MAAM,CAAC;QACX,WAAW,EAAE,MAAM,CAAC;KACrB,KAAK,IA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C,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC;IACxE,OAAO,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IACxC,sBAAsB,CAAC,EAAE,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,GAAG;IAC5D,kBAAkB,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,GAAG;IACrD,sBAAsB,CAAC,EAAE,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,GAAG;IAC7D,kBAAkB,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,GAAG;IACrD,2BAA2B,CAAC,EAAE,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,GAAG;IAC1D,oBAAoB,CAAC,EAAE,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,GAAG;CAC1D;;AAED,wBAA2D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drmModule.js","sourceRoot":"","sources":["../../src/drm/drmModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAmFtE,eAAe,mBAAmB,CAAY,WAAW,CAAC,CAAC","sourcesContent":["import { NativeModule, requireNativeModule } from 'expo-modules-core';\nimport { DrmConfig } from './index';\n\nexport type DrmModuleEvents = {\n onPrepareCertificate: ({\n nativeId,\n id,\n certificate,\n }: {\n nativeId: string;\n id: string;\n certificate: string;\n }) => void;\n onPrepareMessage: ({\n nativeId,\n id,\n data,\n message,\n assetId,\n }: {\n nativeId: string;\n id: string;\n data?: string;\n message?: string;\n assetId?: string;\n }) => void;\n onPrepareSyncMessage: ({\n nativeId,\n id,\n syncMessage,\n assetId,\n }: {\n nativeId: string;\n id: string;\n syncMessage: string;\n assetId: string;\n }) => void;\n onPrepareLicense: ({\n nativeId,\n id,\n data,\n license,\n }: {\n nativeId: string;\n id: string;\n data?: string;\n license?: string;\n }) => void;\n onPrepareLicenseServerUrl: ({\n nativeId,\n id,\n licenseServerUrl,\n }: {\n nativeId: string;\n id: string;\n licenseServerUrl: string;\n }) => void;\n onPrepareContentId: ({\n nativeId,\n id,\n contentId,\n }: {\n nativeId: string;\n id: string;\n contentId: string;\n }) => void;\n};\n\n/**\n * Native DrmModule using Expo modules API.\n * Provides modern async/await interface while maintaining backward compatibility.\n */\ndeclare class DrmModule extends NativeModule<DrmModuleEvents> {\n initializeWithConfig(nativeId: string, config: DrmConfig): Promise<void>;\n destroy(nativeId: string): Promise<void>;\n setPreparedCertificate(id: string, certificate: string): any;\n setPreparedMessage(id: string, message?: string): any;\n setPreparedSyncMessage(id: string, syncMessage?: string): any;\n setPreparedLicense(id: string, license?: string): any;\n setPreparedLicenseServerUrl(id: string, url?: string): any;\n setPreparedContentId(id: string, contentId?: string): any;\n}\n\nexport default requireNativeModule<DrmModule>('DrmModule');\n"]}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents a FairPlay Streaming DRM config.
|
|
3
|
+
*/
|
|
4
|
+
export interface FairplayConfig {
|
|
5
|
+
/**
|
|
6
|
+
* The DRM license acquisition URL.
|
|
7
|
+
*/
|
|
8
|
+
licenseUrl: string;
|
|
9
|
+
/**
|
|
10
|
+
* The URL to the FairPlay Streaming certificate of the license server.
|
|
11
|
+
*/
|
|
12
|
+
certificateUrl?: string;
|
|
13
|
+
/**
|
|
14
|
+
* A dictionary to specify custom HTTP headers for the license request.
|
|
15
|
+
*/
|
|
16
|
+
licenseRequestHeaders?: Record<string, string>;
|
|
17
|
+
/**
|
|
18
|
+
* A dictionary to specify custom HTTP headers for the certificate request.
|
|
19
|
+
*/
|
|
20
|
+
certificateRequestHeaders?: Record<string, string>;
|
|
21
|
+
/**
|
|
22
|
+
* A block to prepare the loaded certificate before building SPC data and passing it into the
|
|
23
|
+
* system. This is needed if the server responds with anything else than the certificate, e.g. if
|
|
24
|
+
* the certificate is wrapped into a JSON object. The server response for the certificate request
|
|
25
|
+
* is passed as parameter “as is”.
|
|
26
|
+
*
|
|
27
|
+
* Note that both the passed `certificate` data and this block return value should be a Base64
|
|
28
|
+
* string. So use whatever solution suits you best to handle Base64 in React Native.
|
|
29
|
+
*
|
|
30
|
+
* @param certificate - Base64 encoded certificate data.
|
|
31
|
+
* @returns The processed Base64 encoded certificate.
|
|
32
|
+
*/
|
|
33
|
+
prepareCertificate?: (certificate: string) => string;
|
|
34
|
+
/**
|
|
35
|
+
* A block to prepare the data which is sent as the body of the POST license request.
|
|
36
|
+
* As many DRM providers expect different, vendor-specific messages, this can be done using
|
|
37
|
+
* this user-defined block.
|
|
38
|
+
*
|
|
39
|
+
* Note that both the passed `message` data and this block return value should be a Base64 string.
|
|
40
|
+
* So use whatever solution suits you best to handle Base64 in React Native.
|
|
41
|
+
*
|
|
42
|
+
* @param message - Base64 encoded message data.
|
|
43
|
+
* @param assetId - Stream asset ID.
|
|
44
|
+
* @returns The processed Base64 encoded message.
|
|
45
|
+
*/
|
|
46
|
+
prepareMessage?: (message: string, assetId: string) => string;
|
|
47
|
+
/**
|
|
48
|
+
* A block to prepare the data which is sent as the body of the POST request for syncing the DRM
|
|
49
|
+
* license information.
|
|
50
|
+
*
|
|
51
|
+
* Note that both the passed `syncMessage` data and this block return value should be a Base64
|
|
52
|
+
* string. So use whatever solution suits you best to handle Base64 in React Native.
|
|
53
|
+
*
|
|
54
|
+
* @param syncMessage - Base64 encoded message data.
|
|
55
|
+
* @param assetId - Asset ID.
|
|
56
|
+
* @returns The processed Base64 encoded sync message.
|
|
57
|
+
*/
|
|
58
|
+
prepareSyncMessage?: (syncMessage: string, assetId: string) => string;
|
|
59
|
+
/**
|
|
60
|
+
* A block to prepare the loaded CKC Data before passing it to the system. This is needed if the
|
|
61
|
+
* server responds with anything else than the license, e.g. if the license is wrapped into a JSON
|
|
62
|
+
* object.
|
|
63
|
+
*
|
|
64
|
+
* Note that both the passed `license` data and this block return value should be a Base64 string.
|
|
65
|
+
* So use whatever solution suits you best to handle Base64 in React Native.
|
|
66
|
+
*
|
|
67
|
+
* @param license - Base64 encoded license data.
|
|
68
|
+
* @returns The processed Base64 encoded license.
|
|
69
|
+
*/
|
|
70
|
+
prepareLicense?: (license: string) => string;
|
|
71
|
+
/**
|
|
72
|
+
* A block to prepare the URI (without the skd://) from the HLS manifest before passing it to the
|
|
73
|
+
* system.
|
|
74
|
+
*
|
|
75
|
+
* @param licenseServerUrl - License server URL string.
|
|
76
|
+
* @returns The processed license server URL string.
|
|
77
|
+
*/
|
|
78
|
+
prepareLicenseServerUrl?: (licenseServerUrl: string) => string;
|
|
79
|
+
/**
|
|
80
|
+
* A block to prepare the `contentId`, which is sent to the FairPlay Streaming license server as
|
|
81
|
+
* request body, and which is used to build the SPC data. As many DRM providers expect different,
|
|
82
|
+
* vendor-specific messages, this can be done using this user-defined block. The parameter is the
|
|
83
|
+
* skd:// URI extracted from the HLS manifest (m3u8) and the return value should be the contentID
|
|
84
|
+
* as string.
|
|
85
|
+
*
|
|
86
|
+
* @param contentId - Extracted content id string.
|
|
87
|
+
* @returns The processed contentId.
|
|
88
|
+
*/
|
|
89
|
+
prepareContentId?: (contentId: string) => string;
|
|
90
|
+
}
|
|
91
|
+
//# sourceMappingURL=fairplayConfig.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fairplayConfig.d.ts","sourceRoot":"","sources":["../../src/drm/fairplayConfig.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;OAEG;IACH,qBAAqB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/C;;OAEG;IACH,yBAAyB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnD;;;;;;;;;;;OAWG;IACH,kBAAkB,CAAC,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,MAAM,CAAC;IACrD;;;;;;;;;;;OAWG;IACH,cAAc,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,MAAM,CAAC;IAC9D;;;;;;;;;;OAUG;IACH,kBAAkB,CAAC,EAAE,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,MAAM,CAAC;IACtE;;;;;;;;;;OAUG;IACH,cAAc,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,MAAM,CAAC;IAC7C;;;;;;OAMG;IACH,uBAAuB,CAAC,EAAE,CAAC,gBAAgB,EAAE,MAAM,KAAK,MAAM,CAAC;IAC/D;;;;;;;;;OASG;IACH,gBAAgB,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,MAAM,CAAC;CAClD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fairplayConfig.js","sourceRoot":"","sources":["../../src/drm/fairplayConfig.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Represents a FairPlay Streaming DRM config.\n */\nexport interface FairplayConfig {\n /**\n * The DRM license acquisition URL.\n */\n licenseUrl: string;\n /**\n * The URL to the FairPlay Streaming certificate of the license server.\n */\n certificateUrl?: string;\n /**\n * A dictionary to specify custom HTTP headers for the license request.\n */\n licenseRequestHeaders?: Record<string, string>;\n /**\n * A dictionary to specify custom HTTP headers for the certificate request.\n */\n certificateRequestHeaders?: Record<string, string>;\n /**\n * A block to prepare the loaded certificate before building SPC data and passing it into the\n * system. This is needed if the server responds with anything else than the certificate, e.g. if\n * the certificate is wrapped into a JSON object. The server response for the certificate request\n * is passed as parameter “as is”.\n *\n * Note that both the passed `certificate` data and this block return value should be a Base64\n * string. So use whatever solution suits you best to handle Base64 in React Native.\n *\n * @param certificate - Base64 encoded certificate data.\n * @returns The processed Base64 encoded certificate.\n */\n prepareCertificate?: (certificate: string) => string;\n /**\n * A block to prepare the data which is sent as the body of the POST license request.\n * As many DRM providers expect different, vendor-specific messages, this can be done using\n * this user-defined block.\n *\n * Note that both the passed `message` data and this block return value should be a Base64 string.\n * So use whatever solution suits you best to handle Base64 in React Native.\n *\n * @param message - Base64 encoded message data.\n * @param assetId - Stream asset ID.\n * @returns The processed Base64 encoded message.\n */\n prepareMessage?: (message: string, assetId: string) => string;\n /**\n * A block to prepare the data which is sent as the body of the POST request for syncing the DRM\n * license information.\n *\n * Note that both the passed `syncMessage` data and this block return value should be a Base64\n * string. So use whatever solution suits you best to handle Base64 in React Native.\n *\n * @param syncMessage - Base64 encoded message data.\n * @param assetId - Asset ID.\n * @returns The processed Base64 encoded sync message.\n */\n prepareSyncMessage?: (syncMessage: string, assetId: string) => string;\n /**\n * A block to prepare the loaded CKC Data before passing it to the system. This is needed if the\n * server responds with anything else than the license, e.g. if the license is wrapped into a JSON\n * object.\n *\n * Note that both the passed `license` data and this block return value should be a Base64 string.\n * So use whatever solution suits you best to handle Base64 in React Native.\n *\n * @param license - Base64 encoded license data.\n * @returns The processed Base64 encoded license.\n */\n prepareLicense?: (license: string) => string;\n /**\n * A block to prepare the URI (without the skd://) from the HLS manifest before passing it to the\n * system.\n *\n * @param licenseServerUrl - License server URL string.\n * @returns The processed license server URL string.\n */\n prepareLicenseServerUrl?: (licenseServerUrl: string) => string;\n /**\n * A block to prepare the `contentId`, which is sent to the FairPlay Streaming license server as\n * request body, and which is used to build the SPC data. As many DRM providers expect different,\n * vendor-specific messages, this can be done using this user-defined block. The parameter is the\n * skd:// URI extracted from the HLS manifest (m3u8) and the return value should be the contentID\n * as string.\n *\n * @param contentId - Extracted content id string.\n * @returns The processed contentId.\n */\n prepareContentId?: (contentId: string) => string;\n}\n"]}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import NativeInstance, { NativeInstanceConfig } from '../nativeInstance';
|
|
2
|
+
import { FairplayConfig } from './fairplayConfig';
|
|
3
|
+
import { WidevineConfig } from './widevineConfig';
|
|
4
|
+
export { FairplayConfig, WidevineConfig };
|
|
5
|
+
/**
|
|
6
|
+
* Represents the general Streaming DRM config.
|
|
7
|
+
*/
|
|
8
|
+
export interface DrmConfig extends NativeInstanceConfig {
|
|
9
|
+
/**
|
|
10
|
+
* FairPlay specific configuration.
|
|
11
|
+
*
|
|
12
|
+
* @remarks Platform: iOS
|
|
13
|
+
*/
|
|
14
|
+
fairplay?: FairplayConfig;
|
|
15
|
+
/**
|
|
16
|
+
* Widevine specific configuration.
|
|
17
|
+
*
|
|
18
|
+
* @remarks Platform: Android, iOS (only for casting).
|
|
19
|
+
*/
|
|
20
|
+
widevine?: WidevineConfig;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Represents a native DRM configuration object.
|
|
24
|
+
* @internal
|
|
25
|
+
*/
|
|
26
|
+
export declare class Drm extends NativeInstance<DrmConfig> {
|
|
27
|
+
/**
|
|
28
|
+
* Whether this object's native instance has been created.
|
|
29
|
+
*/
|
|
30
|
+
isInitialized: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Whether this object's native instance has been disposed.
|
|
33
|
+
*/
|
|
34
|
+
isDestroyed: boolean;
|
|
35
|
+
private eventSubscriptions;
|
|
36
|
+
/**
|
|
37
|
+
* Allocates the DRM config instance and its resources natively.
|
|
38
|
+
*/
|
|
39
|
+
initialize: () => Promise<void>;
|
|
40
|
+
/**
|
|
41
|
+
* Destroys the native DRM config and releases all of its allocated resources.
|
|
42
|
+
*/
|
|
43
|
+
destroy: () => Promise<void>;
|
|
44
|
+
/**
|
|
45
|
+
* Sets up event listeners for all DRM preparation callbacks
|
|
46
|
+
*/
|
|
47
|
+
private setupEventListeners;
|
|
48
|
+
/**
|
|
49
|
+
* iOS only.
|
|
50
|
+
*
|
|
51
|
+
* Applies the user-defined `prepareCertificate` function to native's `certificate` data and store
|
|
52
|
+
* the result back in `DrmModule`.
|
|
53
|
+
*
|
|
54
|
+
* Called from native code when `FairplayConfig.prepareCertificate` is dispatched.
|
|
55
|
+
*
|
|
56
|
+
* @param certificate - Base64 encoded certificate data.
|
|
57
|
+
*/
|
|
58
|
+
private onPrepareCertificate;
|
|
59
|
+
/**
|
|
60
|
+
* Applies the user-defined `prepareMessage` function to native's `message` data and store
|
|
61
|
+
* the result back in `DrmModule`.
|
|
62
|
+
*
|
|
63
|
+
* Called from native code when `prepareMessage` is dispatched.
|
|
64
|
+
*
|
|
65
|
+
* @param message - Base64 encoded message data.
|
|
66
|
+
* @param assetId - Optional asset ID. Only sent by iOS.
|
|
67
|
+
*/
|
|
68
|
+
private onPrepareMessage;
|
|
69
|
+
/**
|
|
70
|
+
* iOS only.
|
|
71
|
+
*
|
|
72
|
+
* Applies the user-defined `prepareSyncMessage` function to native's `syncMessage` data and
|
|
73
|
+
* store the result back in `DrmModule`.
|
|
74
|
+
*
|
|
75
|
+
* Called from native code when `FairplayConfig.prepareSyncMessage` is dispatched.
|
|
76
|
+
*
|
|
77
|
+
* @param syncMessage - Base64 encoded sync SPC message data.
|
|
78
|
+
*/
|
|
79
|
+
private onPrepareSyncMessage;
|
|
80
|
+
/**
|
|
81
|
+
* Applies the user-defined `prepareLicense` function to native's `license` data and store
|
|
82
|
+
* the result back in `DrmModule`.
|
|
83
|
+
*
|
|
84
|
+
* Called from native code when `prepareLicense` is dispatched.
|
|
85
|
+
*
|
|
86
|
+
* @param license - Base64 encoded license data.
|
|
87
|
+
*/
|
|
88
|
+
private onPrepareLicense;
|
|
89
|
+
/**
|
|
90
|
+
* iOS only.
|
|
91
|
+
*
|
|
92
|
+
* Applies the user-defined `prepareLicenseServerUrl` function to native's `licenseServerUrl` data
|
|
93
|
+
* and store the result back in `DrmModule`.
|
|
94
|
+
*
|
|
95
|
+
* Called from native code when `FairplayConfig.prepareLicenseServerUrl` is dispatched.
|
|
96
|
+
*
|
|
97
|
+
* @param licenseServerUrl - The license server URL string.
|
|
98
|
+
*/
|
|
99
|
+
private onPrepareLicenseServerUrl;
|
|
100
|
+
/**
|
|
101
|
+
* iOS only.
|
|
102
|
+
*
|
|
103
|
+
* Applies the user-defined `prepareContentId` function to native's `contentId` string
|
|
104
|
+
* and store the result back in `DrmModule`.
|
|
105
|
+
*
|
|
106
|
+
* Called from native code when `FairplayConfig.prepareContentId` is dispatched.
|
|
107
|
+
*
|
|
108
|
+
* @param contentId - The extracted contentId string.
|
|
109
|
+
*/
|
|
110
|
+
private onPrepareContentId;
|
|
111
|
+
}
|
|
112
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/drm/index.ts"],"names":[],"mappings":"AAEA,OAAO,cAAc,EAAE,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACzE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAIlD,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,CAAC;AAE1C;;GAEG;AACH,MAAM,WAAW,SAAU,SAAQ,oBAAoB;IACrD;;;;OAIG;IACH,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,cAAc,CAAC;CAC3B;AAED;;;GAGG;AACH,qBAAa,GAAI,SAAQ,cAAc,CAAC,SAAS,CAAC;IAChD;;OAEG;IACH,aAAa,UAAS;IACtB;;OAEG;IACH,WAAW,UAAS;IAEpB,OAAO,CAAC,kBAAkB,CAA2B;IAErD;;OAEG;IACH,UAAU,sBAWR;IAEF;;OAEG;IACH,OAAO,sBAQL;IAEF;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAkE3B;;;;;;;;;OASG;IACH,OAAO,CAAC,oBAAoB,CAK1B;IAEF;;;;;;;;OAQG;IACH,OAAO,CAAC,gBAAgB,CAkBtB;IAEF;;;;;;;;;OASG;IACH,OAAO,CAAC,oBAAoB,CAY1B;IAEF;;;;;;;OAOG;IACH,OAAO,CAAC,gBAAgB,CAYtB;IAEF;;;;;;;;;OASG;IACH,OAAO,CAAC,yBAAyB,CAS/B;IAEF;;;;;;;;;OASG;IACH,OAAO,CAAC,kBAAkB,CAMxB;CACH"}
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
import { Platform } from 'react-native';
|
|
2
|
+
import NativeInstance from '../nativeInstance';
|
|
3
|
+
import DrmModule from './drmModule';
|
|
4
|
+
/**
|
|
5
|
+
* Represents a native DRM configuration object.
|
|
6
|
+
* @internal
|
|
7
|
+
*/
|
|
8
|
+
export class Drm extends NativeInstance {
|
|
9
|
+
/**
|
|
10
|
+
* Whether this object's native instance has been created.
|
|
11
|
+
*/
|
|
12
|
+
isInitialized = false;
|
|
13
|
+
/**
|
|
14
|
+
* Whether this object's native instance has been disposed.
|
|
15
|
+
*/
|
|
16
|
+
isDestroyed = false;
|
|
17
|
+
eventSubscriptions = [];
|
|
18
|
+
/**
|
|
19
|
+
* Allocates the DRM config instance and its resources natively.
|
|
20
|
+
*/
|
|
21
|
+
initialize = async () => {
|
|
22
|
+
if (!this.isInitialized) {
|
|
23
|
+
// Set up event listeners for DRM preparation callbacks
|
|
24
|
+
this.setupEventListeners();
|
|
25
|
+
// Create native configuration object using Expo module.
|
|
26
|
+
if (this.config) {
|
|
27
|
+
await DrmModule.initializeWithConfig(this.nativeId, this.config);
|
|
28
|
+
}
|
|
29
|
+
this.isInitialized = true;
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Destroys the native DRM config and releases all of its allocated resources.
|
|
34
|
+
*/
|
|
35
|
+
destroy = async () => {
|
|
36
|
+
if (!this.isDestroyed) {
|
|
37
|
+
await DrmModule.destroy(this.nativeId);
|
|
38
|
+
// Clean up event subscriptions
|
|
39
|
+
this.eventSubscriptions.forEach((subscription) => subscription.remove());
|
|
40
|
+
this.eventSubscriptions = [];
|
|
41
|
+
this.isDestroyed = true;
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* Sets up event listeners for all DRM preparation callbacks
|
|
46
|
+
*/
|
|
47
|
+
setupEventListeners() {
|
|
48
|
+
// iOS-only events
|
|
49
|
+
this.eventSubscriptions.push(DrmModule.addListener('onPrepareCertificate', ({ nativeId, id, certificate }) => {
|
|
50
|
+
if (nativeId !== this.nativeId)
|
|
51
|
+
return;
|
|
52
|
+
this.onPrepareCertificate(id, certificate);
|
|
53
|
+
}));
|
|
54
|
+
this.eventSubscriptions.push(DrmModule.addListener('onPrepareSyncMessage', ({ nativeId, id, syncMessage, assetId }) => {
|
|
55
|
+
if (nativeId !== this.nativeId)
|
|
56
|
+
return;
|
|
57
|
+
this.onPrepareSyncMessage(id, syncMessage, assetId);
|
|
58
|
+
}));
|
|
59
|
+
this.eventSubscriptions.push(DrmModule.addListener('onPrepareLicenseServerUrl', ({ nativeId, id, licenseServerUrl }) => {
|
|
60
|
+
if (nativeId !== this.nativeId)
|
|
61
|
+
return;
|
|
62
|
+
this.onPrepareLicenseServerUrl(id, licenseServerUrl);
|
|
63
|
+
}));
|
|
64
|
+
this.eventSubscriptions.push(DrmModule.addListener('onPrepareContentId', ({ nativeId, id, contentId }) => {
|
|
65
|
+
if (nativeId !== this.nativeId)
|
|
66
|
+
return;
|
|
67
|
+
this.onPrepareContentId(id, contentId);
|
|
68
|
+
}));
|
|
69
|
+
// Cross-platform events
|
|
70
|
+
this.eventSubscriptions.push(DrmModule.addListener('onPrepareMessage', ({ nativeId, id, data, message, assetId }) => {
|
|
71
|
+
if (nativeId !== this.nativeId)
|
|
72
|
+
return;
|
|
73
|
+
// Android sends 'data', iOS sends 'message'
|
|
74
|
+
this.onPrepareMessage(id, data || message, assetId);
|
|
75
|
+
}));
|
|
76
|
+
this.eventSubscriptions.push(DrmModule.addListener('onPrepareLicense', ({ nativeId, id, data, license }) => {
|
|
77
|
+
if (nativeId !== this.nativeId)
|
|
78
|
+
return;
|
|
79
|
+
// Android sends 'data', iOS sends 'license'
|
|
80
|
+
this.onPrepareLicense(id, data || license);
|
|
81
|
+
}));
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* iOS only.
|
|
85
|
+
*
|
|
86
|
+
* Applies the user-defined `prepareCertificate` function to native's `certificate` data and store
|
|
87
|
+
* the result back in `DrmModule`.
|
|
88
|
+
*
|
|
89
|
+
* Called from native code when `FairplayConfig.prepareCertificate` is dispatched.
|
|
90
|
+
*
|
|
91
|
+
* @param certificate - Base64 encoded certificate data.
|
|
92
|
+
*/
|
|
93
|
+
onPrepareCertificate = (id, certificate) => {
|
|
94
|
+
if (this.config?.fairplay?.prepareCertificate) {
|
|
95
|
+
const result = this.config?.fairplay?.prepareCertificate?.(certificate);
|
|
96
|
+
DrmModule.setPreparedCertificate(id, result);
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
/**
|
|
100
|
+
* Applies the user-defined `prepareMessage` function to native's `message` data and store
|
|
101
|
+
* the result back in `DrmModule`.
|
|
102
|
+
*
|
|
103
|
+
* Called from native code when `prepareMessage` is dispatched.
|
|
104
|
+
*
|
|
105
|
+
* @param message - Base64 encoded message data.
|
|
106
|
+
* @param assetId - Optional asset ID. Only sent by iOS.
|
|
107
|
+
*/
|
|
108
|
+
onPrepareMessage = (id, message, assetId) => {
|
|
109
|
+
if (!message) {
|
|
110
|
+
DrmModule.setPreparedMessage(id, undefined);
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
const config = Platform.OS === 'ios' ? this.config?.fairplay : this.config?.widevine;
|
|
114
|
+
if (config && config.prepareMessage) {
|
|
115
|
+
const result = Platform.OS === 'ios'
|
|
116
|
+
? config.prepareMessage?.(message, assetId)
|
|
117
|
+
: config.prepareMessage?.(message);
|
|
118
|
+
DrmModule.setPreparedMessage(id, result);
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
/**
|
|
122
|
+
* iOS only.
|
|
123
|
+
*
|
|
124
|
+
* Applies the user-defined `prepareSyncMessage` function to native's `syncMessage` data and
|
|
125
|
+
* store the result back in `DrmModule`.
|
|
126
|
+
*
|
|
127
|
+
* Called from native code when `FairplayConfig.prepareSyncMessage` is dispatched.
|
|
128
|
+
*
|
|
129
|
+
* @param syncMessage - Base64 encoded sync SPC message data.
|
|
130
|
+
*/
|
|
131
|
+
onPrepareSyncMessage = (id, syncMessage, assetId) => {
|
|
132
|
+
if (this.config?.fairplay?.prepareSyncMessage) {
|
|
133
|
+
const result = this.config?.fairplay?.prepareSyncMessage?.(syncMessage, assetId);
|
|
134
|
+
DrmModule.setPreparedSyncMessage(id, result);
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
/**
|
|
138
|
+
* Applies the user-defined `prepareLicense` function to native's `license` data and store
|
|
139
|
+
* the result back in `DrmModule`.
|
|
140
|
+
*
|
|
141
|
+
* Called from native code when `prepareLicense` is dispatched.
|
|
142
|
+
*
|
|
143
|
+
* @param license - Base64 encoded license data.
|
|
144
|
+
*/
|
|
145
|
+
onPrepareLicense = (id, license) => {
|
|
146
|
+
if (!license) {
|
|
147
|
+
DrmModule.setPreparedLicense(id, undefined);
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
const prepareLicense = Platform.OS === 'ios'
|
|
151
|
+
? this.config?.fairplay?.prepareLicense
|
|
152
|
+
: this.config?.widevine?.prepareLicense;
|
|
153
|
+
if (prepareLicense) {
|
|
154
|
+
DrmModule.setPreparedLicense(id, prepareLicense(license));
|
|
155
|
+
}
|
|
156
|
+
};
|
|
157
|
+
/**
|
|
158
|
+
* iOS only.
|
|
159
|
+
*
|
|
160
|
+
* Applies the user-defined `prepareLicenseServerUrl` function to native's `licenseServerUrl` data
|
|
161
|
+
* and store the result back in `DrmModule`.
|
|
162
|
+
*
|
|
163
|
+
* Called from native code when `FairplayConfig.prepareLicenseServerUrl` is dispatched.
|
|
164
|
+
*
|
|
165
|
+
* @param licenseServerUrl - The license server URL string.
|
|
166
|
+
*/
|
|
167
|
+
onPrepareLicenseServerUrl = (id, licenseServerUrl) => {
|
|
168
|
+
if (this.config?.fairplay?.prepareLicenseServerUrl) {
|
|
169
|
+
const result = this.config?.fairplay?.prepareLicenseServerUrl?.(licenseServerUrl);
|
|
170
|
+
DrmModule.setPreparedLicenseServerUrl(id, result);
|
|
171
|
+
}
|
|
172
|
+
};
|
|
173
|
+
/**
|
|
174
|
+
* iOS only.
|
|
175
|
+
*
|
|
176
|
+
* Applies the user-defined `prepareContentId` function to native's `contentId` string
|
|
177
|
+
* and store the result back in `DrmModule`.
|
|
178
|
+
*
|
|
179
|
+
* Called from native code when `FairplayConfig.prepareContentId` is dispatched.
|
|
180
|
+
*
|
|
181
|
+
* @param contentId - The extracted contentId string.
|
|
182
|
+
*/
|
|
183
|
+
onPrepareContentId = (id, contentId) => {
|
|
184
|
+
console.log('onPrepareContentId', contentId);
|
|
185
|
+
if (this.config?.fairplay?.prepareContentId) {
|
|
186
|
+
const result = this.config?.fairplay?.prepareContentId?.(contentId);
|
|
187
|
+
DrmModule.setPreparedContentId(id, result);
|
|
188
|
+
}
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/drm/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,OAAO,cAAwC,MAAM,mBAAmB,CAAC;AAGzE,OAAO,SAAS,MAAM,aAAa,CAAC;AAuBpC;;;GAGG;AACH,MAAM,OAAO,GAAI,SAAQ,cAAyB;IAChD;;OAEG;IACH,aAAa,GAAG,KAAK,CAAC;IACtB;;OAEG;IACH,WAAW,GAAG,KAAK,CAAC;IAEZ,kBAAkB,GAAwB,EAAE,CAAC;IAErD;;OAEG;IACH,UAAU,GAAG,KAAK,IAAI,EAAE;QACtB,IAA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MAAM,CAAC,CAAC;QACpD,CAAC;IACH,CAAC,CAAC;IAEF;;;;;;;;;OASG;IACK,kBAAkB,GAAG,CAAC,EAAU,EAAE,SAAiB,EAAE,EAAE;QAC7D,OAAO,CAAC,GAAG,CAAC,oBAAoB,EAAE,SAAS,CAAC,CAAC;QAC7C,IAAI,IAAI,CAAC,MAAM,EAAE,QAAQ,EAAE,gBAAgB,EAAE,CAAC;YAC5C,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,EAAE,QAAQ,EAAE,gBAAgB,EAAE,CAAC,SAAS,CAAC,CAAC;YACpE,SAAS,CAAC,oBAAoB,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;QAC7C,CAAC;IACH,CAAC,CAAC;CACH","sourcesContent":["import { Platform } from 'react-native';\nimport { EventSubscription } from 'expo-modules-core';\nimport NativeInstance, { NativeInstanceConfig } from '../nativeInstance';\nimport { FairplayConfig } from './fairplayConfig';\nimport { WidevineConfig } from './widevineConfig';\nimport DrmModule from './drmModule';\n\n// Export config types from DRM module.\nexport { FairplayConfig, WidevineConfig };\n\n/**\n * Represents the general Streaming DRM config.\n */\nexport interface DrmConfig extends NativeInstanceConfig {\n /**\n * FairPlay specific configuration.\n *\n * @remarks Platform: iOS\n */\n fairplay?: FairplayConfig;\n /**\n * Widevine specific configuration.\n *\n * @remarks Platform: Android, iOS (only for casting).\n */\n widevine?: WidevineConfig;\n}\n\n/**\n * Represents a native DRM configuration object.\n * @internal\n */\nexport class Drm extends NativeInstance<DrmConfig> {\n /**\n * Whether this object's native instance has been created.\n */\n isInitialized = false;\n /**\n * Whether this object's native instance has been disposed.\n */\n isDestroyed = false;\n\n private eventSubscriptions: EventSubscription[] = [];\n\n /**\n * Allocates the DRM config instance and its resources natively.\n */\n initialize = async () => {\n if (!this.isInitialized) {\n // Set up event listeners for DRM preparation callbacks\n this.setupEventListeners();\n\n // Create native configuration object using Expo module.\n if (this.config) {\n await DrmModule.initializeWithConfig(this.nativeId, this.config);\n }\n this.isInitialized = true;\n }\n };\n\n /**\n * Destroys the native DRM config and releases all of its allocated resources.\n */\n destroy = async () => {\n if (!this.isDestroyed) {\n await DrmModule.destroy(this.nativeId);\n // Clean up event subscriptions\n this.eventSubscriptions.forEach((subscription) => subscription.remove());\n this.eventSubscriptions = [];\n this.isDestroyed = true;\n }\n };\n\n /**\n * Sets up event listeners for all DRM preparation callbacks\n */\n private setupEventListeners() {\n // iOS-only events\n this.eventSubscriptions.push(\n DrmModule.addListener(\n 'onPrepareCertificate',\n ({ nativeId, id, certificate }) => {\n if (nativeId !== this.nativeId) return;\n this.onPrepareCertificate(id, certificate);\n }\n )\n );\n\n this.eventSubscriptions.push(\n DrmModule.addListener(\n 'onPrepareSyncMessage',\n ({ nativeId, id, syncMessage, assetId }) => {\n if (nativeId !== this.nativeId) return;\n this.onPrepareSyncMessage(id, syncMessage, assetId);\n }\n )\n );\n\n this.eventSubscriptions.push(\n DrmModule.addListener(\n 'onPrepareLicenseServerUrl',\n ({ nativeId, id, licenseServerUrl }) => {\n if (nativeId !== this.nativeId) return;\n this.onPrepareLicenseServerUrl(id, licenseServerUrl);\n }\n )\n );\n\n this.eventSubscriptions.push(\n DrmModule.addListener(\n 'onPrepareContentId',\n ({ nativeId, id, contentId }) => {\n if (nativeId !== this.nativeId) return;\n this.onPrepareContentId(id, contentId);\n }\n )\n );\n\n // Cross-platform events\n this.eventSubscriptions.push(\n DrmModule.addListener(\n 'onPrepareMessage',\n ({ nativeId, id, data, message, assetId }) => {\n if (nativeId !== this.nativeId) return;\n // Android sends 'data', iOS sends 'message'\n this.onPrepareMessage(id, data || message, assetId);\n }\n )\n );\n\n this.eventSubscriptions.push(\n DrmModule.addListener(\n 'onPrepareLicense',\n ({ nativeId, id, data, license }) => {\n if (nativeId !== this.nativeId) return;\n // Android sends 'data', iOS sends 'license'\n this.onPrepareLicense(id, data || license);\n }\n )\n );\n }\n\n /**\n * iOS only.\n *\n * Applies the user-defined `prepareCertificate` function to native's `certificate` data and store\n * the result back in `DrmModule`.\n *\n * Called from native code when `FairplayConfig.prepareCertificate` is dispatched.\n *\n * @param certificate - Base64 encoded certificate data.\n */\n private onPrepareCertificate = (id: string, certificate: string) => {\n if (this.config?.fairplay?.prepareCertificate) {\n const result = this.config?.fairplay?.prepareCertificate?.(certificate);\n DrmModule.setPreparedCertificate(id, result);\n }\n };\n\n /**\n * Applies the user-defined `prepareMessage` function to native's `message` data and store\n * the result back in `DrmModule`.\n *\n * Called from native code when `prepareMessage` is dispatched.\n *\n * @param message - Base64 encoded message data.\n * @param assetId - Optional asset ID. Only sent by iOS.\n */\n private onPrepareMessage = (\n id: string,\n message?: string,\n assetId?: string\n ) => {\n if (!message) {\n DrmModule.setPreparedMessage(id, undefined);\n return;\n }\n const config =\n Platform.OS === 'ios' ? this.config?.fairplay : this.config?.widevine;\n if (config && config.prepareMessage) {\n const result =\n Platform.OS === 'ios'\n ? (config as FairplayConfig).prepareMessage?.(message, assetId!)\n : (config as WidevineConfig).prepareMessage?.(message);\n DrmModule.setPreparedMessage(id, result);\n }\n };\n\n /**\n * iOS only.\n *\n * Applies the user-defined `prepareSyncMessage` function to native's `syncMessage` data and\n * store the result back in `DrmModule`.\n *\n * Called from native code when `FairplayConfig.prepareSyncMessage` is dispatched.\n *\n * @param syncMessage - Base64 encoded sync SPC message data.\n */\n private onPrepareSyncMessage = (\n id: string,\n syncMessage: string,\n assetId: string\n ) => {\n if (this.config?.fairplay?.prepareSyncMessage) {\n const result = this.config?.fairplay?.prepareSyncMessage?.(\n syncMessage,\n assetId\n );\n DrmModule.setPreparedSyncMessage(id, result);\n }\n };\n\n /**\n * Applies the user-defined `prepareLicense` function to native's `license` data and store\n * the result back in `DrmModule`.\n *\n * Called from native code when `prepareLicense` is dispatched.\n *\n * @param license - Base64 encoded license data.\n */\n private onPrepareLicense = (id: string, license?: string) => {\n if (!license) {\n DrmModule.setPreparedLicense(id, undefined);\n return;\n }\n const prepareLicense =\n Platform.OS === 'ios'\n ? this.config?.fairplay?.prepareLicense\n : this.config?.widevine?.prepareLicense;\n if (prepareLicense) {\n DrmModule.setPreparedLicense(id, prepareLicense(license));\n }\n };\n\n /**\n * iOS only.\n *\n * Applies the user-defined `prepareLicenseServerUrl` function to native's `licenseServerUrl` data\n * and store the result back in `DrmModule`.\n *\n * Called from native code when `FairplayConfig.prepareLicenseServerUrl` is dispatched.\n *\n * @param licenseServerUrl - The license server URL string.\n */\n private onPrepareLicenseServerUrl = (\n id: string,\n licenseServerUrl: string\n ) => {\n if (this.config?.fairplay?.prepareLicenseServerUrl) {\n const result =\n this.config?.fairplay?.prepareLicenseServerUrl?.(licenseServerUrl);\n DrmModule.setPreparedLicenseServerUrl(id, result);\n }\n };\n\n /**\n * iOS only.\n *\n * Applies the user-defined `prepareContentId` function to native's `contentId` string\n * and store the result back in `DrmModule`.\n *\n * Called from native code when `FairplayConfig.prepareContentId` is dispatched.\n *\n * @param contentId - The extracted contentId string.\n */\n private onPrepareContentId = (id: string, contentId: string) => {\n console.log('onPrepareContentId', contentId);\n if (this.config?.fairplay?.prepareContentId) {\n const result = this.config?.fairplay?.prepareContentId?.(contentId);\n DrmModule.setPreparedContentId(id, result);\n }\n };\n}\n"]}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents a Widevine Streaming DRM config.
|
|
3
|
+
* @remarks Platform: Android, iOS (only for casting).
|
|
4
|
+
*/
|
|
5
|
+
export interface WidevineConfig {
|
|
6
|
+
/**
|
|
7
|
+
* The DRM license acquisition URL.
|
|
8
|
+
*/
|
|
9
|
+
licenseUrl: string;
|
|
10
|
+
/**
|
|
11
|
+
* A map containing the HTTP request headers, or null.
|
|
12
|
+
*/
|
|
13
|
+
httpHeaders?: Record<string, string>;
|
|
14
|
+
/**
|
|
15
|
+
* A block to prepare the data which is sent as the body of the POST license request.
|
|
16
|
+
* As many DRM providers expect different, vendor-specific messages, this can be done using
|
|
17
|
+
* this user-defined block.
|
|
18
|
+
*
|
|
19
|
+
* Note that both the passed `message` data and this block return value should be a Base64 string.
|
|
20
|
+
* So use whatever solution suits you best to handle Base64 in React Native.
|
|
21
|
+
*
|
|
22
|
+
* @remarks Platform: Android
|
|
23
|
+
*
|
|
24
|
+
* @param message - Base64 encoded message data.
|
|
25
|
+
* @returns The processed Base64 encoded message.
|
|
26
|
+
*/
|
|
27
|
+
prepareMessage?: (message: string) => string;
|
|
28
|
+
/**
|
|
29
|
+
* A block to prepare the loaded CKC Data before passing it to the system. This is needed if the
|
|
30
|
+
* server responds with anything else than the license, e.g. if the license is wrapped into a JSON
|
|
31
|
+
* object.
|
|
32
|
+
*
|
|
33
|
+
* Note that both the passed `license` data and this block return value should be a Base64 string.
|
|
34
|
+
* So use whatever solution suits you best to handle Base64 in React Native.
|
|
35
|
+
*
|
|
36
|
+
* @remarks Platform: Android
|
|
37
|
+
*
|
|
38
|
+
* @param license - Base64 encoded license data.
|
|
39
|
+
* @returns The processed Base64 encoded license.
|
|
40
|
+
*/
|
|
41
|
+
prepareLicense?: (license: string) => string;
|
|
42
|
+
/**
|
|
43
|
+
* Set widevine's preferred security level.
|
|
44
|
+
*
|
|
45
|
+
* @remarks Platform: Android
|
|
46
|
+
*/
|
|
47
|
+
preferredSecurityLevel?: string;
|
|
48
|
+
/**
|
|
49
|
+
* Indicates if the DRM sessions should be kept alive after a source is unloaded.
|
|
50
|
+
* This allows DRM sessions to be reused over several different source items with the same DRM configuration as well
|
|
51
|
+
* as the same DRM scheme information.
|
|
52
|
+
* Default: `false`
|
|
53
|
+
*
|
|
54
|
+
* @remarks Platform: Android
|
|
55
|
+
*/
|
|
56
|
+
shouldKeepDrmSessionsAlive?: boolean;
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=widevineConfig.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"widevineConfig.d.ts","sourceRoot":"","sources":["../../src/drm/widevineConfig.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrC;;;;;;;;;;;;OAYG;IACH,cAAc,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,MAAM,CAAC;IAC7C;;;;;;;;;;;;OAYG;IACH,cAAc,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,MAAM,CAAC;IAC7C;;;;OAIG;IACH,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC;;;;;;;OAOG;IACH,0BAA0B,CAAC,EAAE,OAAO,CAAC;CACtC"}
|