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/ios/DrmModule.swift
CHANGED
|
@@ -1,207 +1,69 @@
|
|
|
1
1
|
import BitmovinPlayer
|
|
2
|
+
import ExpoModulesCore
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
public class DrmModule: NSObject, RCTBridgeModule {
|
|
5
|
-
// swiftlint:disable:next implicitly_unwrapped_optional
|
|
6
|
-
@objc public var bridge: RCTBridge!
|
|
7
|
-
|
|
8
|
-
/// In-memory mapping from `nativeId`s to `FairplayConfig` instances.
|
|
4
|
+
public class DrmModule: Module {
|
|
9
5
|
private var drmConfigs: Registry<FairplayConfig> = [:]
|
|
6
|
+
private let waiter = ResultWaiter<String>()
|
|
10
7
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
"DrmModule"
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
public static func requiresMainQueueSetup() -> Bool {
|
|
17
|
-
true
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
// swiftlint:disable:next implicitly_unwrapped_optional
|
|
21
|
-
public var methodQueue: DispatchQueue! {
|
|
22
|
-
bridge.uiManager.methodQueue
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
Creates a new `FairplayConfig` instance inside the internal drmConfigs using the provided `config` object.
|
|
27
|
-
- Parameter nativeId: ID to associate with the `FairplayConfig` instance.
|
|
28
|
-
- Returns: The associated `FairplayConfig` instance or `nil`.
|
|
29
|
-
*/
|
|
30
|
-
@objc
|
|
31
|
-
func retrieve(_ nativeId: NativeId) -> FairplayConfig? {
|
|
32
|
-
drmConfigs[nativeId]
|
|
33
|
-
}
|
|
8
|
+
public func definition() -> ModuleDefinition {
|
|
9
|
+
Name("DrmModule")
|
|
34
10
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
- Parameter config: `DrmConfig` object received from JS.
|
|
39
|
-
*/
|
|
40
|
-
@objc(initWithConfig:config:)
|
|
41
|
-
func initWithConfig(_ nativeId: NativeId, config: Any?) {
|
|
42
|
-
bridge.uiManager.addUIBlock { [weak self] _, _ in
|
|
43
|
-
guard
|
|
44
|
-
self?.drmConfigs[nativeId] == nil,
|
|
45
|
-
let fairplayConfig = RCTConvert.drmConfig(config).fairplay
|
|
46
|
-
else {
|
|
47
|
-
return
|
|
48
|
-
}
|
|
49
|
-
self?.drmConfigs[nativeId] = fairplayConfig
|
|
50
|
-
self?.initConfigBlocks(nativeId, config)
|
|
11
|
+
OnDestroy {
|
|
12
|
+
drmConfigs.removeAll()
|
|
13
|
+
waiter.removeAll()
|
|
51
14
|
}
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
Removes the `FairplayConfig` instance associated with `nativeId` from `drmConfigs`
|
|
56
|
-
and all data produced during preparation hooks.
|
|
57
|
-
- Parameter nativeId Instance to be disposed.
|
|
58
|
-
*/
|
|
59
|
-
@objc(destroy:)
|
|
60
|
-
func destroy(_ nativeId: NativeId) {
|
|
61
|
-
// Remove FairplayConfig instance from drmConfigs
|
|
62
|
-
drmConfigs.removeValue(forKey: nativeId)
|
|
63
|
-
// Remove any value that might be produced by DRM hooks
|
|
64
|
-
preparedCertificates.removeValue(forKey: nativeId)
|
|
65
|
-
preparedMessages.removeValue(forKey: nativeId)
|
|
66
|
-
preparedSyncMessages.removeValue(forKey: nativeId)
|
|
67
|
-
preparedLicenses.removeValue(forKey: nativeId)
|
|
68
|
-
preparedLicenseServerUrls.removeValue(forKey: nativeId)
|
|
69
|
-
preparedContentIds.removeValue(forKey: nativeId)
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
// MARK: - Config blocks.
|
|
73
|
-
|
|
74
|
-
/// Mapping between an object's `nativeId` and the value that'll be returned by its `prepareCertificate` callback.
|
|
75
|
-
var preparedCertificates: Registry<String> = [:]
|
|
76
|
-
/// Mapping between an object's `nativeId` and the value that'll be returned by its `prepareMessage` callback.
|
|
77
|
-
var preparedMessages: Registry<String> = [:]
|
|
78
|
-
/// Mapping between an object's `nativeId` and the value that'll be returned by its `prepareMessage` callback.
|
|
79
|
-
var preparedSyncMessages: Registry<String> = [:]
|
|
80
|
-
/// Mapping between an object's `nativeId` and the value that'll be returned by its `prepareLicense` callback.
|
|
81
|
-
var preparedLicenses: Registry<String> = [:]
|
|
82
|
-
/// Mapping between an object's `nativeId` and the value that'll be returned
|
|
83
|
-
/// by its `prepareLicenseServerUrl` callback.
|
|
84
|
-
var preparedLicenseServerUrls: Registry<String> = [:]
|
|
85
|
-
/// Mapping between an object's `nativeId` and the value that'll be returned by its `prepareContentId` callback.
|
|
86
|
-
var preparedContentIds: Registry<String> = [:]
|
|
87
15
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
preparedMessages[nativeId] = message
|
|
121
|
-
return nil
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
/**
|
|
125
|
-
Function called from JS to store the computed `prepareSyncMessage` return value for `nativeId`.
|
|
126
|
-
|
|
127
|
-
Note this function is **synchronous** and **blocks** the JS thread.
|
|
128
|
-
It's important that it stays this way, otherwise we wouldn't be able to return
|
|
129
|
-
the computed JS message from inside the `fairplayConfig.prepareSyncMessage` Swift closure.
|
|
130
|
-
|
|
131
|
-
Also, since RN has some limitations regarding the definition of sync JS methods from Swift,
|
|
132
|
-
it's necessary to add a return type and a return
|
|
133
|
-
value (even if it's a void method like in this case) or a crash happens.
|
|
134
|
-
So the type `Any?` and return value `nil` were used here (it could be any value).
|
|
135
|
-
*/
|
|
136
|
-
@objc(setPreparedSyncMessage:syncMessage:)
|
|
137
|
-
func setPreparedSyncMessage(_ nativeId: NativeId, syncMessage: String) -> Any? {
|
|
138
|
-
preparedSyncMessages[nativeId] = syncMessage
|
|
139
|
-
return nil
|
|
16
|
+
Events(
|
|
17
|
+
"onPrepareCertificate",
|
|
18
|
+
"onPrepareMessage",
|
|
19
|
+
"onPrepareSyncMessage",
|
|
20
|
+
"onPrepareLicense",
|
|
21
|
+
"onPrepareLicenseServerUrl",
|
|
22
|
+
"onPrepareContentId"
|
|
23
|
+
)
|
|
24
|
+
AsyncFunction("initializeWithConfig") { [weak self] (nativeId: NativeId, config: [String: Any]) in
|
|
25
|
+
self?.initializeWithConfig(nativeId: nativeId, config: config)
|
|
26
|
+
}
|
|
27
|
+
AsyncFunction("destroy") { [weak self] (nativeId: NativeId) in
|
|
28
|
+
self?.destroy(nativeId: nativeId)
|
|
29
|
+
}
|
|
30
|
+
AsyncFunction("setPreparedCertificate") { [weak self] (id: Int, certificate: String?) in
|
|
31
|
+
self?.waiter.complete(id: id, with: certificate ?? "")
|
|
32
|
+
}
|
|
33
|
+
AsyncFunction("setPreparedMessage") { [weak self] (id: Int, message: String?) in
|
|
34
|
+
self?.waiter.complete(id: id, with: message ?? "")
|
|
35
|
+
}
|
|
36
|
+
AsyncFunction("setPreparedSyncMessage") { [weak self] (id: Int, syncMessage: String?) in
|
|
37
|
+
self?.waiter.complete(id: id, with: syncMessage ?? "")
|
|
38
|
+
}
|
|
39
|
+
AsyncFunction("setPreparedLicense") { [weak self] (id: Int, license: String?) in
|
|
40
|
+
self?.waiter.complete(id: id, with: license ?? "")
|
|
41
|
+
}
|
|
42
|
+
AsyncFunction("setPreparedLicenseServerUrl") { [weak self] (id: Int, url: String?) in
|
|
43
|
+
self?.waiter.complete(id: id, with: url ?? "")
|
|
44
|
+
}
|
|
45
|
+
AsyncFunction("setPreparedContentId") { [weak self] (id: Int, contentId: String?) in
|
|
46
|
+
self?.waiter.complete(id: id, with: contentId ?? "")
|
|
47
|
+
}
|
|
140
48
|
}
|
|
141
49
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
the computed JS message from inside the `fairplayConfig.prepareLicense` Swift closure.
|
|
148
|
-
|
|
149
|
-
Also, since RN has some limitations regarding the definition of sync JS methods from Swift,
|
|
150
|
-
it's necessary to add a return type and a return value
|
|
151
|
-
(even if it's a void method like in this case) or a crash happens.
|
|
152
|
-
So the type `Any?` and return value `nil` were used here (it could be any value).
|
|
153
|
-
*/
|
|
154
|
-
@objc(setPreparedLicense:license:)
|
|
155
|
-
func setPreparedLicense(_ nativeId: NativeId, license: String) -> Any? {
|
|
156
|
-
preparedLicenses[nativeId] = license
|
|
157
|
-
return nil
|
|
50
|
+
private func initializeWithConfig(nativeId: NativeId, config: [String: Any]) {
|
|
51
|
+
if self.drmConfigs[nativeId] == nil, let fairplayConfig = RCTConvert.drmConfig(config).fairplay {
|
|
52
|
+
self.drmConfigs[nativeId] = fairplayConfig
|
|
53
|
+
self.initConfigBlocks(nativeId, config)
|
|
54
|
+
}
|
|
158
55
|
}
|
|
159
56
|
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
Note this function is **synchronous** and **blocks** the JS thread.
|
|
164
|
-
It's important that it stays this way, otherwise we wouldn't be able to return
|
|
165
|
-
the computed JS message from inside the `fairplayConfig.prepareLicenseServerUrl` Swift closure.
|
|
166
|
-
|
|
167
|
-
Also, since RN has some limitations regarding the definition of sync JS methods from Swift,
|
|
168
|
-
it's necessary to add a return type and a return value
|
|
169
|
-
(even if it's a void method like in this case) or a crash happens.
|
|
170
|
-
So the type `Any?` and return value `nil` were used here (it could be any value).
|
|
171
|
-
*/
|
|
172
|
-
@objc(setPreparedLicenseServerUrl:url:)
|
|
173
|
-
func setPreparedLicenseServerUrl(_ nativeId: NativeId, url: String) -> Any? {
|
|
174
|
-
preparedLicenseServerUrls[nativeId] = url
|
|
175
|
-
return nil
|
|
57
|
+
private func destroy(nativeId: NativeId) {
|
|
58
|
+
self.drmConfigs.removeValue(forKey: nativeId)
|
|
176
59
|
}
|
|
177
60
|
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
Note this function is **synchronous** and **blocks** the JS thread.
|
|
182
|
-
It's important that it stays this way, otherwise we wouldn't be able to return
|
|
183
|
-
the computed JS message from inside the `fairplayConfig.prepareContentId` Swift closure.
|
|
184
|
-
|
|
185
|
-
Also, since RN has some limitations regarding the definition of sync JS methods from Swift,
|
|
186
|
-
it's necessary to add a return type and a return value
|
|
187
|
-
(even if it's a void method like in this case) or a crash happens.
|
|
188
|
-
So the type `Any?` and return value `nil` were used here (it could be any value).
|
|
189
|
-
*/
|
|
190
|
-
@objc(setPreparedContentId:contentId:)
|
|
191
|
-
func setPreparedContentId(_ nativeId: NativeId, contentId: String) -> Any? {
|
|
192
|
-
preparedContentIds[nativeId] = contentId
|
|
193
|
-
return nil
|
|
61
|
+
func retrieve(_ nativeId: NativeId) -> FairplayConfig? {
|
|
62
|
+
drmConfigs[nativeId]
|
|
194
63
|
}
|
|
195
64
|
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
JS functions according to it's JS instance config.
|
|
199
|
-
|
|
200
|
-
- Parameter nativeId: Instance nativeId.
|
|
201
|
-
- Parameter config: FairPlay config object sent from JS.
|
|
202
|
-
*/
|
|
203
|
-
private func initConfigBlocks(_ nativeId: NativeId, _ config: Any?) {
|
|
204
|
-
if let json = config as? [String: Any], let fairplayJson = json["fairplay"] as? [String: Any] {
|
|
65
|
+
private func initConfigBlocks(_ nativeId: NativeId, _ config: [String: Any]) {
|
|
66
|
+
if let fairplayJson = config["fairplay"] as? [String: Any] {
|
|
205
67
|
initPrepareCertificate(nativeId, fairplayJson: fairplayJson)
|
|
206
68
|
initPrepareMessage(nativeId, fairplayJson: fairplayJson)
|
|
207
69
|
initPrepareSyncMessage(nativeId, fairplayJson: fairplayJson)
|
|
@@ -211,253 +73,117 @@ public class DrmModule: NSObject, RCTBridgeModule {
|
|
|
211
73
|
}
|
|
212
74
|
}
|
|
213
75
|
|
|
214
|
-
/**
|
|
215
|
-
Initialize the `prepareCertificate` block in the `FairplayConfig` associated with `nativeId`.
|
|
216
|
-
|
|
217
|
-
- Parameter nativeId - Instance nativeId.
|
|
218
|
-
- Parameter config: FairPlay config object sent from JS.
|
|
219
|
-
*/
|
|
220
76
|
private func initPrepareCertificate(_ nativeId: NativeId, fairplayJson: [String: Any]) {
|
|
221
|
-
|
|
222
|
-
return
|
|
223
|
-
}
|
|
224
|
-
if fairplayJson["prepareCertificate"] != nil {
|
|
77
|
+
if fairplayJson["prepareCertificate"] != nil, let fairplayConfig = drmConfigs[nativeId] {
|
|
225
78
|
fairplayConfig.prepareCertificate = { [weak self] data in
|
|
226
79
|
self?.prepareCertificateFromJS(nativeId, data) ?? data
|
|
227
80
|
}
|
|
228
81
|
}
|
|
229
82
|
}
|
|
230
83
|
|
|
231
|
-
/**
|
|
232
|
-
Initialize the `prepareMessage` block in the `FairplayConfig` associated with `nativeId`.
|
|
233
|
-
|
|
234
|
-
- Parameter nativeId - Instance nativeId.
|
|
235
|
-
- Parameter config: FairPlay config object sent from JS.
|
|
236
|
-
*/
|
|
237
84
|
private func initPrepareMessage(_ nativeId: NativeId, fairplayJson: [String: Any]) {
|
|
238
|
-
|
|
239
|
-
return
|
|
240
|
-
}
|
|
241
|
-
if fairplayJson["prepareMessage"] != nil {
|
|
85
|
+
if fairplayJson["prepareMessage"] != nil, let fairplayConfig = drmConfigs[nativeId] {
|
|
242
86
|
fairplayConfig.prepareMessage = { [weak self] spcData, assetId in
|
|
243
87
|
self?.prepareMessageFromJS(nativeId, spcData, assetId) ?? spcData
|
|
244
88
|
}
|
|
245
89
|
}
|
|
246
90
|
}
|
|
247
91
|
|
|
248
|
-
/**
|
|
249
|
-
Initialize the `prepareSyncMessage` block in the `FairplayConfig` associated with `nativeId`.
|
|
250
|
-
|
|
251
|
-
- Parameter nativeId - Instance nativeId.
|
|
252
|
-
- Parameter config: FairPlay config object sent from JS.
|
|
253
|
-
*/
|
|
254
92
|
private func initPrepareSyncMessage(_ nativeId: NativeId, fairplayJson: [String: Any]) {
|
|
255
|
-
|
|
256
|
-
return
|
|
257
|
-
}
|
|
258
|
-
if fairplayJson["prepareSyncMessage"] != nil {
|
|
93
|
+
if fairplayJson["prepareSyncMessage"] != nil, let fairplayConfig = drmConfigs[nativeId] {
|
|
259
94
|
fairplayConfig.prepareSyncMessage = { [weak self] syncSpcData, assetId in
|
|
260
95
|
self?.prepareSyncMessageFromJS(nativeId, syncSpcData, assetId) ?? syncSpcData
|
|
261
96
|
}
|
|
262
97
|
}
|
|
263
98
|
}
|
|
264
99
|
|
|
265
|
-
/**
|
|
266
|
-
Initialize the `prepareLicense` block in the `FairplayConfig` associated with `nativeId`.
|
|
267
|
-
|
|
268
|
-
- Parameter nativeId - Instance nativeId.
|
|
269
|
-
- Parameter config: FairPlay config object sent from JS.
|
|
270
|
-
*/
|
|
271
100
|
private func initPrepareLicense(_ nativeId: NativeId, fairplayJson: [String: Any]) {
|
|
272
|
-
|
|
273
|
-
return
|
|
274
|
-
}
|
|
275
|
-
if fairplayJson["prepareLicense"] != nil {
|
|
101
|
+
if fairplayJson["prepareLicense"] != nil, let fairplayConfig = drmConfigs[nativeId] {
|
|
276
102
|
fairplayConfig.prepareLicense = { [weak self] data in
|
|
277
103
|
self?.prepareLicenseFromJS(nativeId, data) ?? data
|
|
278
104
|
}
|
|
279
105
|
}
|
|
280
106
|
}
|
|
281
107
|
|
|
282
|
-
/**
|
|
283
|
-
Initialize the `prepareLicenseServerUrl` block in the `FairplayConfig` associated with `nativeId`.
|
|
284
|
-
|
|
285
|
-
- Parameter nativeId - Instance nativeId.
|
|
286
|
-
- Parameter config: FairPlay config object sent from JS.
|
|
287
|
-
*/
|
|
288
108
|
private func initPrepareLicenseServerUrl(_ nativeId: NativeId, fairplayJson: [String: Any]) {
|
|
289
|
-
|
|
290
|
-
return
|
|
291
|
-
}
|
|
292
|
-
if fairplayJson["prepareLicenseServerUrl"] != nil {
|
|
109
|
+
if fairplayJson["prepareLicenseServerUrl"] != nil, let fairplayConfig = drmConfigs[nativeId] {
|
|
293
110
|
fairplayConfig.prepareLicenseServerUrl = { [weak self] url in
|
|
294
111
|
self?.prepareLicenseServerUrlFromJS(nativeId, url) ?? url
|
|
295
112
|
}
|
|
296
113
|
}
|
|
297
114
|
}
|
|
298
115
|
|
|
299
|
-
/**
|
|
300
|
-
Initialize the `prepareContentId` block in the `FairplayConfig` associated with `nativeId`.
|
|
301
|
-
|
|
302
|
-
- Parameter nativeId - Instance nativeId.
|
|
303
|
-
- Parameter config: FairPlay config object sent from JS.
|
|
304
|
-
*/
|
|
305
116
|
private func initPrepareContentId(_ nativeId: NativeId, fairplayJson: [String: Any]) {
|
|
306
|
-
|
|
307
|
-
return
|
|
308
|
-
}
|
|
309
|
-
if fairplayJson["prepareContentId"] != nil {
|
|
117
|
+
if fairplayJson["prepareContentId"] != nil, let fairplayConfig = drmConfigs[nativeId] {
|
|
310
118
|
fairplayConfig.prepareContentId = { [weak self] contentId in
|
|
311
119
|
self?.prepareContentIdFromJS(nativeId, contentId) ?? contentId
|
|
312
120
|
}
|
|
313
121
|
}
|
|
314
122
|
}
|
|
315
123
|
|
|
316
|
-
/**
|
|
317
|
-
Defines the body of a `prepareCertificate` block in `FairplayConfig`.
|
|
318
|
-
Used to sync Native->JS and JS->Native calls during `prepareCertificate` execution.
|
|
319
|
-
|
|
320
|
-
- Parameter nativeId: Instance nativeId.
|
|
321
|
-
- Parameter data: Certificate data received from `prepareCertificate`.
|
|
322
|
-
- Returns: JS prepared certificate value.
|
|
323
|
-
*/
|
|
324
124
|
private func prepareCertificateFromJS(_ nativeId: NativeId, _ data: Data) -> Data {
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
// Wait for JS `onPrepareCertificate` to finish its execution.
|
|
334
|
-
dispatchGroup.wait()
|
|
335
|
-
// Return value stored by `onPrepareCertificate`.
|
|
336
|
-
return Data(base64Encoded: preparedCertificates[nativeId] ?? "") ?? data
|
|
125
|
+
let (id, wait) = waiter.make(timeout: 0.25)
|
|
126
|
+
sendEvent("onPrepareCertificate", [
|
|
127
|
+
"nativeId": nativeId,
|
|
128
|
+
"id": id,
|
|
129
|
+
"certificate": data.base64EncodedString()
|
|
130
|
+
])
|
|
131
|
+
let result = wait() ?? data.base64EncodedString()
|
|
132
|
+
return Data(base64Encoded: result) ?? data
|
|
337
133
|
}
|
|
338
134
|
|
|
339
|
-
/**
|
|
340
|
-
Defines the body of a `prepareMessage` block in `FairplayConfig`.
|
|
341
|
-
Used to sync Native->JS and JS->Native calls during `prepareMessage` execution.
|
|
342
|
-
|
|
343
|
-
- Parameter nativeId: Instance nativeId.
|
|
344
|
-
- Parameter data: SPC data received from `prepareMessage`.
|
|
345
|
-
- Parameter assetID: Asset ID value received from `prepareMessage`.
|
|
346
|
-
- Returns: JS prepared message value.
|
|
347
|
-
*/
|
|
348
135
|
private func prepareMessageFromJS(_ nativeId: NativeId, _ data: Data, _ assetId: String) -> Data {
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
"
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
)
|
|
358
|
-
// Leave dispatch group when call to JS object finishes.
|
|
359
|
-
dispatchGroup.leave()
|
|
360
|
-
}
|
|
361
|
-
// Wait for JS `onPrepareMessage` to finish its execution.
|
|
362
|
-
dispatchGroup.wait()
|
|
363
|
-
// Return value stored by `onPrepareMessage`.
|
|
364
|
-
return Data(base64Encoded: preparedMessages[nativeId] ?? "") ?? data
|
|
136
|
+
let (id, wait) = waiter.make(timeout: 0.25)
|
|
137
|
+
sendEvent("onPrepareMessage", [
|
|
138
|
+
"nativeId": nativeId,
|
|
139
|
+
"id": id,
|
|
140
|
+
"message": data.base64EncodedString(),
|
|
141
|
+
"assetId": assetId
|
|
142
|
+
])
|
|
143
|
+
let result = wait() ?? data.base64EncodedString()
|
|
144
|
+
return Data(base64Encoded: result) ?? data
|
|
365
145
|
}
|
|
366
146
|
|
|
367
|
-
/**
|
|
368
|
-
Defines the body of a `prepareSyncMessage` block in `FairplayConfig`.
|
|
369
|
-
Used to sync Native->JS and JS->Native calls during `prepareSyncMessage` execution.
|
|
370
|
-
|
|
371
|
-
- Parameter nativeId: Instance nativeId.
|
|
372
|
-
- Parameter data: Sync SPC data received from `prepareSyncMessage`.
|
|
373
|
-
- Parameter assetID: Asset ID value received from `prepareSyncMessage`.
|
|
374
|
-
- Returns: JS prepared sync message value.
|
|
375
|
-
*/
|
|
376
147
|
private func prepareSyncMessageFromJS(_ nativeId: NativeId, _ data: Data, _ assetId: String) -> Data {
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
"
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
)
|
|
386
|
-
// Leave dispatch group when call to JS object finishes.
|
|
387
|
-
dispatchGroup.leave()
|
|
388
|
-
}
|
|
389
|
-
// Wait for JS `onPrepareMessage` to finish its execution.
|
|
390
|
-
dispatchGroup.wait()
|
|
391
|
-
// Return value stored by `onPrepareMessage`.
|
|
392
|
-
return Data(base64Encoded: preparedSyncMessages[nativeId] ?? "") ?? data
|
|
148
|
+
let (id, wait) = waiter.make(timeout: 0.25)
|
|
149
|
+
sendEvent("onPrepareSyncMessage", [
|
|
150
|
+
"nativeId": nativeId,
|
|
151
|
+
"id": id,
|
|
152
|
+
"syncMessage": data.base64EncodedString(),
|
|
153
|
+
"assetId": assetId
|
|
154
|
+
])
|
|
155
|
+
let result = wait() ?? data.base64EncodedString()
|
|
156
|
+
return Data(base64Encoded: result) ?? data
|
|
393
157
|
}
|
|
394
158
|
|
|
395
|
-
/**
|
|
396
|
-
Defines the body of a `prepareLicense` block in `FairplayConfig`.
|
|
397
|
-
Used to sync Native->JS and JS->Native calls during `prepareLicense` execution.
|
|
398
|
-
|
|
399
|
-
- Parameter nativeId: Instance nativeId.
|
|
400
|
-
- Parameter data: License data received from `prepareLicense`.
|
|
401
|
-
- Returns: JS prepared license value.
|
|
402
|
-
*/
|
|
403
159
|
private func prepareLicenseFromJS(_ nativeId: NativeId, _ data: Data) -> Data {
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
// Wait for JS `onPrepareLicense` to finish its execution.
|
|
413
|
-
dispatchGroup.wait()
|
|
414
|
-
// Return value stored by `onPrepareLicense`.
|
|
415
|
-
return Data(base64Encoded: preparedLicenses[nativeId] ?? "") ?? data
|
|
160
|
+
let (id, wait) = waiter.make(timeout: 0.25)
|
|
161
|
+
sendEvent("onPrepareLicense", [
|
|
162
|
+
"nativeId": nativeId,
|
|
163
|
+
"id": id,
|
|
164
|
+
"license": data.base64EncodedString()
|
|
165
|
+
])
|
|
166
|
+
let result = wait() ?? data.base64EncodedString()
|
|
167
|
+
return Data(base64Encoded: result) ?? data
|
|
416
168
|
}
|
|
417
169
|
|
|
418
|
-
/**
|
|
419
|
-
Defines the body of a `prepareLicenseServerUrl` block in `FairplayConfig`.
|
|
420
|
-
Used to sync Native->JS and JS->Native calls during `prepareLicenseServerUrl` execution.
|
|
421
|
-
|
|
422
|
-
- Parameter nativeId: Instance nativeId.
|
|
423
|
-
- Parameter url: License server url string received from `prepareLicenseServerUrl`.
|
|
424
|
-
- Returns: JS prepared license server url value.
|
|
425
|
-
*/
|
|
426
170
|
private func prepareLicenseServerUrlFromJS(_ nativeId: NativeId, _ url: String) -> String {
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
}
|
|
435
|
-
// Wait for JS `onPrepareLicenseServerUrl` to finish its execution.
|
|
436
|
-
dispatchGroup.wait()
|
|
437
|
-
// Return value stored by `onPrepareLicenseServerUrl`.
|
|
438
|
-
return preparedLicenseServerUrls[nativeId] ?? url
|
|
171
|
+
let (id, wait) = waiter.make(timeout: 0.25)
|
|
172
|
+
sendEvent("onPrepareLicenseServerUrl", [
|
|
173
|
+
"nativeId": nativeId,
|
|
174
|
+
"id": id,
|
|
175
|
+
"licenseServerUrl": url
|
|
176
|
+
])
|
|
177
|
+
return wait() ?? url
|
|
439
178
|
}
|
|
440
179
|
|
|
441
|
-
/**
|
|
442
|
-
Defines the body of a `prepareContentId` block in `FairplayConfig`.
|
|
443
|
-
Used to sync Native->JS and JS->Native calls during `prepareContentId` execution.
|
|
444
|
-
|
|
445
|
-
- Parameter nativeId: Instance nativeId.
|
|
446
|
-
- Parameter contentId: The extracted contentId received from `prepareContentId`.
|
|
447
|
-
- Returns: JS prepared contentId.
|
|
448
|
-
*/
|
|
449
180
|
private func prepareContentIdFromJS(_ nativeId: NativeId, _ contentId: String) -> String {
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
}
|
|
458
|
-
// Wait for JS `onPrepareContentId` to finish its execution.
|
|
459
|
-
dispatchGroup.wait()
|
|
460
|
-
// Return value stored by `onPrepareContentId`.
|
|
461
|
-
return preparedContentIds[nativeId] ?? contentId
|
|
181
|
+
let (id, wait) = waiter.make(timeout: 0.25)
|
|
182
|
+
sendEvent("onPrepareContentId", [
|
|
183
|
+
"nativeId": nativeId,
|
|
184
|
+
"id": id,
|
|
185
|
+
"contentId": contentId
|
|
186
|
+
])
|
|
187
|
+
return wait() ?? contentId
|
|
462
188
|
}
|
|
463
189
|
}
|
package/ios/Event+JSON.swift
CHANGED
|
@@ -447,6 +447,7 @@ extension CueExitEvent: JsonConvertible {
|
|
|
447
447
|
}
|
|
448
448
|
|
|
449
449
|
extension PlayerActiveEvent: DefaultJsonConvertibleEvent {}
|
|
450
|
+
extension PlayerInactiveEvent: DefaultJsonConvertibleEvent {}
|
|
450
451
|
extension DestroyEvent: DefaultJsonConvertibleEvent {}
|
|
451
452
|
extension MutedEvent: DefaultJsonConvertibleEvent {}
|
|
452
453
|
extension UnmutedEvent: DefaultJsonConvertibleEvent {}
|
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
import BitmovinPlayer
|
|
2
|
+
import ExpoModulesCore
|
|
2
3
|
|
|
3
4
|
internal class FullscreenHandlerBridge: NSObject, FullscreenHandler {
|
|
4
|
-
|
|
5
|
+
nonisolated let isFullscreenValueBox = LockedBox(value: false)
|
|
6
|
+
|
|
7
|
+
var isFullscreen: Bool {
|
|
8
|
+
isFullscreenValueBox.value
|
|
9
|
+
}
|
|
5
10
|
|
|
6
11
|
private let nativeId: NativeId
|
|
7
|
-
private let
|
|
12
|
+
private let moduleRegistry: ModuleRegistry?
|
|
8
13
|
|
|
9
|
-
init(_ nativeId: NativeId,
|
|
14
|
+
init(_ nativeId: NativeId, moduleRegistry: ModuleRegistry?) {
|
|
10
15
|
self.nativeId = nativeId
|
|
11
|
-
self.
|
|
16
|
+
self.moduleRegistry = moduleRegistry
|
|
12
17
|
super.init()
|
|
13
18
|
}
|
|
14
19
|
|
|
@@ -16,6 +21,7 @@ internal class FullscreenHandlerBridge: NSObject, FullscreenHandler {
|
|
|
16
21
|
guard let fullscreenHandlerModule = getFullscreenHandlerModule() else {
|
|
17
22
|
return
|
|
18
23
|
}
|
|
24
|
+
// We need to set the fullscreen state before notifying the module,
|
|
19
25
|
fullscreenHandlerModule.onFullscreenRequested(nativeId: nativeId)
|
|
20
26
|
}
|
|
21
27
|
|
|
@@ -23,11 +29,12 @@ internal class FullscreenHandlerBridge: NSObject, FullscreenHandler {
|
|
|
23
29
|
guard let fullscreenHandlerModule = getFullscreenHandlerModule() else {
|
|
24
30
|
return
|
|
25
31
|
}
|
|
32
|
+
// We need to set the fullscreen state before notifying the module,
|
|
26
33
|
fullscreenHandlerModule.onFullscreenExitRequested(nativeId: nativeId)
|
|
27
34
|
}
|
|
28
35
|
|
|
29
36
|
/// Fetches the initialized `FullscreenHandlerModule` instance on RN's bridge object.
|
|
30
37
|
private func getFullscreenHandlerModule() -> FullscreenHandlerModule? {
|
|
31
|
-
|
|
38
|
+
moduleRegistry?.get(FullscreenHandlerModule.self)
|
|
32
39
|
}
|
|
33
40
|
}
|