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
|
@@ -5,11 +5,6 @@ import BitmovinPlayer
|
|
|
5
5
|
import Foundation
|
|
6
6
|
|
|
7
7
|
extension RCTConvert {
|
|
8
|
-
/**
|
|
9
|
-
Utility method to instantiate a `PlayerConfig` from a JS object.
|
|
10
|
-
- Parameter json: JS object
|
|
11
|
-
- Returns: The produced `PlayerConfig` object
|
|
12
|
-
*/
|
|
13
8
|
static func playerConfig(_ json: Any?) -> PlayerConfig? { // swiftlint:disable:this cyclomatic_complexity
|
|
14
9
|
let playerConfig = PlayerConfig()
|
|
15
10
|
guard let json = json as? [String: Any?] else {
|
|
@@ -53,11 +48,6 @@ extension RCTConvert {
|
|
|
53
48
|
return playerConfig
|
|
54
49
|
}
|
|
55
50
|
|
|
56
|
-
/**
|
|
57
|
-
Utility method to instantiate a `PlaybackConfig` from a JS object.
|
|
58
|
-
- Parameter json: JS object.
|
|
59
|
-
- Returns: The produced `PlaybackConfig` object.
|
|
60
|
-
*/
|
|
61
51
|
static func playbackConfig(_ json: Any?) -> PlaybackConfig? {
|
|
62
52
|
guard let json = json as? [String: Any?] else {
|
|
63
53
|
return nil
|
|
@@ -81,11 +71,6 @@ extension RCTConvert {
|
|
|
81
71
|
return playbackConfig
|
|
82
72
|
}
|
|
83
73
|
|
|
84
|
-
/**
|
|
85
|
-
Utility method to instantiate a `StyleConfig` from a JS object.
|
|
86
|
-
- Parameter json: JS object.
|
|
87
|
-
- Returns: The produced `StyleConfig` object.
|
|
88
|
-
*/
|
|
89
74
|
static func styleConfig(_ json: Any?) -> StyleConfig? { // swiftlint:disable:this cyclomatic_complexity
|
|
90
75
|
guard let json = json as? [String: Any?] else {
|
|
91
76
|
return nil
|
|
@@ -123,11 +108,6 @@ extension RCTConvert {
|
|
|
123
108
|
return styleConfig
|
|
124
109
|
}
|
|
125
110
|
|
|
126
|
-
/**
|
|
127
|
-
Utility method to instantiate a `TweaksConfig` from a JS object.
|
|
128
|
-
- Parameter json: JS object.
|
|
129
|
-
- Returns: The produced `TweaksConfig` object.
|
|
130
|
-
*/
|
|
131
111
|
static func tweaksConfig(_ json: Any?) -> TweaksConfig? { // swiftlint:disable:this cyclomatic_complexity
|
|
132
112
|
guard let json = json as? [String: Any?] else {
|
|
133
113
|
return nil
|
|
@@ -173,11 +153,6 @@ extension RCTConvert {
|
|
|
173
153
|
return tweaksConfig
|
|
174
154
|
}
|
|
175
155
|
|
|
176
|
-
/**
|
|
177
|
-
Utility method to instantiate a `BufferMediaTypeConfig` from a JS object.
|
|
178
|
-
- Parameter json: JS object.
|
|
179
|
-
- Returns: The produced `BufferMediaTypeConfig` object.
|
|
180
|
-
*/
|
|
181
156
|
static func bufferMediaTypeConfig(_ json: Any?) -> BufferMediaTypeConfig? {
|
|
182
157
|
guard let json = json as? [String: Any?] else {
|
|
183
158
|
return nil
|
|
@@ -189,11 +164,6 @@ extension RCTConvert {
|
|
|
189
164
|
return bufferMediaTypeConfig
|
|
190
165
|
}
|
|
191
166
|
|
|
192
|
-
/**
|
|
193
|
-
Utility method to instantiate a `BufferConfig` from a JS object.
|
|
194
|
-
- Parameter json: JS object.
|
|
195
|
-
- Returns: The produced `BufferConfig` object.
|
|
196
|
-
*/
|
|
197
167
|
static func bufferConfig(_ json: Any?) -> BufferConfig? {
|
|
198
168
|
guard let json = json as? [String: Any?] else {
|
|
199
169
|
return nil
|
|
@@ -205,11 +175,6 @@ extension RCTConvert {
|
|
|
205
175
|
return bufferConfig
|
|
206
176
|
}
|
|
207
177
|
|
|
208
|
-
/**
|
|
209
|
-
Utility method to instantiate a `LiveConfig` from a JS object.
|
|
210
|
-
- Parameter json: JS object.
|
|
211
|
-
- Returns: The produced `LiveConfig` object, or `nil` if `json` is not valid.
|
|
212
|
-
*/
|
|
213
178
|
static func liveConfig(_ json: Any?) -> LiveConfig? {
|
|
214
179
|
guard let json = json as? [String: Any?] else {
|
|
215
180
|
return nil
|
|
@@ -221,11 +186,6 @@ extension RCTConvert {
|
|
|
221
186
|
return liveConfig
|
|
222
187
|
}
|
|
223
188
|
|
|
224
|
-
/**
|
|
225
|
-
Utility method to instantiate a `HttpRequest` from a JS object.
|
|
226
|
-
- Parameter json: JS object.
|
|
227
|
-
- Returns: The produced `HttpRequest` object, or `nil` if `json` is not valid.
|
|
228
|
-
*/
|
|
229
189
|
static func httpRequest(_ json: Any?) -> HttpRequest? {
|
|
230
190
|
guard
|
|
231
191
|
let json = json as? [String: Any?],
|
|
@@ -245,11 +205,6 @@ extension RCTConvert {
|
|
|
245
205
|
return request
|
|
246
206
|
}
|
|
247
207
|
|
|
248
|
-
/**
|
|
249
|
-
Utility method to instantiate a `HttpResponse` from a JS object.
|
|
250
|
-
- Parameter json: JS object.
|
|
251
|
-
- Returns: The produced `HttpResponse` object, or `nil` if `json` is not valid.
|
|
252
|
-
*/
|
|
253
208
|
static func httpResponse(_ json: Any?) -> HttpResponse? {
|
|
254
209
|
guard
|
|
255
210
|
let json = json as? [String: Any?],
|
|
@@ -282,11 +237,6 @@ extension RCTConvert {
|
|
|
282
237
|
return NetworkConfig()
|
|
283
238
|
}
|
|
284
239
|
|
|
285
|
-
/**
|
|
286
|
-
Utility method to instantiate an `AdvertisingConfig` from a JS object.
|
|
287
|
-
- Parameter json: JS object.
|
|
288
|
-
- Returns: The produced `AdvertisingConfig` object.
|
|
289
|
-
*/
|
|
290
240
|
static func advertisingConfig(_ json: Any?) -> AdvertisingConfig? {
|
|
291
241
|
guard
|
|
292
242
|
let json = json as? [String: Any?],
|
|
@@ -297,11 +247,6 @@ extension RCTConvert {
|
|
|
297
247
|
return AdvertisingConfig(schedule: schedule.compactMap { RCTConvert.adItem($0) })
|
|
298
248
|
}
|
|
299
249
|
|
|
300
|
-
/**
|
|
301
|
-
Utility method to instantiate an `AdItem` from a JS object.
|
|
302
|
-
- Parameter json: JS object.
|
|
303
|
-
- Returns: The produced `AdItem` object.
|
|
304
|
-
*/
|
|
305
250
|
static func adItem(_ json: Any?) -> AdItem? {
|
|
306
251
|
guard
|
|
307
252
|
let json = json as? [String: Any?],
|
|
@@ -315,11 +260,6 @@ extension RCTConvert {
|
|
|
315
260
|
)
|
|
316
261
|
}
|
|
317
262
|
|
|
318
|
-
/**
|
|
319
|
-
Utility method to instantiate an `AdSource` from a JS object.
|
|
320
|
-
- Parameter json: JS object.
|
|
321
|
-
- Returns: The produced `AdSource` object.
|
|
322
|
-
*/
|
|
323
263
|
static func adSource(_ json: Any?) -> AdSource? {
|
|
324
264
|
guard
|
|
325
265
|
let json = json as? [String: Any?],
|
|
@@ -331,11 +271,6 @@ extension RCTConvert {
|
|
|
331
271
|
return AdSource(tag: tag, ofType: type)
|
|
332
272
|
}
|
|
333
273
|
|
|
334
|
-
/**
|
|
335
|
-
Utility method to instantiate an `AdSourceType` from a JS object.
|
|
336
|
-
- Parameter json: JS object.
|
|
337
|
-
- Returns: The produced `AdSourceType` object.
|
|
338
|
-
*/
|
|
339
274
|
static func adSourceType(_ json: Any?) -> AdSourceType? {
|
|
340
275
|
guard let json = json as? String else {
|
|
341
276
|
return nil
|
|
@@ -352,11 +287,6 @@ extension RCTConvert {
|
|
|
352
287
|
}
|
|
353
288
|
}
|
|
354
289
|
|
|
355
|
-
/**
|
|
356
|
-
Utility method to instantiate a `SourceConfig` from a JS object.
|
|
357
|
-
- Parameter json: JS object
|
|
358
|
-
- Returns: The produced `SourceConfig` object
|
|
359
|
-
*/
|
|
360
290
|
static func sourceConfig(_ json: Any?, drmConfig: DrmConfig? = nil) -> SourceConfig? { // swiftlint:disable:this cyclomatic_complexity line_length
|
|
361
291
|
guard let json = json as? [String: Any?] else {
|
|
362
292
|
return nil
|
|
@@ -399,11 +329,6 @@ extension RCTConvert {
|
|
|
399
329
|
return sourceConfig
|
|
400
330
|
}
|
|
401
331
|
|
|
402
|
-
/**
|
|
403
|
-
Utility method to instantiate a `SourceOptions` from a JS object.
|
|
404
|
-
- Parameter json: JS object
|
|
405
|
-
- Returns: The produced `SourceOptions` object
|
|
406
|
-
*/
|
|
407
332
|
static func sourceOptions(_ json: Any?) -> SourceOptions {
|
|
408
333
|
let sourceOptions = SourceOptions()
|
|
409
334
|
guard let json = json as? [String: Any?] else {
|
|
@@ -417,11 +342,6 @@ extension RCTConvert {
|
|
|
417
342
|
return sourceOptions
|
|
418
343
|
}
|
|
419
344
|
|
|
420
|
-
/**
|
|
421
|
-
Utility method to instantiate a `TimelineReferencePoint` from a JS object.
|
|
422
|
-
- Parameter json: JS object
|
|
423
|
-
- Returns: The produced `TimelineReferencePoint` value
|
|
424
|
-
*/
|
|
425
345
|
static func timelineReferencePoint(_ json: Any?) -> TimelineReferencePoint {
|
|
426
346
|
guard let stringValue = json as? String else { return .auto }
|
|
427
347
|
switch stringValue {
|
|
@@ -434,11 +354,6 @@ extension RCTConvert {
|
|
|
434
354
|
}
|
|
435
355
|
}
|
|
436
356
|
|
|
437
|
-
/**
|
|
438
|
-
Utility method to get a `SourceType` from a JS object.
|
|
439
|
-
- Parameter json: JS object
|
|
440
|
-
- Returns: The associated `SourceType` value
|
|
441
|
-
*/
|
|
442
357
|
static func sourceType(_ json: Any?) -> SourceType {
|
|
443
358
|
guard let json = json as? String else {
|
|
444
359
|
return .none
|
|
@@ -457,11 +372,6 @@ extension RCTConvert {
|
|
|
457
372
|
}
|
|
458
373
|
}
|
|
459
374
|
|
|
460
|
-
/**
|
|
461
|
-
Utility method to get a `TimeMode` from a JS object.
|
|
462
|
-
- Parameter json: JS object
|
|
463
|
-
- Returns: The associated `TimeMode` value
|
|
464
|
-
*/
|
|
465
375
|
static func timeMode(_ json: Any?) -> TimeMode {
|
|
466
376
|
guard let json = json as? String else {
|
|
467
377
|
return .absoluteTime
|
|
@@ -476,26 +386,16 @@ extension RCTConvert {
|
|
|
476
386
|
}
|
|
477
387
|
}
|
|
478
388
|
|
|
479
|
-
/**
|
|
480
|
-
Utility method to get a `DrmConfig` from a JS object.
|
|
481
|
-
- Parameter json: JS object
|
|
482
|
-
- Returns: The generated `DrmConfig` object
|
|
483
|
-
*/
|
|
484
389
|
static func drmConfig(_ json: Any?) -> (fairplay: FairplayConfig?, widevine: WidevineConfig?) {
|
|
485
390
|
guard let json = json as? [String: Any?] else {
|
|
486
391
|
return (nil, nil)
|
|
487
392
|
}
|
|
488
393
|
return (
|
|
489
|
-
fairplay:
|
|
490
|
-
widevine:
|
|
394
|
+
fairplay: json["fairplay"].flatMap(RCTConvert.fairplayConfig),
|
|
395
|
+
widevine: json["widevine"].flatMap(RCTConvert.widevineConfig)
|
|
491
396
|
)
|
|
492
397
|
}
|
|
493
398
|
|
|
494
|
-
/**
|
|
495
|
-
Utility method to get a `FairplayConfig` from a JS object.
|
|
496
|
-
- Parameter json: JS object
|
|
497
|
-
- Returns: The generated `FairplayConfig` object
|
|
498
|
-
*/
|
|
499
399
|
static func fairplayConfig(_ json: Any?) -> FairplayConfig? {
|
|
500
400
|
guard let json = json as? [String: Any?],
|
|
501
401
|
let licenseURLString = json["licenseUrl"] as? String,
|
|
@@ -516,11 +416,6 @@ extension RCTConvert {
|
|
|
516
416
|
return fairplayConfig
|
|
517
417
|
}
|
|
518
418
|
|
|
519
|
-
/**
|
|
520
|
-
Utility method to get a `WidevineConfig` from a JS object.
|
|
521
|
-
- Parameter json: JS object
|
|
522
|
-
- Returns: The generated `WidevineConfig` object
|
|
523
|
-
*/
|
|
524
419
|
static func widevineConfig(_ json: Any?) -> WidevineConfig? {
|
|
525
420
|
guard let json = json as? [String: Any?],
|
|
526
421
|
let licenseURL = json["licenseUrl"] as? String else {
|
|
@@ -533,11 +428,6 @@ extension RCTConvert {
|
|
|
533
428
|
return widevineConfig
|
|
534
429
|
}
|
|
535
430
|
|
|
536
|
-
/**
|
|
537
|
-
Utility method to get a `ThumbnailTrack` instance from a JS object.
|
|
538
|
-
- Parameter url: String.
|
|
539
|
-
- Returns: The generated `ThumbnailTrack`.
|
|
540
|
-
*/
|
|
541
431
|
static func thumbnailTrack(_ url: String?) -> ThumbnailTrack? {
|
|
542
432
|
guard
|
|
543
433
|
let url = RCTConvert.nsurl(url)
|
|
@@ -552,22 +442,21 @@ extension RCTConvert {
|
|
|
552
442
|
)
|
|
553
443
|
}
|
|
554
444
|
|
|
555
|
-
|
|
556
|
-
Utility method to get a json dictionary value from a `AudioTrack` object.
|
|
557
|
-
- Parameter audioTrack: The track to convert to json format.
|
|
558
|
-
- Returns: The generated json dictionary.
|
|
559
|
-
*/
|
|
560
|
-
static func audioTrackJson(_ audioTrack: AudioTrack?) -> [AnyHashable: Any]? {
|
|
445
|
+
static func audioTrackJson(_ audioTrack: AudioTrack?) -> [String: Any]? {
|
|
561
446
|
guard let audioTrack else {
|
|
562
447
|
return nil
|
|
563
448
|
}
|
|
564
|
-
var audioTrackDict: [String: Any
|
|
565
|
-
"url": audioTrack.url?.absoluteString,
|
|
449
|
+
var audioTrackDict: [String: Any] = [
|
|
566
450
|
"label": audioTrack.label,
|
|
567
451
|
"isDefault": audioTrack.isDefaultTrack,
|
|
568
452
|
"identifier": audioTrack.identifier,
|
|
569
|
-
"language": audioTrack.language
|
|
570
453
|
]
|
|
454
|
+
if let url = audioTrack.url {
|
|
455
|
+
audioTrackDict["url"] = url.absoluteString
|
|
456
|
+
}
|
|
457
|
+
if let language = audioTrack.language {
|
|
458
|
+
audioTrackDict["language"] = language
|
|
459
|
+
}
|
|
571
460
|
audioTrackDict["roles"] = audioTrack.characteristics.map { characteristic in
|
|
572
461
|
[
|
|
573
462
|
"schemeIdUri": "urn:hls:characteristic",
|
|
@@ -577,11 +466,6 @@ extension RCTConvert {
|
|
|
577
466
|
return audioTrackDict
|
|
578
467
|
}
|
|
579
468
|
|
|
580
|
-
/**
|
|
581
|
-
Utility method to get a `SubtitleTrack` instance from a JS object.
|
|
582
|
-
- Parameter json: JS object.
|
|
583
|
-
- Returns: The generated `SubtitleTrack`.
|
|
584
|
-
*/
|
|
585
469
|
static func subtitleTrack(_ json: [String: Any]) -> SubtitleTrack? {
|
|
586
470
|
guard
|
|
587
471
|
let url = RCTConvert.nsurl(json["url"]),
|
|
@@ -616,11 +500,6 @@ extension RCTConvert {
|
|
|
616
500
|
)
|
|
617
501
|
}
|
|
618
502
|
|
|
619
|
-
/**
|
|
620
|
-
Utility method to get a `SubtitleFormat` value from a JS object.
|
|
621
|
-
- Parameter json: JS object.
|
|
622
|
-
- Returns: The associated `SubtitleFormat` value or nil.
|
|
623
|
-
*/
|
|
624
503
|
static func subtitleFormat(_ json: Any?) -> SubtitleFormat? {
|
|
625
504
|
guard let json = json as? String else {
|
|
626
505
|
return nil
|
|
@@ -639,23 +518,22 @@ extension RCTConvert {
|
|
|
639
518
|
}
|
|
640
519
|
}
|
|
641
520
|
|
|
642
|
-
|
|
643
|
-
Utility method to get a json dictionary value from a `SubtitleTrack` object.
|
|
644
|
-
- Parameter subtitleTrack: The track to convert to json format.
|
|
645
|
-
- Returns: The generated json dictionary.
|
|
646
|
-
*/
|
|
647
|
-
static func subtitleTrackJson(_ subtitleTrack: SubtitleTrack?) -> [AnyHashable: Any]? {
|
|
521
|
+
static func subtitleTrackJson(_ subtitleTrack: SubtitleTrack?) -> [String: Any]? {
|
|
648
522
|
guard let subtitleTrack else {
|
|
649
523
|
return nil
|
|
650
524
|
}
|
|
651
|
-
var subtitleTrackDict: [String: Any
|
|
652
|
-
"url": subtitleTrack.url?.absoluteString,
|
|
525
|
+
var subtitleTrackDict: [String: Any] = [
|
|
653
526
|
"label": subtitleTrack.label,
|
|
654
527
|
"isDefault": subtitleTrack.isDefaultTrack,
|
|
655
528
|
"identifier": subtitleTrack.identifier,
|
|
656
|
-
"language": subtitleTrack.language,
|
|
657
529
|
"isForced": subtitleTrack.isForced,
|
|
658
530
|
]
|
|
531
|
+
if let url = subtitleTrack.url {
|
|
532
|
+
subtitleTrackDict["url"] = url.absoluteString
|
|
533
|
+
}
|
|
534
|
+
if let language = subtitleTrack.language {
|
|
535
|
+
subtitleTrackDict["language"] = language
|
|
536
|
+
}
|
|
659
537
|
switch subtitleTrack.format {
|
|
660
538
|
case .cea:
|
|
661
539
|
subtitleTrackDict["format"] = "cea"
|
|
@@ -678,29 +556,23 @@ extension RCTConvert {
|
|
|
678
556
|
return subtitleTrackDict
|
|
679
557
|
}
|
|
680
558
|
|
|
681
|
-
/**
|
|
682
|
-
Utility method to get a json dictionary value from a `ThumbnailTrack` object.
|
|
683
|
-
- Parameter thumbnailTrack: The `ThumbnailTrack` to convert to json format.
|
|
684
|
-
- Returns: The generated json dictionary.
|
|
685
|
-
*/
|
|
686
559
|
static func toJson(thumbnailTrack: ThumbnailTrack?) -> [AnyHashable: Any]? {
|
|
687
560
|
guard let thumbnailTrack else {
|
|
688
561
|
return nil
|
|
689
562
|
}
|
|
690
563
|
|
|
691
|
-
|
|
692
|
-
"url": thumbnailTrack.url?.absoluteString,
|
|
564
|
+
var thumbnailTrackDict: [String: Any] = [
|
|
693
565
|
"label": thumbnailTrack.label,
|
|
694
566
|
"isDefault": thumbnailTrack.isDefaultTrack,
|
|
695
567
|
"identifier": thumbnailTrack.identifier
|
|
696
568
|
]
|
|
569
|
+
if let url = thumbnailTrack.url {
|
|
570
|
+
thumbnailTrackDict["url"] = url.absoluteString
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
return thumbnailTrackDict
|
|
697
574
|
}
|
|
698
575
|
|
|
699
|
-
/**
|
|
700
|
-
Utility method to compute a JS value from an `AdItem` object.
|
|
701
|
-
- Parameter adItem: `AdItem` object to be converted.
|
|
702
|
-
- Returns: The produced JS object.
|
|
703
|
-
*/
|
|
704
576
|
static func toJson(adItem: AdItem?) -> [String: Any?]? {
|
|
705
577
|
guard let adItem else {
|
|
706
578
|
return nil
|
|
@@ -711,11 +583,6 @@ extension RCTConvert {
|
|
|
711
583
|
]
|
|
712
584
|
}
|
|
713
585
|
|
|
714
|
-
/**
|
|
715
|
-
Utility method to compute a JS value from an `AdSource` object.
|
|
716
|
-
- Parameter adSource: `AdSource` object to be converted.
|
|
717
|
-
- Returns: The produced JS object.
|
|
718
|
-
*/
|
|
719
586
|
static func toJson(adSource: AdSource?) -> [String: Any?]? {
|
|
720
587
|
guard let adSource else {
|
|
721
588
|
return nil
|
|
@@ -726,11 +593,6 @@ extension RCTConvert {
|
|
|
726
593
|
]
|
|
727
594
|
}
|
|
728
595
|
|
|
729
|
-
/**
|
|
730
|
-
Utility method to compute a JS value from an `AdSourceType` value.
|
|
731
|
-
- Parameter adSourceType: `AdSourceType` object to be converted.
|
|
732
|
-
- Returns: The produced JS object.
|
|
733
|
-
*/
|
|
734
596
|
static func toJson(adSourceType: AdSourceType?) -> String? {
|
|
735
597
|
guard let adSourceType else {
|
|
736
598
|
return nil
|
|
@@ -747,11 +609,6 @@ extension RCTConvert {
|
|
|
747
609
|
}
|
|
748
610
|
}
|
|
749
611
|
|
|
750
|
-
/**
|
|
751
|
-
Utility method to compute a JS value from an `AdConfig` object.
|
|
752
|
-
- Parameter adConfig: `AdConfig` object to be converted.
|
|
753
|
-
- Returns: The produced JS object.
|
|
754
|
-
*/
|
|
755
612
|
static func toJson(adConfig: AdConfig?) -> [String: Any?]? {
|
|
756
613
|
guard let adConfig else {
|
|
757
614
|
return nil
|
|
@@ -759,11 +616,6 @@ extension RCTConvert {
|
|
|
759
616
|
return ["replaceContentDuration": adConfig.replaceContentDuration]
|
|
760
617
|
}
|
|
761
618
|
|
|
762
|
-
/**
|
|
763
|
-
Utility method to compute a JS string from an `AdQuartile` value.
|
|
764
|
-
- Parameter adQuartile: `AdQuartile` value to be converted.
|
|
765
|
-
- Returns: The produced JS string.
|
|
766
|
-
*/
|
|
767
619
|
static func toJson(adQuartile: AdQuartile?) -> String? {
|
|
768
620
|
guard let adQuartile else {
|
|
769
621
|
return nil
|
|
@@ -778,11 +630,6 @@ extension RCTConvert {
|
|
|
778
630
|
}
|
|
779
631
|
}
|
|
780
632
|
|
|
781
|
-
/**
|
|
782
|
-
Utility method to compute a JS value from an `AdBreak` object.
|
|
783
|
-
- Parameter adBreak: `AdBreak` object to be converted.
|
|
784
|
-
- Returns: The produced JS object.
|
|
785
|
-
*/
|
|
786
633
|
static func toJson(adBreak: AdBreak?) -> [String: Any?]? {
|
|
787
634
|
guard let adBreak else {
|
|
788
635
|
return nil
|
|
@@ -794,11 +641,6 @@ extension RCTConvert {
|
|
|
794
641
|
]
|
|
795
642
|
}
|
|
796
643
|
|
|
797
|
-
/**
|
|
798
|
-
Utility method to compute a JS value from an `Ad` object.
|
|
799
|
-
- Parameter ad: `Ad` object to be converted.
|
|
800
|
-
- Returns: The produced JS object.
|
|
801
|
-
*/
|
|
802
644
|
static func toJson(ad: Ad?) -> [String: Any?]? {
|
|
803
645
|
guard let ad else {
|
|
804
646
|
return nil
|
|
@@ -814,11 +656,6 @@ extension RCTConvert {
|
|
|
814
656
|
]
|
|
815
657
|
}
|
|
816
658
|
|
|
817
|
-
/**
|
|
818
|
-
Utility method to compute a JS value from an `AdData` object.
|
|
819
|
-
- Parameter adData `AdData` object to be converted.
|
|
820
|
-
- Returns: The produced JS object.
|
|
821
|
-
*/
|
|
822
659
|
static func toJson(adData: AdData?) -> [String: Any?]? {
|
|
823
660
|
guard let adData else {
|
|
824
661
|
return nil
|
|
@@ -831,11 +668,6 @@ extension RCTConvert {
|
|
|
831
668
|
]
|
|
832
669
|
}
|
|
833
670
|
|
|
834
|
-
/**
|
|
835
|
-
Utility method to get a `BitmovinAnalyticsConfig` value from a JS object.
|
|
836
|
-
- Parameter json: JS object.
|
|
837
|
-
- Returns: The associated `BitmovinAnalyticsConfig` value or nil.
|
|
838
|
-
*/
|
|
839
671
|
static func analyticsConfig(_ json: Any?) -> AnalyticsConfig? {
|
|
840
672
|
guard
|
|
841
673
|
let json = json as? [String: Any?],
|
|
@@ -872,11 +704,6 @@ extension RCTConvert {
|
|
|
872
704
|
)
|
|
873
705
|
}
|
|
874
706
|
|
|
875
|
-
/**
|
|
876
|
-
Utility method to get an analytics `CustomData` value from a JS object.
|
|
877
|
-
- Parameter json: JS object.
|
|
878
|
-
- Returns: The associated `CustomData` value or nil.
|
|
879
|
-
*/
|
|
880
707
|
static func analyticsCustomData(_ json: Any?) -> CustomData? {
|
|
881
708
|
guard let json = json as? [String: Any?] else {
|
|
882
709
|
return nil
|
|
@@ -916,11 +743,6 @@ extension RCTConvert {
|
|
|
916
743
|
)
|
|
917
744
|
}
|
|
918
745
|
|
|
919
|
-
/**
|
|
920
|
-
Utility method to get a JS value from a `CustomData` object.
|
|
921
|
-
- Parameter analyticsCustomData: Analytics custom data object.
|
|
922
|
-
- Returns: The JS value representing the given object.
|
|
923
|
-
*/
|
|
924
746
|
static func toJson(analyticsCustomData: CustomData?) -> [String: Any?]? {
|
|
925
747
|
guard let analyticsCustomData else {
|
|
926
748
|
return nil
|
|
@@ -960,11 +782,6 @@ extension RCTConvert {
|
|
|
960
782
|
return json
|
|
961
783
|
}
|
|
962
784
|
|
|
963
|
-
/**
|
|
964
|
-
Utility method to get an analytics `SourceMetadata` value from a JS object.
|
|
965
|
-
- Parameter json: JS object.
|
|
966
|
-
- Returns: The associated `SourceMetadata` value or nil.
|
|
967
|
-
*/
|
|
968
785
|
static func analyticsSourceMetadata(_ json: Any?) -> SourceMetadata? {
|
|
969
786
|
guard let json = json as? [String: Any?] else {
|
|
970
787
|
return nil
|
|
@@ -982,30 +799,24 @@ extension RCTConvert {
|
|
|
982
799
|
)
|
|
983
800
|
}
|
|
984
801
|
|
|
985
|
-
|
|
986
|
-
Utility method to compute a JS value from a `VideoQuality` object.
|
|
987
|
-
- Parameter videoQuality `VideoQuality` object to be converted.
|
|
988
|
-
- Returns: The produced JS object.
|
|
989
|
-
*/
|
|
990
|
-
static func toJson(videoQuality: VideoQuality?) -> [String: Any?]? {
|
|
802
|
+
static func toJson(videoQuality: VideoQuality?) -> [String: Any]? {
|
|
991
803
|
guard let videoQuality else {
|
|
992
804
|
return nil
|
|
993
805
|
}
|
|
994
|
-
|
|
806
|
+
var videoQualityDict: [String: Any] = [
|
|
995
807
|
"id": videoQuality.identifier,
|
|
996
808
|
"label": videoQuality.label,
|
|
997
809
|
"height": videoQuality.height,
|
|
998
810
|
"width": videoQuality.width,
|
|
999
|
-
"codec": videoQuality.codec,
|
|
1000
811
|
"bitrate": videoQuality.bitrate,
|
|
1001
812
|
]
|
|
813
|
+
if let codec = videoQuality.codec {
|
|
814
|
+
videoQualityDict["codec"] = codec
|
|
815
|
+
}
|
|
816
|
+
|
|
817
|
+
return videoQualityDict
|
|
1002
818
|
}
|
|
1003
819
|
|
|
1004
|
-
/**
|
|
1005
|
-
Utility method to get a `UserInterfaceType` from a JS object.
|
|
1006
|
-
- Parameter json: JS object
|
|
1007
|
-
- Returns: The associated `UserInterfaceType` value or `nil`
|
|
1008
|
-
*/
|
|
1009
820
|
static func userInterfaceType(_ json: Any?) -> UserInterfaceType? {
|
|
1010
821
|
guard let json = json as? String else {
|
|
1011
822
|
return .none
|
|
@@ -1025,11 +836,6 @@ extension RCTConvert {
|
|
|
1025
836
|
}
|
|
1026
837
|
|
|
1027
838
|
#if os(iOS)
|
|
1028
|
-
/**
|
|
1029
|
-
Utility method to compute a JS value from an `OfflineState` object.
|
|
1030
|
-
- Parameter offlineState `OfflineState` object to be converted.
|
|
1031
|
-
- Returns: The produced JS object.
|
|
1032
|
-
*/
|
|
1033
839
|
static func toJson(offlineState: OfflineState?) -> String {
|
|
1034
840
|
var notDownloaded = "NotDownloaded"
|
|
1035
841
|
guard let offlineState else {
|
|
@@ -1048,11 +854,6 @@ extension RCTConvert {
|
|
|
1048
854
|
}
|
|
1049
855
|
}
|
|
1050
856
|
|
|
1051
|
-
/**
|
|
1052
|
-
Utility method to compute a JS value from an `OfflineTextTrack` object.
|
|
1053
|
-
- Parameter offlineTrack `OfflineTextTrack` object to be converted.
|
|
1054
|
-
- Returns: The produced JS object.
|
|
1055
|
-
*/
|
|
1056
857
|
static func toJson(offlineTrack: OfflineTextTrack) -> [String: Any?] {
|
|
1057
858
|
[
|
|
1058
859
|
"id": offlineTrack.label,
|
|
@@ -1060,11 +861,6 @@ extension RCTConvert {
|
|
|
1060
861
|
]
|
|
1061
862
|
}
|
|
1062
863
|
|
|
1063
|
-
/**
|
|
1064
|
-
Utility method to compute a JS value from an `OfflineAudioTrack` object.
|
|
1065
|
-
- Parameter offlineTrack `OfflineAudioTrack` object to be converted.
|
|
1066
|
-
- Returns: The produced JS object.
|
|
1067
|
-
*/
|
|
1068
864
|
static func toJson(offlineTrack: OfflineAudioTrack) -> [String: Any?] {
|
|
1069
865
|
[
|
|
1070
866
|
"id": offlineTrack.label,
|
|
@@ -1072,12 +868,7 @@ extension RCTConvert {
|
|
|
1072
868
|
]
|
|
1073
869
|
}
|
|
1074
870
|
|
|
1075
|
-
|
|
1076
|
-
Utility method to compute a JS value from an `OfflineTrackSelection` object.
|
|
1077
|
-
- Parameter offlineTracks `OfflineTrackSelection` object to be converted.
|
|
1078
|
-
- Returns: The produced JS object.
|
|
1079
|
-
*/
|
|
1080
|
-
static func toJson(offlineTracks: OfflineTrackSelection?) -> [String: Any?]? {
|
|
871
|
+
static func toJson(offlineTracks: OfflineTrackSelection?) -> [String: Any]? {
|
|
1081
872
|
guard let offlineTracks else {
|
|
1082
873
|
return nil
|
|
1083
874
|
}
|
|
@@ -1089,11 +880,6 @@ extension RCTConvert {
|
|
|
1089
880
|
}
|
|
1090
881
|
#endif
|
|
1091
882
|
|
|
1092
|
-
/**
|
|
1093
|
-
Utility method to instantiate a `AdaptationConfig` from a JS object.
|
|
1094
|
-
- Parameter json: JS object
|
|
1095
|
-
- Returns: The produced `AdaptationConfig` object
|
|
1096
|
-
*/
|
|
1097
883
|
static func adaptationConfig(_ json: Any?) -> AdaptationConfig? {
|
|
1098
884
|
guard let json = json as? [String: Any?] else {
|
|
1099
885
|
return nil
|
|
@@ -1106,12 +892,7 @@ extension RCTConvert {
|
|
|
1106
892
|
return adaptationConfig
|
|
1107
893
|
}
|
|
1108
894
|
|
|
1109
|
-
|
|
1110
|
-
Utility method to compute a JS value from an `Thumbnail` object.
|
|
1111
|
-
- Parameter thumbnail `Thumbnail` object to be converted.
|
|
1112
|
-
- Returns: The produced JS object.
|
|
1113
|
-
*/
|
|
1114
|
-
static func toJson(thumbnail: Thumbnail?) -> [String: Any?]? {
|
|
895
|
+
static func toJson(thumbnail: Thumbnail?) -> [String: Any]? {
|
|
1115
896
|
guard let thumbnail else {
|
|
1116
897
|
return nil
|
|
1117
898
|
}
|
|
@@ -1128,11 +909,6 @@ extension RCTConvert {
|
|
|
1128
909
|
]
|
|
1129
910
|
}
|
|
1130
911
|
|
|
1131
|
-
/**
|
|
1132
|
-
Utility method to instantiate a `RemoteControlConfig` from a JS object.
|
|
1133
|
-
- Parameter json: JS object
|
|
1134
|
-
- Returns: The produced `RemoteControlConfig` object
|
|
1135
|
-
*/
|
|
1136
912
|
static func remoteControlConfig(_ json: Any?) -> RemoteControlConfig? {
|
|
1137
913
|
guard let json = json as? [String: Any?] else {
|
|
1138
914
|
return nil
|
|
@@ -1160,11 +936,6 @@ extension RCTConvert {
|
|
|
1160
936
|
}
|
|
1161
937
|
|
|
1162
938
|
#if os(iOS)
|
|
1163
|
-
/**
|
|
1164
|
-
Utility method to instantiate a `BitmovinCastManagerOptions` from a JS object.
|
|
1165
|
-
- Parameter json: JS object
|
|
1166
|
-
- Returns: The produced `BitmovinCastManagerOptions` object
|
|
1167
|
-
*/
|
|
1168
939
|
static func castManagerOptions(_ json: Any?) -> BitmovinCastManagerOptions? {
|
|
1169
940
|
guard let json = json as? [String: Any?] else {
|
|
1170
941
|
return nil
|
|
@@ -1176,11 +947,6 @@ extension RCTConvert {
|
|
|
1176
947
|
return options
|
|
1177
948
|
}
|
|
1178
949
|
|
|
1179
|
-
/**
|
|
1180
|
-
Utility method to compute a JS value from an `CastPayload` object.
|
|
1181
|
-
- Parameter castPayload `CastPayload` object to be converted.
|
|
1182
|
-
- Returns: The produced JS object.
|
|
1183
|
-
*/
|
|
1184
950
|
static func toJson(castPayload: CastPayload) -> [String: Any?] {
|
|
1185
951
|
[
|
|
1186
952
|
"currentTime": castPayload.currentTime,
|
|
@@ -1189,30 +955,21 @@ extension RCTConvert {
|
|
|
1189
955
|
]
|
|
1190
956
|
}
|
|
1191
957
|
|
|
1192
|
-
/**
|
|
1193
|
-
Utility method to instantiate a `SourceRemoteControlConfig` from a JS object.
|
|
1194
|
-
- Parameter json: JS object
|
|
1195
|
-
- Returns: The produced `SourceRemoteControlConfig` object
|
|
1196
|
-
*/
|
|
1197
958
|
static func sourceRemoteControlConfig(_ json: Any?) -> SourceRemoteControlConfig? {
|
|
1198
959
|
guard let json = json as? [String: Any?],
|
|
1199
960
|
let castSourceConfigJson = json["castSourceConfig"] as? [String: Any?] else {
|
|
1200
961
|
return nil
|
|
1201
962
|
}
|
|
963
|
+
|
|
1202
964
|
return SourceRemoteControlConfig(
|
|
1203
965
|
castSourceConfig: RCTConvert.sourceConfig(
|
|
1204
|
-
|
|
1205
|
-
drmConfig:
|
|
966
|
+
castSourceConfigJson,
|
|
967
|
+
drmConfig: castSourceConfigJson["drmConfig"].flatMap(RCTConvert.drmConfig)?.widevine
|
|
1206
968
|
)
|
|
1207
969
|
)
|
|
1208
970
|
}
|
|
1209
971
|
#endif
|
|
1210
972
|
|
|
1211
|
-
/**
|
|
1212
|
-
Utility method to instantiate a `PictureInPictureConfig` from a JS object.
|
|
1213
|
-
- Parameter json: JS object
|
|
1214
|
-
- Returns: The produced `PictureInPictureConfig` object
|
|
1215
|
-
*/
|
|
1216
973
|
static func pictureInPictureConfig(_ json: Any?) -> PictureInPictureConfig? {
|
|
1217
974
|
guard let json = json as? [String: Any?] else {
|
|
1218
975
|
return nil
|
|
@@ -1231,28 +988,18 @@ extension RCTConvert {
|
|
|
1231
988
|
return pictureInPictureConfig
|
|
1232
989
|
}
|
|
1233
990
|
|
|
1234
|
-
/**
|
|
1235
|
-
Utility method to instantiate a `RNPlayerViewConfig` from a JS object.
|
|
1236
|
-
- Parameter json: JS object
|
|
1237
|
-
- Returns: The produced `UiConfig` object
|
|
1238
|
-
*/
|
|
1239
991
|
static func rnPlayerViewConfig(_ json: Any?) -> RNPlayerViewConfig? {
|
|
1240
992
|
guard let json = json as? [String: Any?] else {
|
|
1241
993
|
return nil
|
|
1242
994
|
}
|
|
1243
995
|
|
|
1244
996
|
return RNPlayerViewConfig(
|
|
1245
|
-
uiConfig:
|
|
1246
|
-
pictureInPictureConfig:
|
|
997
|
+
uiConfig: json["uiConfig"].flatMap(rnUiConfig),
|
|
998
|
+
pictureInPictureConfig: json["pictureInPictureConfig"].flatMap(pictureInPictureConfig),
|
|
1247
999
|
hideFirstFrame: json["hideFirstFrame"] as? Bool
|
|
1248
1000
|
)
|
|
1249
1001
|
}
|
|
1250
1002
|
|
|
1251
|
-
/**
|
|
1252
|
-
Utility method to instantiate a `RNUiConfig` from a JS object.
|
|
1253
|
-
- Parameter json: JS object
|
|
1254
|
-
- Returns: The produced `RNUiConfig` object
|
|
1255
|
-
*/
|
|
1256
1003
|
static func rnUiConfig(_ json: Any?) -> RNUiConfig? {
|
|
1257
1004
|
guard let json = json as? [String: Any?] else {
|
|
1258
1005
|
return nil
|
|
@@ -1267,11 +1014,6 @@ extension RCTConvert {
|
|
|
1267
1014
|
)
|
|
1268
1015
|
}
|
|
1269
1016
|
|
|
1270
|
-
/**
|
|
1271
|
-
* Maps a JS string into the corresponding `BufferType` value.
|
|
1272
|
-
* - Parameter json: JS string representing the `BufferType`.
|
|
1273
|
-
* - Returns: The `BufferType` corresponding to `json`, or `nil` if the conversion fails.
|
|
1274
|
-
*/
|
|
1275
1017
|
static func bufferType(_ json: String) -> BufferType? {
|
|
1276
1018
|
switch json {
|
|
1277
1019
|
case "forwardDuration":
|
|
@@ -1283,11 +1025,6 @@ extension RCTConvert {
|
|
|
1283
1025
|
}
|
|
1284
1026
|
}
|
|
1285
1027
|
|
|
1286
|
-
/**
|
|
1287
|
-
* Converts any `BufferType` value into its json representation.
|
|
1288
|
-
* - Parameter bufferType: `BufferType` value.
|
|
1289
|
-
* - Returns: The produced JS string.
|
|
1290
|
-
*/
|
|
1291
1028
|
static func toJson(bufferType: BufferType) -> String {
|
|
1292
1029
|
switch bufferType {
|
|
1293
1030
|
case .forwardDuration:
|
|
@@ -1297,12 +1034,6 @@ extension RCTConvert {
|
|
|
1297
1034
|
}
|
|
1298
1035
|
}
|
|
1299
1036
|
|
|
1300
|
-
/**
|
|
1301
|
-
Utility method to get a json dictionary value from a `BufferLevel` object.
|
|
1302
|
-
- Parameter bufferLevel: The `BufferLevel` to convert to json format.
|
|
1303
|
-
- Parameter mediaType: The `MediaType` value to pass through.
|
|
1304
|
-
- Returns: The generated json dictionary.
|
|
1305
|
-
*/
|
|
1306
1037
|
static func toJson(bufferLevel: BufferLevel, mediaType: String) -> [String: Any] {
|
|
1307
1038
|
[
|
|
1308
1039
|
"level": bufferLevel.level,
|
|
@@ -1312,11 +1043,6 @@ extension RCTConvert {
|
|
|
1312
1043
|
]
|
|
1313
1044
|
}
|
|
1314
1045
|
|
|
1315
|
-
/**
|
|
1316
|
-
Utility method to get a json dictionary value from a `BufferModule.RNBufferLevels` object.
|
|
1317
|
-
- Parameter bufferLevels: The `BufferModule.RNBufferLevels` to convert to json format.
|
|
1318
|
-
- Returns: The generated json dictionary.
|
|
1319
|
-
*/
|
|
1320
1046
|
static func toJson(bufferLevels: RNBufferLevels) -> [String: Any] {
|
|
1321
1047
|
[
|
|
1322
1048
|
"audio": toJson(bufferLevel: bufferLevels.audio, mediaType: "audio"),
|