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,74 @@
|
|
|
1
|
+
import { NativeModule, requireNativeModule } from 'expo-modules-core';
|
|
2
|
+
import { LoadingState, SourceRemoteControlConfig } from '../source';
|
|
3
|
+
import { Thumbnail } from '../thumbnail';
|
|
4
|
+
|
|
5
|
+
export type SourceModuleEvents = Record<string, any>;
|
|
6
|
+
|
|
7
|
+
declare class SourceModule extends NativeModule<SourceModuleEvents> {
|
|
8
|
+
/**
|
|
9
|
+
* Checks if the source is attached to a player.
|
|
10
|
+
*/
|
|
11
|
+
isAttachedToPlayer(nativeId: string): Promise<boolean | null>;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Checks if the source is currently active.
|
|
15
|
+
*/
|
|
16
|
+
isActive(nativeId: string): Promise<boolean | null>;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Initializes a source with the given nativeId, optional DRM nativeId, configuration object,
|
|
20
|
+
* and remote control object.
|
|
21
|
+
*/
|
|
22
|
+
initializeWithConfig(
|
|
23
|
+
nativeId: string,
|
|
24
|
+
drmNativeId?: string,
|
|
25
|
+
config?: Record<string, any>,
|
|
26
|
+
remoteControl?: SourceRemoteControlConfig
|
|
27
|
+
): Promise<void>;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Initializes a source with the given nativeId, optional DRM nativeId, configuration object,
|
|
31
|
+
* remote control object, and analytics source metadata.
|
|
32
|
+
*/
|
|
33
|
+
initializeWithAnalyticsConfig(
|
|
34
|
+
nativeId: string,
|
|
35
|
+
drmNativeId?: string,
|
|
36
|
+
config?: Record<string, any>,
|
|
37
|
+
remoteControl?: SourceRemoteControlConfig,
|
|
38
|
+
analyticsSourceMetadata?: Record<string, any>
|
|
39
|
+
): Promise<void>;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Destroys the source with the given nativeId.
|
|
43
|
+
*/
|
|
44
|
+
destroy(nativeId: string): Promise<void>;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Returns the native DRM config reference of the source with the given nativeId.
|
|
48
|
+
*/
|
|
49
|
+
duration(nativeId: string): Promise<number | null>;
|
|
50
|
+
/**
|
|
51
|
+
* Returns the current loading state of the source with the given nativeId.
|
|
52
|
+
*/
|
|
53
|
+
loadingState(nativeId: string): Promise<LoadingState | null>;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Returns the metadata of the source with the given nativeId.
|
|
57
|
+
*/
|
|
58
|
+
getMetadata(nativeId: string): Promise<Record<string, any> | null>;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Sets the metadata of the source with the given nativeId.
|
|
62
|
+
*/
|
|
63
|
+
setMetadata(
|
|
64
|
+
nativeId: string,
|
|
65
|
+
metadata: Record<string, any> | null
|
|
66
|
+
): Promise<void>;
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Returns a thumbnail for the specified playback time.
|
|
70
|
+
*/
|
|
71
|
+
getThumbnail(nativeId: string, time: number): Promise<Thumbnail | null>;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export default requireNativeModule<SourceModule>('SourceModule');
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { NativeModule, requireNativeModule } from 'expo-modules-core';
|
|
2
|
+
|
|
3
|
+
export type UuidModuleEvents = Record<string, any>;
|
|
4
|
+
|
|
5
|
+
declare class UuidModule extends NativeModule<UuidModuleEvents> {
|
|
6
|
+
generate(): string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export default requireNativeModule<UuidModule>('UuidModule');
|
package/src/nativeInstance.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import UuidModule from './modules/UuidModule';
|
|
2
2
|
|
|
3
|
-
const Uuid =
|
|
3
|
+
const Uuid = UuidModule;
|
|
4
4
|
|
|
5
5
|
export interface NativeInstanceConfig {
|
|
6
6
|
/**
|
|
@@ -20,7 +20,7 @@ export interface NativeInstanceConfig {
|
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
export default abstract class NativeInstance<
|
|
23
|
-
Config extends NativeInstanceConfig
|
|
23
|
+
Config extends NativeInstanceConfig,
|
|
24
24
|
> {
|
|
25
25
|
/**
|
|
26
26
|
* Optionally user-defined string `id` for the native instance, or UUIDv4.
|
package/src/network/index.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import BatchedBridge from 'react-native/Libraries/BatchedBridge/BatchedBridge';
|
|
1
|
+
import { EventSubscription } from 'expo-modules-core';
|
|
3
2
|
import NativeInstance from '../nativeInstance';
|
|
3
|
+
import NetworkModule from './networkModule';
|
|
4
4
|
import {
|
|
5
5
|
HttpRequestType,
|
|
6
6
|
HttpRequest,
|
|
@@ -8,11 +8,8 @@ import {
|
|
|
8
8
|
NetworkConfig,
|
|
9
9
|
} from './networkConfig';
|
|
10
10
|
|
|
11
|
-
// Export config types from Network module.
|
|
12
11
|
export { HttpRequestType, HttpRequest, HttpResponse, NetworkConfig };
|
|
13
12
|
|
|
14
|
-
const NetworkModule = NativeModules.NetworkModule;
|
|
15
|
-
|
|
16
13
|
/**
|
|
17
14
|
* Represents a native Network configuration object.
|
|
18
15
|
* @internal
|
|
@@ -27,16 +24,42 @@ export class Network extends NativeInstance<NetworkConfig> {
|
|
|
27
24
|
*/
|
|
28
25
|
isDestroyed = false;
|
|
29
26
|
|
|
27
|
+
private onPreprocessHttpRequestSubscription?: EventSubscription;
|
|
28
|
+
private onPreprocessHttpResponseSubscription?: EventSubscription;
|
|
29
|
+
|
|
30
30
|
/**
|
|
31
31
|
* Allocates the Network config instance and its resources natively.
|
|
32
32
|
*/
|
|
33
|
-
initialize = () => {
|
|
33
|
+
initialize = async () => {
|
|
34
34
|
if (!this.isInitialized) {
|
|
35
|
-
|
|
36
|
-
//
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
35
|
+
console.log('Initializing Network config:', this.nativeId);
|
|
36
|
+
// Set up event listeners for HTTP request/response preprocessing
|
|
37
|
+
this.onPreprocessHttpRequestSubscription = NetworkModule.addListener(
|
|
38
|
+
'onPreprocessHttpRequest',
|
|
39
|
+
({ nativeId, requestId, type, request }) => {
|
|
40
|
+
console.log(`Received HTTP Request [${type}]:`, request);
|
|
41
|
+
if (nativeId !== this.nativeId) {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
this.onPreprocessHttpRequest(requestId, type, request);
|
|
45
|
+
}
|
|
46
|
+
);
|
|
47
|
+
|
|
48
|
+
this.onPreprocessHttpResponseSubscription = NetworkModule.addListener(
|
|
49
|
+
'onPreprocessHttpResponse',
|
|
50
|
+
({ nativeId, responseId, type, response }) => {
|
|
51
|
+
console.log(`Received HTTP Response [${type}]:`, response);
|
|
52
|
+
if (nativeId !== this.nativeId) {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
this.onPreprocessHttpResponse(responseId, type, response);
|
|
56
|
+
}
|
|
57
|
+
);
|
|
58
|
+
|
|
59
|
+
// Create native configuration object using Expo module
|
|
60
|
+
if (this.config) {
|
|
61
|
+
await NetworkModule.initializeWithConfig(this.nativeId, this.config);
|
|
62
|
+
}
|
|
40
63
|
this.isInitialized = true;
|
|
41
64
|
}
|
|
42
65
|
};
|
|
@@ -44,9 +67,13 @@ export class Network extends NativeInstance<NetworkConfig> {
|
|
|
44
67
|
/**
|
|
45
68
|
* Destroys the native Network config and releases all of its allocated resources.
|
|
46
69
|
*/
|
|
47
|
-
destroy = () => {
|
|
70
|
+
destroy = async () => {
|
|
48
71
|
if (!this.isDestroyed) {
|
|
49
|
-
NetworkModule.destroy(this.nativeId);
|
|
72
|
+
await NetworkModule.destroy(this.nativeId);
|
|
73
|
+
this.onPreprocessHttpRequestSubscription?.remove();
|
|
74
|
+
this.onPreprocessHttpResponseSubscription?.remove();
|
|
75
|
+
this.onPreprocessHttpRequestSubscription = undefined;
|
|
76
|
+
this.onPreprocessHttpResponseSubscription = undefined;
|
|
50
77
|
this.isDestroyed = true;
|
|
51
78
|
}
|
|
52
79
|
};
|
|
@@ -61,7 +88,7 @@ export class Network extends NativeInstance<NetworkConfig> {
|
|
|
61
88
|
* @param type Type of the request to be made.
|
|
62
89
|
* @param request The HTTP request to process.
|
|
63
90
|
*/
|
|
64
|
-
onPreprocessHttpRequest = (
|
|
91
|
+
private onPreprocessHttpRequest = (
|
|
65
92
|
requestId: string,
|
|
66
93
|
type: HttpRequestType,
|
|
67
94
|
request: HttpRequest
|
|
@@ -86,7 +113,7 @@ export class Network extends NativeInstance<NetworkConfig> {
|
|
|
86
113
|
* @param type Type of the request to be made.
|
|
87
114
|
* @param response The HTTP response to process.
|
|
88
115
|
*/
|
|
89
|
-
onPreprocessHttpResponse = (
|
|
116
|
+
private onPreprocessHttpResponse = (
|
|
90
117
|
responseId: string,
|
|
91
118
|
type: HttpRequestType,
|
|
92
119
|
response: HttpResponse
|
|
@@ -27,7 +27,7 @@ export type HttpRequestBody = string;
|
|
|
27
27
|
|
|
28
28
|
/** Represents an HTTP request. */
|
|
29
29
|
export interface HttpRequest {
|
|
30
|
-
/** The
|
|
30
|
+
/** The HTTP request body to send to the server. */
|
|
31
31
|
body?: HttpRequestBody;
|
|
32
32
|
/**
|
|
33
33
|
* The HTTP Headers of the request.
|
|
@@ -47,7 +47,7 @@ export type HttpResponseBody = string;
|
|
|
47
47
|
|
|
48
48
|
/** Represents an HTTP response. */
|
|
49
49
|
export interface HttpResponse {
|
|
50
|
-
/** The
|
|
50
|
+
/** The HTTP response body of the response. */
|
|
51
51
|
body?: HttpResponseBody;
|
|
52
52
|
/**
|
|
53
53
|
* The HTTP Headers of the response.
|
|
@@ -77,7 +77,7 @@ export interface NetworkConfig extends NativeInstanceConfig {
|
|
|
77
77
|
* - If the promise resolves, the player will use the processed request.
|
|
78
78
|
* - If the promise rejects, the player will fall back to using the original request.
|
|
79
79
|
*
|
|
80
|
-
* @
|
|
80
|
+
* @example
|
|
81
81
|
* ```
|
|
82
82
|
* const requestCallback = (type: HttpRequestType, request: HttpRequest) => {
|
|
83
83
|
* // Access current properties
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { NativeModule, requireNativeModule } from 'expo-modules-core';
|
|
2
|
+
import {
|
|
3
|
+
HttpRequest,
|
|
4
|
+
HttpResponse,
|
|
5
|
+
NetworkConfig,
|
|
6
|
+
HttpRequestType,
|
|
7
|
+
} from './networkConfig';
|
|
8
|
+
|
|
9
|
+
export type NetworkModuleEvents = {
|
|
10
|
+
onPreprocessHttpRequest: ({
|
|
11
|
+
nativeId,
|
|
12
|
+
requestId,
|
|
13
|
+
type,
|
|
14
|
+
request,
|
|
15
|
+
}: {
|
|
16
|
+
nativeId: string;
|
|
17
|
+
requestId: string;
|
|
18
|
+
type: HttpRequestType;
|
|
19
|
+
request: HttpRequest;
|
|
20
|
+
}) => void;
|
|
21
|
+
onPreprocessHttpResponse: ({
|
|
22
|
+
nativeId,
|
|
23
|
+
responseId,
|
|
24
|
+
type,
|
|
25
|
+
response,
|
|
26
|
+
}: {
|
|
27
|
+
nativeId: string;
|
|
28
|
+
responseId: string;
|
|
29
|
+
type: HttpRequestType;
|
|
30
|
+
response: HttpResponse;
|
|
31
|
+
}) => void;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Native NetworkModule using Expo modules API.
|
|
36
|
+
* Provides modern async/await interface while maintaining backward compatibility.
|
|
37
|
+
*/
|
|
38
|
+
declare class NetworkModule extends NativeModule<NetworkModuleEvents> {
|
|
39
|
+
initializeWithConfig(nativeId: string, config: NetworkConfig): Promise<void>;
|
|
40
|
+
destroy(nativeId: string): Promise<void>;
|
|
41
|
+
setPreprocessedHttpRequest(
|
|
42
|
+
requestId: string,
|
|
43
|
+
request: HttpRequest
|
|
44
|
+
): Promise<void>;
|
|
45
|
+
setPreprocessedHttpResponse(
|
|
46
|
+
responseId: string,
|
|
47
|
+
response: HttpResponse
|
|
48
|
+
): Promise<void>;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export default requireNativeModule<NetworkModule>('NetworkModule');
|
|
@@ -1,11 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
EmitterSubscription,
|
|
3
|
-
NativeEventEmitter,
|
|
4
|
-
NativeModule,
|
|
5
|
-
NativeModules,
|
|
6
|
-
} from 'react-native';
|
|
1
|
+
import { EventSubscription } from 'expo-modules-core';
|
|
7
2
|
import NativeInstance from '../nativeInstance';
|
|
8
|
-
import { SourceConfig } from '../source';
|
|
9
3
|
import {
|
|
10
4
|
BitmovinNativeOfflineEventData,
|
|
11
5
|
OfflineContentManagerListener,
|
|
@@ -14,30 +8,8 @@ import {
|
|
|
14
8
|
import { OfflineContentConfig } from './offlineContentConfig';
|
|
15
9
|
import { OfflineDownloadRequest } from './offlineDownloadRequest';
|
|
16
10
|
import { OfflineState } from './offlineState';
|
|
17
|
-
import { Drm } from '
|
|
18
|
-
|
|
19
|
-
interface NativeOfflineModule extends NativeModule {
|
|
20
|
-
initWithConfig(
|
|
21
|
-
nativeId: string,
|
|
22
|
-
config: { identifier: string; sourceConfig: SourceConfig },
|
|
23
|
-
drmNativeId: string | undefined
|
|
24
|
-
): Promise<void>;
|
|
25
|
-
getState(nativeId: string): Promise<OfflineState>;
|
|
26
|
-
getOptions(nativeId: string): Promise<void>;
|
|
27
|
-
download(nativeId: string, request: OfflineDownloadRequest): Promise<void>;
|
|
28
|
-
resume(nativeId: string): Promise<void>;
|
|
29
|
-
suspend(nativeId: string): Promise<void>;
|
|
30
|
-
cancelDownload(nativeId: string): Promise<void>;
|
|
31
|
-
usedStorage(nativeId: string): Promise<number>;
|
|
32
|
-
deleteAll(nativeId: string): Promise<void>;
|
|
33
|
-
downloadLicense(nativeId: string): Promise<void>;
|
|
34
|
-
releaseLicense(nativeId: string): Promise<void>;
|
|
35
|
-
renewOfflineLicense(nativeId: string): Promise<void>;
|
|
36
|
-
release(nativeId: string): Promise<void>;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
const OfflineModule =
|
|
40
|
-
NativeModules.BitmovinOfflineModule as NativeOfflineModule;
|
|
11
|
+
import { Drm } from '../drm';
|
|
12
|
+
import OfflineModule from './offlineModule';
|
|
41
13
|
|
|
42
14
|
const handleBitmovinNativeOfflineEvent = (
|
|
43
15
|
data: BitmovinNativeOfflineEventData,
|
|
@@ -73,46 +45,39 @@ const handleBitmovinNativeOfflineEvent = (
|
|
|
73
45
|
* without an active network connection. An OfflineContentManager instance can be created via
|
|
74
46
|
* the constructor and will be idle until initialized.
|
|
75
47
|
*
|
|
76
|
-
* @
|
|
48
|
+
* @remarks Platform: Android, iOS
|
|
77
49
|
*/
|
|
78
50
|
export class OfflineContentManager extends NativeInstance<OfflineContentConfig> {
|
|
79
51
|
isInitialized = false;
|
|
80
52
|
isDestroyed = false;
|
|
81
|
-
private eventSubscription?:
|
|
53
|
+
private eventSubscription?: EventSubscription;
|
|
82
54
|
private listeners: Set<OfflineContentManagerListener> =
|
|
83
55
|
new Set<OfflineContentManagerListener>();
|
|
84
56
|
private drm?: Drm;
|
|
85
57
|
|
|
86
|
-
constructor(config: OfflineContentConfig) {
|
|
87
|
-
super(config);
|
|
88
|
-
}
|
|
89
|
-
|
|
90
58
|
/**
|
|
91
59
|
* Allocates the native `OfflineManager` instance and its resources natively.
|
|
92
60
|
* Registers the `DeviceEventEmitter` listener to receive data from the native `OfflineContentManagerListener` callbacks
|
|
93
61
|
*/
|
|
94
62
|
initialize = async (): Promise<void> => {
|
|
95
|
-
let initPromise = Promise.resolve();
|
|
96
63
|
if (!this.isInitialized && this.config) {
|
|
97
|
-
this.eventSubscription =
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
(data?: BitmovinNativeOfflineEventData) => {
|
|
102
|
-
if (this.nativeId !== data?.nativeId) {
|
|
64
|
+
this.eventSubscription = OfflineModule.addListener(
|
|
65
|
+
'onBitmovinOfflineEvent',
|
|
66
|
+
(event: BitmovinNativeOfflineEventData) => {
|
|
67
|
+
if (this.nativeId !== event.nativeId) {
|
|
103
68
|
return;
|
|
104
69
|
}
|
|
105
70
|
|
|
106
|
-
handleBitmovinNativeOfflineEvent(
|
|
71
|
+
handleBitmovinNativeOfflineEvent(event, this.listeners);
|
|
107
72
|
}
|
|
108
73
|
);
|
|
109
74
|
|
|
110
75
|
if (this.config.sourceConfig.drmConfig) {
|
|
111
76
|
this.drm = new Drm(this.config.sourceConfig.drmConfig);
|
|
112
|
-
this.drm.initialize();
|
|
77
|
+
await this.drm.initialize();
|
|
113
78
|
}
|
|
114
79
|
|
|
115
|
-
|
|
80
|
+
await OfflineModule.initializeWithConfig(
|
|
116
81
|
this.nativeId,
|
|
117
82
|
{
|
|
118
83
|
identifier: this.config.identifier,
|
|
@@ -123,7 +88,7 @@ export class OfflineContentManager extends NativeInstance<OfflineContentConfig>
|
|
|
123
88
|
}
|
|
124
89
|
|
|
125
90
|
this.isInitialized = true;
|
|
126
|
-
return
|
|
91
|
+
return Promise.resolve();
|
|
127
92
|
};
|
|
128
93
|
|
|
129
94
|
/**
|
|
@@ -158,7 +123,7 @@ export class OfflineContentManager extends NativeInstance<OfflineContentConfig>
|
|
|
158
123
|
* Gets the current state of the `OfflineContentManager`
|
|
159
124
|
*/
|
|
160
125
|
state = async (): Promise<OfflineState> => {
|
|
161
|
-
return OfflineModule.getState(this.nativeId)
|
|
126
|
+
return OfflineModule.getState(this.nativeId) as Promise<OfflineState>;
|
|
162
127
|
};
|
|
163
128
|
|
|
164
129
|
/**
|
|
@@ -228,7 +193,7 @@ export class OfflineContentManager extends NativeInstance<OfflineContentConfig>
|
|
|
228
193
|
* When finished successfully data will be passed to the `OfflineContentManagerListener.onDrmLicenseUpdated`.
|
|
229
194
|
* Errors are transmitted to the `OfflineContentManagerListener.onError`.
|
|
230
195
|
*
|
|
231
|
-
* @
|
|
196
|
+
* @remarks Platform: Android
|
|
232
197
|
*/
|
|
233
198
|
releaseLicense = async (): Promise<void> => {
|
|
234
199
|
return OfflineModule.releaseLicense(this.nativeId);
|
|
@@ -3,7 +3,7 @@ import { OfflineState } from './offlineState';
|
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Enum to hold the `eventType` on the `BitmovinNativeOfflineEventData`
|
|
6
|
-
* @
|
|
6
|
+
* @remarks Platform: Android, iOS
|
|
7
7
|
*/
|
|
8
8
|
export enum OfflineEventType {
|
|
9
9
|
onCompleted = 'onCompleted',
|
|
@@ -19,7 +19,7 @@ export enum OfflineEventType {
|
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
21
|
* The base interface for all offline events.
|
|
22
|
-
* @
|
|
22
|
+
* @remarks Platform: Android, iOS
|
|
23
23
|
*/
|
|
24
24
|
export interface OfflineEvent<T extends OfflineEventType> {
|
|
25
25
|
/**
|
|
@@ -42,7 +42,7 @@ export interface OfflineEvent<T extends OfflineEventType> {
|
|
|
42
42
|
|
|
43
43
|
/**
|
|
44
44
|
* Emitted when the download process has completed.
|
|
45
|
-
* @
|
|
45
|
+
* @remarks Platform: Android, iOS
|
|
46
46
|
*/
|
|
47
47
|
export interface OnCompletedEvent
|
|
48
48
|
extends OfflineEvent<OfflineEventType.onCompleted> {
|
|
@@ -54,7 +54,7 @@ export interface OnCompletedEvent
|
|
|
54
54
|
|
|
55
55
|
/**
|
|
56
56
|
* Emitted when an error has occurred.
|
|
57
|
-
* @
|
|
57
|
+
* @remarks Platform: Android, iOS
|
|
58
58
|
*/
|
|
59
59
|
export interface OnErrorEvent extends OfflineEvent<OfflineEventType.onError> {
|
|
60
60
|
/**
|
|
@@ -69,7 +69,7 @@ export interface OnErrorEvent extends OfflineEvent<OfflineEventType.onError> {
|
|
|
69
69
|
|
|
70
70
|
/**
|
|
71
71
|
* Emitted when there is a progress change for the process call.
|
|
72
|
-
* @
|
|
72
|
+
* @remarks Platform: Android, iOS
|
|
73
73
|
*/
|
|
74
74
|
export interface OnProgressEvent
|
|
75
75
|
extends OfflineEvent<OfflineEventType.onProgress> {
|
|
@@ -81,7 +81,7 @@ export interface OnProgressEvent
|
|
|
81
81
|
|
|
82
82
|
/**
|
|
83
83
|
* Emitted when the `OfflineContentOptions` is available after a `OfflineContentManager.getOptions` call.
|
|
84
|
-
* @
|
|
84
|
+
* @remarks Platform: Android, iOS
|
|
85
85
|
*/
|
|
86
86
|
export interface OnOptionsAvailableEvent
|
|
87
87
|
extends OfflineEvent<OfflineEventType.onOptionsAvailable> {
|
|
@@ -93,42 +93,39 @@ export interface OnOptionsAvailableEvent
|
|
|
93
93
|
|
|
94
94
|
/**
|
|
95
95
|
* Emitted when the DRM license was updated.
|
|
96
|
-
* @
|
|
96
|
+
* @remarks Platform: Android, iOS
|
|
97
97
|
*/
|
|
98
|
-
export
|
|
99
|
-
|
|
98
|
+
export type OnDrmLicenseUpdatedEvent =
|
|
99
|
+
OfflineEvent<OfflineEventType.onDrmLicenseUpdated>;
|
|
100
100
|
|
|
101
101
|
/**
|
|
102
102
|
* Emitted when the DRM license has expired.
|
|
103
|
-
* @
|
|
103
|
+
* @remarks Platform: iOS
|
|
104
104
|
*/
|
|
105
|
-
export
|
|
106
|
-
|
|
105
|
+
export type OnDrmLicenseExpiredEvent =
|
|
106
|
+
OfflineEvent<OfflineEventType.onDrmLicenseExpired>;
|
|
107
107
|
|
|
108
108
|
/**
|
|
109
109
|
* Emitted when all active actions have been suspended.
|
|
110
|
-
* @
|
|
110
|
+
* @remarks Platform: Android, iOS
|
|
111
111
|
*/
|
|
112
|
-
export
|
|
113
|
-
extends OfflineEvent<OfflineEventType.onSuspended> {}
|
|
112
|
+
export type OnSuspendedEvent = OfflineEvent<OfflineEventType.onSuspended>;
|
|
114
113
|
|
|
115
114
|
/**
|
|
116
115
|
* Emitted when all actions have been resumed.
|
|
117
|
-
* @
|
|
116
|
+
* @remarks Platform: Android, iOS
|
|
118
117
|
*/
|
|
119
|
-
export
|
|
120
|
-
extends OfflineEvent<OfflineEventType.onResumed> {}
|
|
118
|
+
export type OnResumedEvent = OfflineEvent<OfflineEventType.onResumed>;
|
|
121
119
|
|
|
122
120
|
/**
|
|
123
121
|
* Emitted when the download of the media content was canceled by the user and all partially downloaded content has been deleted from disk.
|
|
124
|
-
* @
|
|
122
|
+
* @remarks Platform: Android, iOS
|
|
125
123
|
*/
|
|
126
|
-
export
|
|
127
|
-
extends OfflineEvent<OfflineEventType.onCanceled> {}
|
|
124
|
+
export type OnCanceledEvent = OfflineEvent<OfflineEventType.onCanceled>;
|
|
128
125
|
|
|
129
126
|
/**
|
|
130
127
|
* The type aggregation for all possible native offline events received from the `DeviceEventEmitter`
|
|
131
|
-
* @
|
|
128
|
+
* @remarks Platform: Android, iOS
|
|
132
129
|
*/
|
|
133
130
|
export type BitmovinNativeOfflineEventData =
|
|
134
131
|
| OnCompletedEvent
|
|
@@ -143,7 +140,7 @@ export type BitmovinNativeOfflineEventData =
|
|
|
143
140
|
|
|
144
141
|
/**
|
|
145
142
|
* The listener that can be passed to the `OfflineContentManager` to receive callbacks for different events.
|
|
146
|
-
* @
|
|
143
|
+
* @remarks Platform: Android, iOS
|
|
147
144
|
*/
|
|
148
145
|
export interface OfflineContentManagerListener {
|
|
149
146
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Superclass of entries which can be selected to download for offline playback
|
|
3
|
-
* @
|
|
3
|
+
* @remarks Platform: Android, iOS
|
|
4
4
|
*/
|
|
5
5
|
export interface OfflineContentOptionEntry {
|
|
6
6
|
/**
|
|
@@ -15,7 +15,7 @@ export interface OfflineContentOptionEntry {
|
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
* Represents the downloadable options provided via the `onOptionsAvailable` callback on `OfflineContentManagerListener`
|
|
18
|
-
* @
|
|
18
|
+
* @remarks Platform: Android, iOS
|
|
19
19
|
*/
|
|
20
20
|
export interface OfflineContentOptions {
|
|
21
21
|
/**
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { NativeModule, requireNativeModule } from 'expo-modules-core';
|
|
2
|
+
import { SourceConfig } from '../source';
|
|
3
|
+
import { OfflineDownloadRequest } from './offlineDownloadRequest';
|
|
4
|
+
import { BitmovinNativeOfflineEventData } from './offlineContentManagerListener';
|
|
5
|
+
|
|
6
|
+
export type OfflineModuleEvents = {
|
|
7
|
+
onBitmovinOfflineEvent: (event: BitmovinNativeOfflineEventData) => void;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Native OfflineModule using Expo modules API.
|
|
12
|
+
* Provides modern async/await interface while maintaining backward compatibility.
|
|
13
|
+
*/
|
|
14
|
+
declare class OfflineModule extends NativeModule<OfflineModuleEvents> {
|
|
15
|
+
initializeWithConfig(
|
|
16
|
+
nativeId: string,
|
|
17
|
+
config: { identifier: string; sourceConfig: SourceConfig },
|
|
18
|
+
drmNativeId: string | undefined
|
|
19
|
+
): Promise<void>;
|
|
20
|
+
|
|
21
|
+
getState(nativeId: string): Promise<string>;
|
|
22
|
+
|
|
23
|
+
getOptions(nativeId: string): Promise<void>;
|
|
24
|
+
|
|
25
|
+
download(nativeId: string, request: OfflineDownloadRequest): Promise<void>;
|
|
26
|
+
|
|
27
|
+
resume(nativeId: string): Promise<void>;
|
|
28
|
+
|
|
29
|
+
suspend(nativeId: string): Promise<void>;
|
|
30
|
+
|
|
31
|
+
cancelDownload(nativeId: string): Promise<void>;
|
|
32
|
+
|
|
33
|
+
usedStorage(nativeId: string): Promise<number>;
|
|
34
|
+
|
|
35
|
+
deleteAll(nativeId: string): Promise<void>;
|
|
36
|
+
|
|
37
|
+
downloadLicense(nativeId: string): Promise<void>;
|
|
38
|
+
|
|
39
|
+
releaseLicense(nativeId: string): Promise<void>;
|
|
40
|
+
|
|
41
|
+
renewOfflineLicense(nativeId: string): Promise<void>;
|
|
42
|
+
|
|
43
|
+
release(nativeId: string): Promise<void>;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export default requireNativeModule<OfflineModule>('OfflineModule');
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Object used configure how the native offline managers create and get offline source configurations
|
|
3
|
-
* @
|
|
3
|
+
* @remarks Platform: Android, iOS
|
|
4
4
|
*/
|
|
5
5
|
export interface OfflineSourceOptions {
|
|
6
6
|
/**
|
|
7
7
|
* Whether or not the player should restrict playback only to audio, video and subtitle tracks which are stored offline on the device. This has to be set to true if the device has no network access.
|
|
8
|
-
* @
|
|
8
|
+
* @remarks Platform: iOS
|
|
9
9
|
*/
|
|
10
10
|
restrictedToAssetCache?: boolean;
|
|
11
11
|
}
|
package/src/playbackConfig.ts
CHANGED
|
@@ -51,11 +51,10 @@ export interface PlaybackConfig {
|
|
|
51
51
|
*
|
|
52
52
|
* Default is `false`.
|
|
53
53
|
*
|
|
54
|
-
* @
|
|
55
|
-
* On Android, {@link MediaControlConfig.isEnabled} has to be `true` for
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
* On tvOS, background playback is only supported for audio-only content.
|
|
54
|
+
* @remarks
|
|
55
|
+
* - On Android, {@link MediaControlConfig.isEnabled} has to be `true` for
|
|
56
|
+
* background playback to work.
|
|
57
|
+
* - On tvOS, background playback is only supported for audio-only content.
|
|
59
58
|
*
|
|
60
59
|
* @example
|
|
61
60
|
* ```
|
|
@@ -84,7 +83,7 @@ export interface PlaybackConfig {
|
|
|
84
83
|
/**
|
|
85
84
|
* Configures decoder behaviour.
|
|
86
85
|
*
|
|
87
|
-
* @
|
|
86
|
+
* @remarks Platform: Android
|
|
88
87
|
*/
|
|
89
88
|
decoderConfig?: DecoderConfig;
|
|
90
89
|
}
|