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,89 @@
|
|
|
1
|
+
package com.bitmovin.player.reactnative.extensions
|
|
2
|
+
|
|
3
|
+
fun List<Any?>.getBooleanOrNull(index: Int): Boolean? =
|
|
4
|
+
if (index in indices) get(index) as? Boolean else null
|
|
5
|
+
|
|
6
|
+
fun List<Any?>.getIntOrNull(index: Int): Int? =
|
|
7
|
+
if (index in indices) (get(index) as? Number)?.toInt() else null
|
|
8
|
+
|
|
9
|
+
fun List<Any?>.getInt(index: Int): Int =
|
|
10
|
+
if (index in indices) (get(index) as? Number)?.toInt() ?: 0 else 0
|
|
11
|
+
|
|
12
|
+
fun List<Any?>.getDoubleOrNull(index: Int): Double? =
|
|
13
|
+
if (index in indices) (get(index) as? Number)?.toDouble() else null
|
|
14
|
+
|
|
15
|
+
fun List<Any?>.getString(index: Int): String? =
|
|
16
|
+
if (index in indices) get(index) as? String else null
|
|
17
|
+
|
|
18
|
+
fun List<Any?>.getMap(index: Int): Map<String, Any?>? =
|
|
19
|
+
if (index in indices) get(index) as? Map<String, Any?> else null
|
|
20
|
+
|
|
21
|
+
fun List<Any?>.getArray(index: Int): List<Any?>? =
|
|
22
|
+
if (index in indices) get(index) as? List<Any?> else null
|
|
23
|
+
|
|
24
|
+
inline fun <T> List<Any?>.withDouble(
|
|
25
|
+
index: Int,
|
|
26
|
+
block: (Double) -> T,
|
|
27
|
+
): T? {
|
|
28
|
+
val value = if (index in indices) (get(index) as? Number)?.toDouble() else null
|
|
29
|
+
return if (value != null) block(value) else null
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
inline fun <T> List<Any?>.withMap(
|
|
33
|
+
index: Int,
|
|
34
|
+
block: (Map<String, Any?>) -> T,
|
|
35
|
+
): T? {
|
|
36
|
+
val value = if (index in indices) get(index) as? Map<String, Any?> else null
|
|
37
|
+
return if (value != null) block(value) else null
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
inline fun <T> List<Any?>.withInt(
|
|
41
|
+
index: Int,
|
|
42
|
+
block: (Int) -> T,
|
|
43
|
+
): T? {
|
|
44
|
+
val value = if (index in indices) (get(index) as? Number)?.toInt() else null
|
|
45
|
+
return if (value != null) block(value) else null
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
inline fun <T> List<Any?>.withBoolean(
|
|
49
|
+
index: Int,
|
|
50
|
+
block: (Boolean) -> T,
|
|
51
|
+
): T? {
|
|
52
|
+
val value = if (index in indices) get(index) as? Boolean else null
|
|
53
|
+
return if (value != null) block(value) else null
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
inline fun <T> List<Any?>.withString(
|
|
57
|
+
index: Int,
|
|
58
|
+
block: (String) -> T,
|
|
59
|
+
): T? {
|
|
60
|
+
val value = if (index in indices) get(index) as? String else null
|
|
61
|
+
return if (value != null) block(value) else null
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
inline fun <T> List<Any?>.withArray(
|
|
65
|
+
index: Int,
|
|
66
|
+
block: (List<Any?>) -> T,
|
|
67
|
+
): T? {
|
|
68
|
+
val value = if (index in indices) get(index) as? List<Any?> else null
|
|
69
|
+
return if (value != null) block(value) else null
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
inline fun <T> List<Any?>.withStringArray(
|
|
73
|
+
index: Int,
|
|
74
|
+
block: (List<String?>) -> T,
|
|
75
|
+
): T? {
|
|
76
|
+
val value = if (index in indices) (get(index) as? List<*>)?.map { item -> item as? String } else null
|
|
77
|
+
return if (value != null) block(value) else null
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
fun List<Any?>.getStringArray(index: Int): List<String?>? =
|
|
81
|
+
if (index in indices) (get(index) as? List<*>)?.map { it as? String } else null
|
|
82
|
+
|
|
83
|
+
inline fun <T, R> List<Any?>.mapValue(
|
|
84
|
+
index: Int,
|
|
85
|
+
transform: (Any?) -> R?,
|
|
86
|
+
): R? = if (index in indices) transform(get(index)) else null
|
|
87
|
+
|
|
88
|
+
inline fun <reified T> List<Any?>.getTyped(index: Int): T? =
|
|
89
|
+
if (index in indices) get(index) as? T else null
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
package com.bitmovin.player.reactnative.extensions
|
|
2
|
+
|
|
3
|
+
fun Map<String, Any?>.getBooleanOrNull(key: String): Boolean? = get(key) as? Boolean
|
|
4
|
+
fun Map<String, Any?>.getIntOrNull(key: String): Int? = (get(key) as? Number)?.toInt()
|
|
5
|
+
fun Map<String, Any?>.getInt(key: String): Int = (get(key) as? Number)?.toInt() ?: 0
|
|
6
|
+
fun Map<String, Any?>.getDoubleOrNull(key: String): Double? = (get(key) as? Number)?.toDouble()
|
|
7
|
+
fun Map<String, Any?>.getString(key: String): String? = get(key) as? String
|
|
8
|
+
fun Map<String, Any?>.getMap(key: String): Map<String, Any?>? = get(key) as? Map<String, Any?>
|
|
9
|
+
fun Map<String, Any?>.getArray(key: String): List<Any?>? = get(key) as? List<Any?>
|
|
10
|
+
|
|
11
|
+
inline fun <T> Map<String, Any?>.withDouble(
|
|
12
|
+
key: String,
|
|
13
|
+
block: (Double) -> T,
|
|
14
|
+
): T? {
|
|
15
|
+
val value = (get(key) as? Number)?.toDouble()
|
|
16
|
+
return if (value != null) block(value) else null
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
inline fun <T> Map<String, Any?>.withMap(
|
|
20
|
+
key: String,
|
|
21
|
+
block: (Map<String, Any?>) -> T,
|
|
22
|
+
): T? {
|
|
23
|
+
val value = get(key) as? Map<String, Any?>
|
|
24
|
+
return if (value != null) block(value) else null
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
inline fun <T> Map<String, Any?>.withInt(
|
|
28
|
+
key: String,
|
|
29
|
+
block: (Int) -> T,
|
|
30
|
+
): T? {
|
|
31
|
+
val value = (get(key) as? Number)?.toInt()
|
|
32
|
+
return if (value != null) block(value) else null
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
inline fun <T> Map<String, Any?>.withBoolean(
|
|
36
|
+
key: String,
|
|
37
|
+
block: (Boolean) -> T,
|
|
38
|
+
): T? {
|
|
39
|
+
val value = get(key) as? Boolean
|
|
40
|
+
return if (value != null) block(value) else null
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
inline fun <T> Map<String, Any?>.withString(
|
|
44
|
+
key: String,
|
|
45
|
+
block: (String) -> T,
|
|
46
|
+
): T? {
|
|
47
|
+
val value = get(key) as? String
|
|
48
|
+
return if (value != null) block(value) else null
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
inline fun <T> Map<String, Any?>.withArray(
|
|
52
|
+
key: String,
|
|
53
|
+
block: (List<Any?>) -> T,
|
|
54
|
+
): T? {
|
|
55
|
+
val value = get(key) as? List<Any?>
|
|
56
|
+
return if (value != null) block(value) else null
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
inline fun <T> Map<String, Any?>.withStringArray(
|
|
60
|
+
key: String,
|
|
61
|
+
block: (List<String?>) -> T,
|
|
62
|
+
): T? {
|
|
63
|
+
val value = (get(key) as? List<*>)?.map { item -> item as? String }
|
|
64
|
+
return if (value != null) block(value) else null
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
fun Map<String, Any?>.getStringArray(key: String): List<String?>? = (get(key) as? List<*>)?.map { it as? String }
|
|
68
|
+
|
|
69
|
+
inline fun <T, R> Map<String, Any?>.mapValue(
|
|
70
|
+
key: String,
|
|
71
|
+
transform: (Any?) -> R?,
|
|
72
|
+
): R? = if (containsKey(key)) transform(get(key)) else null
|
|
73
|
+
|
|
74
|
+
inline fun <reified T> Map<String, Any?>.toMap(): Map<String, T> = mapValues { it.value as T }
|
|
75
|
+
|
|
76
|
+
/** Convert a [Map] to [Map], adding each [T] value using [put]. */
|
|
77
|
+
private inline fun <T> Map<String, T>.toMap(
|
|
78
|
+
put: MutableMap<String, Any?>.(String, T) -> Unit = { key, value -> this[key] = value },
|
|
79
|
+
): Map<String, Any?> = mutableMapOf<String, Any?>().apply {
|
|
80
|
+
forEach { put(it.key, it.value) }
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
@JvmName("toStringMap")
|
|
84
|
+
fun Map<String, String>.toMap(): Map<String, Any?> = toMap()
|
|
85
|
+
|
|
86
|
+
fun List<Any?>.toMapList(): List<Map<String, Any?>?> = map { it as? Map<String, Any?> }
|
|
87
|
+
|
|
88
|
+
fun List<Any?>.toStringList(): List<String?> = map { it as? String }
|
|
89
|
+
fun List<Any?>.toBooleanList(): List<Boolean?> = map { it as? Boolean }
|
|
90
|
+
fun List<Any?>.toDoubleList(): List<Double?> = map { (it as? Number)?.toDouble() }
|
|
91
|
+
fun List<Any?>.toIntList(): List<Int?> = map { (it as? Number)?.toInt() }
|
|
92
|
+
|
|
93
|
+
inline fun <T> List<T>.mapToList(
|
|
94
|
+
transform: (T) -> Map<String, Any?>,
|
|
95
|
+
): List<Map<String, Any?>> = map(transform)
|
package/android/src/main/java/com/bitmovin/player/reactnative/offline/OfflineContentManagerBridge.kt
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
package com.bitmovin.player.reactnative.offline
|
|
2
2
|
|
|
3
|
+
import android.content.Context
|
|
3
4
|
import com.bitmovin.player.api.deficiency.ErrorEvent
|
|
4
5
|
import com.bitmovin.player.api.offline.OfflineContentManager
|
|
5
6
|
import com.bitmovin.player.api.offline.OfflineContentManagerListener
|
|
@@ -9,15 +10,13 @@ import com.bitmovin.player.api.offline.options.OfflineOptionEntryAction
|
|
|
9
10
|
import com.bitmovin.player.api.offline.options.OfflineOptionEntryState
|
|
10
11
|
import com.bitmovin.player.api.source.SourceConfig
|
|
11
12
|
import com.bitmovin.player.reactnative.NativeId
|
|
13
|
+
import com.bitmovin.player.reactnative.OfflineModule
|
|
12
14
|
import com.bitmovin.player.reactnative.converter.toJson
|
|
13
|
-
import com.facebook.react.bridge.Arguments
|
|
14
|
-
import com.facebook.react.bridge.ReactApplicationContext
|
|
15
|
-
import com.facebook.react.bridge.WritableMap
|
|
16
|
-
import com.facebook.react.modules.core.DeviceEventManagerModule.RCTDeviceEventEmitter
|
|
17
15
|
|
|
18
16
|
class OfflineContentManagerBridge(
|
|
19
17
|
private val nativeId: NativeId,
|
|
20
|
-
|
|
18
|
+
context: Context,
|
|
19
|
+
private val offlineModule: OfflineModule,
|
|
21
20
|
private val identifier: String,
|
|
22
21
|
source: SourceConfig,
|
|
23
22
|
location: String,
|
|
@@ -58,8 +57,7 @@ class OfflineContentManagerBridge(
|
|
|
58
57
|
*/
|
|
59
58
|
fun process(request: OfflineDownloadRequest) {
|
|
60
59
|
if (contentOptions != null) {
|
|
61
|
-
val sortedVideoOptions = contentOptions!!.videoOptions
|
|
62
|
-
.sortedBy { option -> option.bitrate }
|
|
60
|
+
val sortedVideoOptions = contentOptions!!.videoOptions.sortedBy { option -> option.bitrate }
|
|
63
61
|
if (request.minimumBitrate == null) {
|
|
64
62
|
sortedVideoOptions.lastOrNull()
|
|
65
63
|
} else {
|
|
@@ -135,8 +133,7 @@ class OfflineContentManagerBridge(
|
|
|
135
133
|
options?.videoOptions?.let { allOptions.addAll(it) }
|
|
136
134
|
options?.audioOptions?.let { allOptions.addAll(it) }
|
|
137
135
|
options?.textOptions?.let { allOptions.addAll(it) }
|
|
138
|
-
val trackableStates =
|
|
139
|
-
listOf(OfflineOptionEntryState.Suspended, OfflineOptionEntryState.Downloading)
|
|
136
|
+
val trackableStates = listOf(OfflineOptionEntryState.Suspended, OfflineOptionEntryState.Downloading)
|
|
140
137
|
|
|
141
138
|
var state = allOptions.firstOrNull { trackableStates.contains(it.state) }?.state
|
|
142
139
|
|
|
@@ -147,86 +144,57 @@ class OfflineContentManagerBridge(
|
|
|
147
144
|
return state ?: OfflineOptionEntryState.NotDownloaded
|
|
148
145
|
}
|
|
149
146
|
|
|
150
|
-
/**
|
|
151
|
-
* Called when a process call has completed.
|
|
152
|
-
*/
|
|
153
147
|
override fun onCompleted(source: SourceConfig, options: OfflineContentOptions) {
|
|
154
148
|
this.contentOptions = options
|
|
155
149
|
sendEvent(
|
|
156
150
|
OfflineEventType.ON_COMPLETED,
|
|
157
|
-
|
|
158
|
-
putMap("options", options.toJson())
|
|
159
|
-
},
|
|
151
|
+
mapOf("options" to options.toJson()),
|
|
160
152
|
)
|
|
161
153
|
}
|
|
162
154
|
|
|
163
|
-
/**
|
|
164
|
-
* Called when an error occurs.
|
|
165
|
-
*/
|
|
166
155
|
override fun onError(source: SourceConfig, event: ErrorEvent) {
|
|
167
156
|
sendEvent(
|
|
168
157
|
OfflineEventType.ON_ERROR,
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
158
|
+
mapOf(
|
|
159
|
+
"code" to event.code.value,
|
|
160
|
+
"message" to event.message,
|
|
161
|
+
),
|
|
173
162
|
)
|
|
174
163
|
}
|
|
175
164
|
|
|
176
|
-
/**
|
|
177
|
-
* Called when the progress for a process call changes.
|
|
178
|
-
*/
|
|
179
165
|
override fun onProgress(source: SourceConfig, progress: Float) {
|
|
180
166
|
sendEvent(
|
|
181
167
|
OfflineEventType.ON_PROGRESS,
|
|
182
|
-
|
|
183
|
-
putDouble("progress", progress.toDouble())
|
|
184
|
-
},
|
|
168
|
+
mapOf("progress" to progress.toDouble()),
|
|
185
169
|
)
|
|
186
170
|
}
|
|
187
171
|
|
|
188
|
-
/**
|
|
189
|
-
* Called after a getOptions or when am OfflineOptionEntry has been updated during a process call.
|
|
190
|
-
*/
|
|
191
172
|
override fun onOptionsAvailable(source: SourceConfig, options: OfflineContentOptions) {
|
|
192
173
|
this.contentOptions = options
|
|
193
174
|
sendEvent(
|
|
194
175
|
OfflineEventType.ON_OPTIONS_AVAILABLE,
|
|
195
|
-
|
|
196
|
-
putMap("options", options.toJson())
|
|
197
|
-
},
|
|
176
|
+
mapOf("options" to options.toJson()),
|
|
198
177
|
)
|
|
199
178
|
}
|
|
200
179
|
|
|
201
|
-
/**
|
|
202
|
-
* Called when the DRM license was updated.
|
|
203
|
-
*/
|
|
204
180
|
override fun onDrmLicenseUpdated(source: SourceConfig) {
|
|
205
181
|
sendEvent(OfflineEventType.ON_DRM_LICENSE_UPDATED)
|
|
206
182
|
}
|
|
207
183
|
|
|
208
|
-
/**
|
|
209
|
-
* Called when all actions have been suspended.
|
|
210
|
-
*/
|
|
211
184
|
override fun onSuspended(source: SourceConfig) {
|
|
212
185
|
sendEvent(OfflineEventType.ON_SUSPENDED)
|
|
213
186
|
}
|
|
214
187
|
|
|
215
|
-
/**
|
|
216
|
-
* Called when all actions have been resumed.
|
|
217
|
-
*/
|
|
218
188
|
override fun onResumed(source: SourceConfig) {
|
|
219
189
|
sendEvent(OfflineEventType.ON_RESUMED)
|
|
220
190
|
}
|
|
221
191
|
|
|
222
|
-
private fun sendEvent(eventType: OfflineEventType, event:
|
|
223
|
-
event.
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
192
|
+
private fun sendEvent(eventType: OfflineEventType, event: Map<String, Any> = mapOf()) {
|
|
193
|
+
val mutableEvent = event.toMutableMap()
|
|
194
|
+
mutableEvent["nativeId"] = nativeId
|
|
195
|
+
mutableEvent["identifier"] = identifier
|
|
196
|
+
mutableEvent["eventType"] = eventType.eventName
|
|
197
|
+
mutableEvent["state"] = aggregateState(contentOptions).name
|
|
198
|
+
offlineModule.sendEvent("onBitmovinOfflineEvent", mutableEvent)
|
|
228
199
|
}
|
|
229
200
|
}
|
|
230
|
-
|
|
231
|
-
val ReactApplicationContext.rtcDeviceEventEmitter: RCTDeviceEventEmitter
|
|
232
|
-
get() = getJSModule(RCTDeviceEventEmitter::class.java)
|
package/android/src/main/java/com/bitmovin/player/reactnative/ui/CustomMessageHandlerBridge.kt
CHANGED
|
@@ -1,39 +1,29 @@
|
|
|
1
1
|
package com.bitmovin.player.reactnative.ui
|
|
2
2
|
|
|
3
3
|
import android.webkit.JavascriptInterface
|
|
4
|
+
import com.bitmovin.player.reactnative.CustomMessageHandlerModule
|
|
4
5
|
import com.bitmovin.player.reactnative.NativeId
|
|
5
|
-
import com.bitmovin.player.reactnative.extensions.getModule
|
|
6
6
|
import com.bitmovin.player.ui.CustomMessageHandler
|
|
7
|
-
import com.facebook.react.bridge.ReactApplicationContext
|
|
8
7
|
|
|
9
8
|
class CustomMessageHandlerBridge(
|
|
10
|
-
val context: ReactApplicationContext,
|
|
11
9
|
private val nativeId: NativeId,
|
|
10
|
+
private val module: CustomMessageHandlerModule? = null,
|
|
12
11
|
) {
|
|
13
12
|
val customMessageHandler = CustomMessageHandler(
|
|
14
13
|
object : Any() {
|
|
15
14
|
@JavascriptInterface
|
|
16
|
-
fun sendSynchronous(
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
fun sendSynchronous(
|
|
16
|
+
name: String,
|
|
17
|
+
data: String?,
|
|
18
|
+
): String? = module?.receivedSynchronousMessage(nativeId, name, data)
|
|
19
19
|
|
|
20
20
|
@JavascriptInterface
|
|
21
|
-
fun sendAsynchronous(
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
fun sendAsynchronous(
|
|
22
|
+
name: String,
|
|
23
|
+
data: String?,
|
|
24
|
+
) = module?.receivedAsynchronousMessage(nativeId, name, data)
|
|
24
25
|
},
|
|
25
26
|
)
|
|
26
27
|
|
|
27
|
-
private var currentSynchronousResult: String? = null
|
|
28
|
-
|
|
29
28
|
fun sendMessage(message: String, data: String?) = customMessageHandler.sendMessage(message, data)
|
|
30
|
-
|
|
31
|
-
fun popSynchronousResult(): String? = currentSynchronousResult?.let {
|
|
32
|
-
currentSynchronousResult = null
|
|
33
|
-
return it
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
fun pushSynchronousResult(result: String?) {
|
|
37
|
-
currentSynchronousResult = result
|
|
38
|
-
}
|
|
39
29
|
}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
package com.bitmovin.player.reactnative.ui
|
|
2
2
|
|
|
3
3
|
import com.bitmovin.player.api.ui.FullscreenHandler
|
|
4
|
+
import com.bitmovin.player.reactnative.FullscreenHandlerModule
|
|
4
5
|
import com.bitmovin.player.reactnative.NativeId
|
|
5
|
-
import com.bitmovin.player.reactnative.extensions.getModule
|
|
6
|
-
import com.facebook.react.bridge.ReactApplicationContext
|
|
7
6
|
|
|
8
7
|
class FullscreenHandlerBridge(
|
|
9
|
-
val context: ReactApplicationContext,
|
|
10
8
|
private val nativeId: NativeId,
|
|
9
|
+
private val module: FullscreenHandlerModule? = null,
|
|
11
10
|
) : FullscreenHandler {
|
|
12
11
|
override var isFullscreen = false
|
|
13
12
|
|
|
@@ -16,15 +15,11 @@ class FullscreenHandlerBridge(
|
|
|
16
15
|
}
|
|
17
16
|
|
|
18
17
|
override fun onFullscreenExitRequested() {
|
|
19
|
-
|
|
20
|
-
.getModule<FullscreenHandlerModule>()
|
|
21
|
-
?.requestExitFullscreen(nativeId)
|
|
18
|
+
module?.requestExitFullscreen(nativeId)
|
|
22
19
|
}
|
|
23
20
|
|
|
24
21
|
override fun onFullscreenRequested() {
|
|
25
|
-
|
|
26
|
-
.getModule<FullscreenHandlerModule>()
|
|
27
|
-
?.requestEnterFullscreen(nativeId)
|
|
22
|
+
module?.requestEnterFullscreen(nativeId)
|
|
28
23
|
}
|
|
29
24
|
|
|
30
25
|
override fun onPause() {
|
package/app.plugin.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Expo plugin for bitmovin-player-react-native
|
|
3
|
+
*
|
|
4
|
+
* Example:
|
|
5
|
+
* "plugins": [
|
|
6
|
+
* [
|
|
7
|
+
* "bitmovin-player-react-native",
|
|
8
|
+
* {
|
|
9
|
+
* "licenseKey": "ENTER_LICENSE_KEY",
|
|
10
|
+
* "featureFlags": {
|
|
11
|
+
* "airPlay": true,
|
|
12
|
+
* "backgroundPlayback": true,
|
|
13
|
+
* "googleCastSDK": { "android": "21.3.0", "ios": "4.8.1.2" },
|
|
14
|
+
* "offline": true,
|
|
15
|
+
* "pictureInPicture": true
|
|
16
|
+
* }
|
|
17
|
+
* }
|
|
18
|
+
* ]
|
|
19
|
+
* ]
|
|
20
|
+
*/
|
|
21
|
+
module.exports = require('./plugin/build');
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { StyleProp, ViewStyle } from 'react-native';
|
|
2
|
+
export type OnLoadEventPayload = {
|
|
3
|
+
url: string;
|
|
4
|
+
};
|
|
5
|
+
export type BitmovinPlayerReactNativeModuleEvents = {
|
|
6
|
+
onChange: (params: ChangeEventPayload) => void;
|
|
7
|
+
};
|
|
8
|
+
export type ChangeEventPayload = {
|
|
9
|
+
value: string;
|
|
10
|
+
};
|
|
11
|
+
export type BitmovinPlayerReactNativeViewProps = {
|
|
12
|
+
url: string;
|
|
13
|
+
onLoad: (event: {
|
|
14
|
+
nativeEvent: OnLoadEventPayload;
|
|
15
|
+
}) => void;
|
|
16
|
+
style?: StyleProp<ViewStyle>;
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=BitmovinPlayerReactNative.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BitmovinPlayerReactNative.types.d.ts","sourceRoot":"","sources":["../src/BitmovinPlayerReactNative.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzD,MAAM,MAAM,kBAAkB,GAAG;IAC/B,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,MAAM,MAAM,qCAAqC,GAAG;IAClD,QAAQ,EAAE,CAAC,MAAM,EAAE,kBAAkB,KAAK,IAAI,CAAC;CAChD,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,kCAAkC,GAAG;IAC/C,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,CAAC,KAAK,EAAE;QAAE,WAAW,EAAE,kBAAkB,CAAA;KAAE,KAAK,IAAI,CAAC;IAC7D,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BitmovinPlayerReactNative.types.js","sourceRoot":"","sources":["../src/BitmovinPlayerReactNative.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { StyleProp, ViewStyle } from 'react-native';\n\nexport type OnLoadEventPayload = {\n url: string;\n};\n\nexport type BitmovinPlayerReactNativeModuleEvents = {\n onChange: (params: ChangeEventPayload) => void;\n};\n\nexport type ChangeEventPayload = {\n value: string;\n};\n\nexport type BitmovinPlayerReactNativeViewProps = {\n url: string;\n onLoad: (event: { nativeEvent: OnLoadEventPayload }) => void;\n style?: StyleProp<ViewStyle>;\n};\n"]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configures the adaptation logic.
|
|
3
|
+
*/
|
|
4
|
+
export interface AdaptationConfig {
|
|
5
|
+
/**
|
|
6
|
+
* The upper bitrate boundary in bits per second for approximate network bandwidth consumption of the played source.
|
|
7
|
+
* Can be set to `undefined` for no limitation.
|
|
8
|
+
*/
|
|
9
|
+
maxSelectableBitrate?: number;
|
|
10
|
+
/**
|
|
11
|
+
* The initial bandwidth estimate in bits per second the player uses to select the optimal media tracks before actual bandwidth data is available. Overriding this value should only be done in specific cases and will most of the time not result in better selection logic.
|
|
12
|
+
*
|
|
13
|
+
* @remarks Platform: Android
|
|
14
|
+
* @see https://cdn.bitmovin.com/player/android/3/docs/player-core/com.bitmovin.player.api.media/-adaptation-config/initial-bandwidth-estimate-override.html
|
|
15
|
+
*/
|
|
16
|
+
initialBandwidthEstimateOverride?: number;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=adaptationConfig.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adaptationConfig.d.ts","sourceRoot":"","sources":["../src/adaptationConfig.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;OAGG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAE9B;;;;;OAKG;IACH,gCAAgC,CAAC,EAAE,MAAM,CAAC;CAC3C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adaptationConfig.js","sourceRoot":"","sources":["../src/adaptationConfig.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Configures the adaptation logic.\n */\nexport interface AdaptationConfig {\n /**\n * The upper bitrate boundary in bits per second for approximate network bandwidth consumption of the played source.\n * Can be set to `undefined` for no limitation.\n */\n maxSelectableBitrate?: number;\n\n /**\n * The initial bandwidth estimate in bits per second the player uses to select the optimal media tracks before actual bandwidth data is available. Overriding this value should only be done in specific cases and will most of the time not result in better selection logic.\n *\n * @remarks Platform: Android\n * @see https://cdn.bitmovin.com/player/android/3/docs/player-core/com.bitmovin.player.api.media/-adaptation-config/initial-bandwidth-estimate-override.html\n */\n initialBandwidthEstimateOverride?: number;\n}\n"]}
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Quartiles that can be reached during an ad playback.
|
|
3
|
+
*/
|
|
4
|
+
export declare enum AdQuartile {
|
|
5
|
+
/**
|
|
6
|
+
* Fist ad quartile.
|
|
7
|
+
*/
|
|
8
|
+
FIRST = "first",
|
|
9
|
+
/**
|
|
10
|
+
* Mid ad quartile.
|
|
11
|
+
*/
|
|
12
|
+
MID_POINT = "mid_point",
|
|
13
|
+
/**
|
|
14
|
+
* Third ad quartile.
|
|
15
|
+
*/
|
|
16
|
+
THIRD = "third"
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* The possible types an `AdSource` can be.
|
|
20
|
+
*/
|
|
21
|
+
export declare enum AdSourceType {
|
|
22
|
+
/**
|
|
23
|
+
* Google Interactive Media Ads.
|
|
24
|
+
*/
|
|
25
|
+
IMA = "ima",
|
|
26
|
+
/**
|
|
27
|
+
* Unknown ad source type.
|
|
28
|
+
*/
|
|
29
|
+
UNKNOWN = "unknown",
|
|
30
|
+
/**
|
|
31
|
+
* Progressive ad type.
|
|
32
|
+
*/
|
|
33
|
+
PROGRESSIVE = "progressive"
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Represents an ad source which can be assigned to an `AdItem`. An `AdItem` can have multiple `AdSource`s
|
|
37
|
+
* as waterfalling option.
|
|
38
|
+
*/
|
|
39
|
+
export interface AdSource {
|
|
40
|
+
/**
|
|
41
|
+
* The ad tag / url to the ad manifest.
|
|
42
|
+
*/
|
|
43
|
+
tag: string;
|
|
44
|
+
/**
|
|
45
|
+
* The `AdSourceType` of this `AdSource`.
|
|
46
|
+
*/
|
|
47
|
+
type: AdSourceType;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Represents an ad break which can be scheduled for playback.
|
|
51
|
+
*
|
|
52
|
+
* One single `AdItem` can have multiple `AdSource`s where all but the first act as fallback ad sources
|
|
53
|
+
* if the first one fails to load. The start and end of an ad break are signaled via `AdBreakStartedEvent`
|
|
54
|
+
* and `AdBreakFinishedEvent`.
|
|
55
|
+
*/
|
|
56
|
+
export interface AdItem {
|
|
57
|
+
/**
|
|
58
|
+
* The playback position at which the ad break is scheduled to start. Default value is "pre".
|
|
59
|
+
*
|
|
60
|
+
* Possible values are:
|
|
61
|
+
* • "pre": pre-roll ad (for VoD and Live streaming)
|
|
62
|
+
* • "post": post-roll ad (for VoD streaming only)
|
|
63
|
+
* • fractional seconds: "10", "12.5" (mid-roll ad, for VoD and Live streaming)
|
|
64
|
+
* • percentage of the entire video duration: "25%", "50%" (mid-roll ad, for VoD streaming only)
|
|
65
|
+
* • timecode hh:mm:ss.mmm: "00:10:30.000", "01:00:00.000" (mid-roll ad, for VoD streaming only)
|
|
66
|
+
*/
|
|
67
|
+
position?: string;
|
|
68
|
+
/**
|
|
69
|
+
* The `AdSource`s that make up this `AdItem`. The first ad source in this array is used as the main ad.
|
|
70
|
+
* Subsequent ad sources act as a fallback, meaning that if the main ad source does not provide a
|
|
71
|
+
* valid response, the subsequent ad sources will be utilized one after another.
|
|
72
|
+
*
|
|
73
|
+
* The fallback ad sources need to have the same `AdSourceType` as the main ad source.
|
|
74
|
+
*/
|
|
75
|
+
sources: AdSource[];
|
|
76
|
+
/**
|
|
77
|
+
* The amount of seconds the ad manifest is loaded in advance
|
|
78
|
+
* compared to when the ad break is scheduled for playback.
|
|
79
|
+
*
|
|
80
|
+
* Default value is 0.0
|
|
81
|
+
*
|
|
82
|
+
* @remarks Platform: Android
|
|
83
|
+
*/
|
|
84
|
+
preloadOffset?: number;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Contains configuration values regarding the ads which should be played back by the player.
|
|
88
|
+
*/
|
|
89
|
+
export interface AdvertisingConfig {
|
|
90
|
+
/**
|
|
91
|
+
* The ad items that are scheduled when a new playback session is started via `Player.load()`.
|
|
92
|
+
*/
|
|
93
|
+
schedule: AdItem[];
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Contains the base configuration options for an ad.
|
|
97
|
+
*/
|
|
98
|
+
export interface AdConfig {
|
|
99
|
+
/**
|
|
100
|
+
* Specifies how many seconds of the main video content should be replaced by ad break(s).
|
|
101
|
+
*/
|
|
102
|
+
replaceContentDuration: number;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Holds various additional ad data.
|
|
106
|
+
*/
|
|
107
|
+
export interface AdData {
|
|
108
|
+
/**
|
|
109
|
+
* The average bitrate of the progressive media file as defined in the VAST response.
|
|
110
|
+
*/
|
|
111
|
+
bitrate?: number;
|
|
112
|
+
/**
|
|
113
|
+
* The maximum bitrate of the streaming media file as defined in the VAST response.
|
|
114
|
+
*/
|
|
115
|
+
maxBitrate?: number;
|
|
116
|
+
/**
|
|
117
|
+
* The MIME type of the media file or creative as defined in the VAST response.
|
|
118
|
+
*/
|
|
119
|
+
mimeType?: string;
|
|
120
|
+
/**
|
|
121
|
+
* The minimum bitrate of the streaming media file as defined in the VAST response.
|
|
122
|
+
*/
|
|
123
|
+
minBitrate?: number;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Defines basic properties available for every ad type.
|
|
127
|
+
*/
|
|
128
|
+
export interface Ad {
|
|
129
|
+
/**
|
|
130
|
+
* The url the user should be redirected to when clicking the ad.
|
|
131
|
+
*/
|
|
132
|
+
clickThroughUrl?: string;
|
|
133
|
+
/**
|
|
134
|
+
* Holds various additional `AdData`.
|
|
135
|
+
*/
|
|
136
|
+
data?: AdData;
|
|
137
|
+
/**
|
|
138
|
+
* The height of the ad.
|
|
139
|
+
*/
|
|
140
|
+
height: number;
|
|
141
|
+
/**
|
|
142
|
+
* Identifier for the ad. This might be autogenerated.
|
|
143
|
+
*/
|
|
144
|
+
id?: string;
|
|
145
|
+
/**
|
|
146
|
+
* Determines whether an ad is linear, i.e. playback of main content needs to be paused for the ad.
|
|
147
|
+
*/
|
|
148
|
+
isLinear: boolean;
|
|
149
|
+
/**
|
|
150
|
+
* The corresponding media file url for the ad.
|
|
151
|
+
*/
|
|
152
|
+
mediaFileUrl?: string;
|
|
153
|
+
/**
|
|
154
|
+
* The width of the ad.
|
|
155
|
+
*/
|
|
156
|
+
width: number;
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Contains information about an ad break.
|
|
160
|
+
*/
|
|
161
|
+
export interface AdBreak {
|
|
162
|
+
/**
|
|
163
|
+
* The ads scheduled for this `AdBreak`.
|
|
164
|
+
*/
|
|
165
|
+
ads: Ad[];
|
|
166
|
+
/**
|
|
167
|
+
* The id of the corresponding `AdBreakConfig`. This will be auto-generated.
|
|
168
|
+
*/
|
|
169
|
+
id: string;
|
|
170
|
+
/**
|
|
171
|
+
* The time in seconds in the media timeline the `AdBreak` is scheduled for.
|
|
172
|
+
*/
|
|
173
|
+
scheduleTime: number;
|
|
174
|
+
}
|
|
175
|
+
//# sourceMappingURL=advertising.d.ts.map
|