bitmovin-player-react-native 0.44.1-alpha.0 → 1.0.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintignore +11 -0
- package/.eslintrc.js +7 -0
- package/.gitattributes +3 -0
- package/.prettierignore +11 -0
- package/.ruby-version +1 -0
- package/.swiftlint.yml +171 -0
- package/Brewfile +2 -0
- package/CHANGELOG.md +627 -0
- package/CONTRIBUTING.md +255 -0
- package/TODO.md +0 -0
- package/android/.editorconfig +8 -0
- package/android/build.gradle +78 -75
- package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/android/gradle/wrapper/gradle-wrapper.properties +7 -0
- package/android/gradle.properties +1 -0
- package/android/gradlew +248 -0
- package/android/gradlew.bat +92 -0
- package/android/ktlint.gradle +31 -0
- package/android/src/main/java/com/bitmovin/player/reactnative/ActivityLifecycleListener.kt +51 -0
- package/android/src/main/java/com/bitmovin/player/reactnative/BitmovinCastManagerModule.kt +32 -55
- package/android/src/main/java/com/bitmovin/player/reactnative/BufferModule.kt +33 -45
- package/android/src/main/java/com/bitmovin/player/reactnative/CustomMessageHandlerModule.kt +84 -0
- package/android/src/main/java/com/bitmovin/player/reactnative/DebugModule.kt +6 -14
- package/android/src/main/java/com/bitmovin/player/reactnative/DecoderConfigModule.kt +89 -44
- package/android/src/main/java/com/bitmovin/player/reactnative/DrmModule.kt +80 -99
- package/android/src/main/java/com/bitmovin/player/reactnative/EventSubscription.kt +22 -0
- package/android/src/main/java/com/bitmovin/player/reactnative/FullscreenHandlerModule.kt +100 -0
- package/android/src/main/java/com/bitmovin/player/reactnative/MediaSessionPlaybackManager.kt +5 -5
- package/android/src/main/java/com/bitmovin/player/reactnative/NetworkModule.kt +98 -56
- package/android/src/main/java/com/bitmovin/player/reactnative/OfflineModule.kt +132 -186
- package/android/src/main/java/com/bitmovin/player/reactnative/PlayerAnalyticsModule.kt +37 -36
- package/android/src/main/java/com/bitmovin/player/reactnative/PlayerModule.kt +252 -528
- package/android/src/main/java/com/bitmovin/player/reactnative/RNPlayerPackage.kt +11 -0
- package/android/src/main/java/com/bitmovin/player/reactnative/RNPlayerView.kt +558 -213
- package/android/src/main/java/com/bitmovin/player/reactnative/RNPlayerViewManager.kt +99 -286
- package/android/src/main/java/com/bitmovin/player/reactnative/ResultWaiter.kt +58 -0
- package/android/src/main/java/com/bitmovin/player/reactnative/SourceModule.kt +77 -151
- package/android/src/main/java/com/bitmovin/player/reactnative/Types.kt +44 -0
- package/android/src/main/java/com/bitmovin/player/reactnative/UuidModule.kt +12 -15
- package/android/src/main/java/com/bitmovin/player/reactnative/converter/JsonConverter.kt +296 -456
- package/android/src/main/java/com/bitmovin/player/reactnative/extensions/ListExtension.kt +89 -0
- package/android/src/main/java/com/bitmovin/player/reactnative/extensions/MapExtension.kt +95 -0
- package/android/src/main/java/com/bitmovin/player/reactnative/offline/OfflineContentManagerBridge.kt +20 -52
- package/android/src/main/java/com/bitmovin/player/reactnative/ui/CustomMessageHandlerBridge.kt +10 -20
- package/android/src/main/java/com/bitmovin/player/reactnative/ui/FullscreenHandlerBridge.kt +4 -9
- package/app.plugin.js +21 -0
- package/build/BitmovinPlayerReactNative.types.d.ts +18 -0
- package/build/BitmovinPlayerReactNative.types.d.ts.map +1 -0
- package/build/BitmovinPlayerReactNative.types.js +2 -0
- package/build/BitmovinPlayerReactNative.types.js.map +1 -0
- package/build/adaptationConfig.d.ts +18 -0
- package/build/adaptationConfig.d.ts.map +1 -0
- package/build/adaptationConfig.js +2 -0
- package/build/adaptationConfig.js.map +1 -0
- package/build/advertising.d.ts +175 -0
- package/build/advertising.d.ts.map +1 -0
- package/build/advertising.js +37 -0
- package/build/advertising.js.map +1 -0
- package/build/analytics/config.d.ts +194 -0
- package/build/analytics/config.d.ts.map +1 -0
- package/build/analytics/config.js +2 -0
- package/build/analytics/config.js.map +1 -0
- package/build/analytics/index.d.ts +3 -0
- package/build/analytics/index.d.ts.map +1 -0
- package/build/analytics/index.js +3 -0
- package/build/analytics/index.js.map +1 -0
- package/build/analytics/player.d.ts +24 -0
- package/build/analytics/player.d.ts.map +1 -0
- package/build/analytics/player.js +30 -0
- package/build/analytics/player.js.map +1 -0
- package/build/analytics/playerAnalyticsModule.d.ts +13 -0
- package/build/analytics/playerAnalyticsModule.d.ts.map +1 -0
- package/build/analytics/playerAnalyticsModule.js +3 -0
- package/build/analytics/playerAnalyticsModule.js.map +1 -0
- package/build/audioSession.d.ts +33 -0
- package/build/audioSession.d.ts.map +1 -0
- package/build/audioSession.js +21 -0
- package/build/audioSession.js.map +1 -0
- package/build/audioTrack.d.ts +39 -0
- package/build/audioTrack.d.ts.map +1 -0
- package/build/audioTrack.js +2 -0
- package/build/audioTrack.js.map +1 -0
- package/build/bitmovinCastManager.d.ts +58 -0
- package/build/bitmovinCastManager.d.ts.map +1 -0
- package/build/bitmovinCastManager.js +64 -0
- package/build/bitmovinCastManager.js.map +1 -0
- package/build/bufferApi.d.ts +85 -0
- package/build/bufferApi.d.ts.map +1 -0
- package/build/bufferApi.js +60 -0
- package/build/bufferApi.js.map +1 -0
- package/build/bufferConfig.d.ts +42 -0
- package/build/bufferConfig.d.ts.map +1 -0
- package/build/bufferConfig.js +2 -0
- package/build/bufferConfig.js.map +1 -0
- package/build/components/PlayerView/events.d.ts +310 -0
- package/build/components/PlayerView/events.d.ts.map +1 -0
- package/build/components/PlayerView/events.js +2 -0
- package/build/components/PlayerView/events.js.map +1 -0
- package/build/components/PlayerView/index.d.ts +10 -0
- package/build/components/PlayerView/index.d.ts.map +1 -0
- package/build/components/PlayerView/index.js +72 -0
- package/build/components/PlayerView/index.js.map +1 -0
- package/build/components/PlayerView/native.d.ts +30 -0
- package/build/components/PlayerView/native.d.ts.map +1 -0
- package/build/components/PlayerView/native.js +6 -0
- package/build/components/PlayerView/native.js.map +1 -0
- package/build/components/PlayerView/nativeEvents.d.ts +437 -0
- package/build/components/PlayerView/nativeEvents.d.ts.map +1 -0
- package/build/components/PlayerView/nativeEvents.js +2 -0
- package/build/components/PlayerView/nativeEvents.js.map +1 -0
- package/build/components/PlayerView/pictureInPictureConfig.d.ts +22 -0
- package/build/components/PlayerView/pictureInPictureConfig.d.ts.map +1 -0
- package/build/components/PlayerView/pictureInPictureConfig.js +2 -0
- package/build/components/PlayerView/pictureInPictureConfig.js.map +1 -0
- package/build/components/PlayerView/playerViewConfig.d.ts +111 -0
- package/build/components/PlayerView/playerViewConfig.d.ts.map +1 -0
- package/build/components/PlayerView/playerViewConfig.js +51 -0
- package/build/components/PlayerView/playerViewConfig.js.map +1 -0
- package/build/components/PlayerView/properties.d.ts +61 -0
- package/build/components/PlayerView/properties.d.ts.map +1 -0
- package/build/components/PlayerView/properties.js +2 -0
- package/build/components/PlayerView/properties.js.map +1 -0
- package/build/components/index.d.ts +5 -0
- package/build/components/index.d.ts.map +1 -0
- package/build/components/index.js +5 -0
- package/build/components/index.js.map +1 -0
- package/build/debug.d.ts +46 -0
- package/build/debug.d.ts.map +1 -0
- package/build/debug.js +52 -0
- package/build/debug.js.map +1 -0
- package/build/decoder/decoderConfig.d.ts +96 -0
- package/build/decoder/decoderConfig.d.ts.map +1 -0
- package/build/decoder/decoderConfig.js +6 -0
- package/build/decoder/decoderConfig.js.map +1 -0
- package/build/decoder/decoderConfigModule.d.ts +14 -0
- package/build/decoder/decoderConfigModule.d.ts.map +1 -0
- package/build/decoder/decoderConfigModule.js +31 -0
- package/build/decoder/decoderConfigModule.js.map +1 -0
- package/build/decoder/index.d.ts +26 -0
- package/build/decoder/index.d.ts.map +1 -0
- package/build/decoder/index.js +50 -0
- package/build/decoder/index.js.map +1 -0
- package/build/drm/drmModule.d.ts +55 -0
- package/build/drm/drmModule.d.ts.map +1 -0
- package/build/drm/drmModule.js +3 -0
- package/build/drm/drmModule.js.map +1 -0
- package/build/drm/fairplayConfig.d.ts +91 -0
- package/build/drm/fairplayConfig.d.ts.map +1 -0
- package/build/drm/fairplayConfig.js +2 -0
- package/build/drm/fairplayConfig.js.map +1 -0
- package/build/drm/index.d.ts +112 -0
- package/build/drm/index.d.ts.map +1 -0
- package/build/drm/index.js +191 -0
- package/build/drm/index.js.map +1 -0
- package/build/drm/widevineConfig.d.ts +58 -0
- package/build/drm/widevineConfig.d.ts.map +1 -0
- package/build/drm/widevineConfig.js +2 -0
- package/build/drm/widevineConfig.js.map +1 -0
- package/build/events.d.ts +692 -0
- package/build/events.d.ts.map +1 -0
- package/build/events.js +2 -0
- package/build/events.js.map +1 -0
- package/build/hooks/index.d.ts +2 -0
- package/build/hooks/index.d.ts.map +1 -0
- package/build/hooks/index.js +2 -0
- package/build/hooks/index.js.map +1 -0
- package/build/hooks/usePlayer.d.ts +8 -0
- package/build/hooks/usePlayer.d.ts.map +1 -0
- package/build/hooks/usePlayer.js +10 -0
- package/build/hooks/usePlayer.js.map +1 -0
- package/build/hooks/useProxy.d.ts +18 -0
- package/build/hooks/useProxy.d.ts.map +1 -0
- package/build/hooks/useProxy.js +16 -0
- package/build/hooks/useProxy.js.map +1 -0
- package/build/index.d.ts +32 -0
- package/build/index.d.ts.map +1 -0
- package/build/index.js +32 -0
- package/build/index.js.map +1 -0
- package/build/liveConfig.d.ts +13 -0
- package/build/liveConfig.d.ts.map +1 -0
- package/build/liveConfig.js +2 -0
- package/build/liveConfig.js.map +1 -0
- package/build/media.d.ts +85 -0
- package/build/media.d.ts.map +1 -0
- package/build/media.js +2 -0
- package/build/media.js.map +1 -0
- package/build/mediaControlConfig.d.ts +62 -0
- package/build/mediaControlConfig.d.ts.map +1 -0
- package/build/mediaControlConfig.js +2 -0
- package/build/mediaControlConfig.js.map +1 -0
- package/build/mediaTrackRole.d.ts +28 -0
- package/build/mediaTrackRole.d.ts.map +1 -0
- package/build/mediaTrackRole.js +2 -0
- package/build/mediaTrackRole.js.map +1 -0
- package/build/modules/AudioSessionModule.d.ts +8 -0
- package/build/modules/AudioSessionModule.d.ts.map +1 -0
- package/build/modules/AudioSessionModule.js +7 -0
- package/build/modules/AudioSessionModule.js.map +1 -0
- package/build/modules/BitmovinCastManagerModule.d.ts +11 -0
- package/build/modules/BitmovinCastManagerModule.d.ts.map +1 -0
- package/build/modules/BitmovinCastManagerModule.js +3 -0
- package/build/modules/BitmovinCastManagerModule.js.map +1 -0
- package/build/modules/BufferModule.d.ts +16 -0
- package/build/modules/BufferModule.d.ts.map +1 -0
- package/build/modules/BufferModule.js +3 -0
- package/build/modules/BufferModule.js.map +1 -0
- package/build/modules/DebugModule.d.ts +8 -0
- package/build/modules/DebugModule.d.ts.map +1 -0
- package/build/modules/DebugModule.js +3 -0
- package/build/modules/DebugModule.js.map +1 -0
- package/build/modules/PlayerModule.d.ts +188 -0
- package/build/modules/PlayerModule.d.ts.map +1 -0
- package/build/modules/PlayerModule.js +3 -0
- package/build/modules/PlayerModule.js.map +1 -0
- package/build/modules/SourceModule.d.ts +51 -0
- package/build/modules/SourceModule.d.ts.map +1 -0
- package/build/modules/SourceModule.js +3 -0
- package/build/modules/SourceModule.js.map +1 -0
- package/build/modules/UuidModule.d.ts +8 -0
- package/build/modules/UuidModule.d.ts.map +1 -0
- package/build/modules/UuidModule.js +3 -0
- package/build/modules/UuidModule.js.map +1 -0
- package/build/nativeInstance.d.ts +49 -0
- package/build/nativeInstance.d.ts.map +1 -0
- package/build/nativeInstance.js +20 -0
- package/build/nativeInstance.js.map +1 -0
- package/build/network/index.d.ts +50 -0
- package/build/network/index.d.ts.map +1 -0
- package/build/network/index.js +102 -0
- package/build/network/index.js.map +1 -0
- package/build/network/networkConfig.d.ts +151 -0
- package/build/network/networkConfig.d.ts.map +1 -0
- package/build/network/networkConfig.js +21 -0
- package/build/network/networkConfig.js.map +1 -0
- package/build/network/networkModule.d.ts +29 -0
- package/build/network/networkModule.d.ts.map +1 -0
- package/build/network/networkModule.js +3 -0
- package/build/network/networkModule.js.map +1 -0
- package/build/offline/index.d.ts +8 -0
- package/build/offline/index.d.ts.map +1 -0
- package/build/offline/index.js +8 -0
- package/build/offline/index.js.map +1 -0
- package/build/offline/offlineContentConfig.d.ts +18 -0
- package/build/offline/offlineContentConfig.d.ts.map +1 -0
- package/build/offline/offlineContentConfig.js +2 -0
- package/build/offline/offlineContentConfig.js.map +1 -0
- package/build/offline/offlineContentManager.d.ts +90 -0
- package/build/offline/offlineContentManager.d.ts.map +1 -0
- package/build/offline/offlineContentManager.js +177 -0
- package/build/offline/offlineContentManager.js.map +1 -0
- package/build/offline/offlineContentManagerListener.d.ts +174 -0
- package/build/offline/offlineContentManagerListener.d.ts.map +1 -0
- package/build/offline/offlineContentManagerListener.js +17 -0
- package/build/offline/offlineContentManagerListener.js.map +1 -0
- package/build/offline/offlineContentOptions.d.ts +29 -0
- package/build/offline/offlineContentOptions.d.ts.map +1 -0
- package/build/offline/offlineContentOptions.js +2 -0
- package/build/offline/offlineContentOptions.js.map +1 -0
- package/build/offline/offlineDownloadRequest.d.ts +19 -0
- package/build/offline/offlineDownloadRequest.d.ts.map +1 -0
- package/build/offline/offlineDownloadRequest.js +2 -0
- package/build/offline/offlineDownloadRequest.js.map +1 -0
- package/build/offline/offlineModule.d.ts +32 -0
- package/build/offline/offlineModule.d.ts.map +1 -0
- package/build/offline/offlineModule.js +3 -0
- package/build/offline/offlineModule.js.map +1 -0
- package/build/offline/offlineSourceOptions.d.ts +12 -0
- package/build/offline/offlineSourceOptions.d.ts.map +1 -0
- package/build/offline/offlineSourceOptions.js +2 -0
- package/build/offline/offlineSourceOptions.js.map +1 -0
- package/build/offline/offlineState.d.ts +23 -0
- package/build/offline/offlineState.d.ts.map +1 -0
- package/build/offline/offlineState.js +24 -0
- package/build/offline/offlineState.js.map +1 -0
- package/build/playbackConfig.d.ts +88 -0
- package/build/playbackConfig.d.ts.map +1 -0
- package/build/playbackConfig.js +2 -0
- package/build/playbackConfig.js.map +1 -0
- package/build/player.d.ts +308 -0
- package/build/player.d.ts.map +1 -0
- package/build/player.js +445 -0
- package/build/player.js.map +1 -0
- package/build/playerConfig.d.ts +83 -0
- package/build/playerConfig.d.ts.map +1 -0
- package/build/playerConfig.js +2 -0
- package/build/playerConfig.js.map +1 -0
- package/build/remoteControlConfig.d.ts +38 -0
- package/build/remoteControlConfig.d.ts.map +1 -0
- package/build/remoteControlConfig.js +2 -0
- package/build/remoteControlConfig.js.map +1 -0
- package/build/source.d.ts +216 -0
- package/build/source.d.ts.map +1 -0
- package/build/source.js +167 -0
- package/build/source.js.map +1 -0
- package/build/styleConfig.d.ts +120 -0
- package/build/styleConfig.d.ts.map +1 -0
- package/build/styleConfig.js +38 -0
- package/build/styleConfig.js.map +1 -0
- package/build/subtitleFormat.d.ts +27 -0
- package/build/subtitleFormat.d.ts.map +1 -0
- package/build/subtitleFormat.js +28 -0
- package/build/subtitleFormat.js.map +1 -0
- package/build/subtitleTrack.d.ts +55 -0
- package/build/subtitleTrack.d.ts.map +1 -0
- package/build/subtitleTrack.js +2 -0
- package/build/subtitleTrack.js.map +1 -0
- package/build/thumbnail.d.ts +38 -0
- package/build/thumbnail.d.ts.map +1 -0
- package/build/thumbnail.js +2 -0
- package/build/thumbnail.js.map +1 -0
- package/build/tweaksConfig.d.ts +197 -0
- package/build/tweaksConfig.d.ts.map +1 -0
- package/build/tweaksConfig.js +25 -0
- package/build/tweaksConfig.js.map +1 -0
- package/build/ui/customMessageHandlerModule.d.ts +27 -0
- package/build/ui/customMessageHandlerModule.d.ts.map +1 -0
- package/build/ui/customMessageHandlerModule.js +3 -0
- package/build/ui/customMessageHandlerModule.js.map +1 -0
- package/build/ui/custommessagehandler.d.ts +56 -0
- package/build/ui/custommessagehandler.d.ts.map +1 -0
- package/build/ui/custommessagehandler.js +54 -0
- package/build/ui/custommessagehandler.js.map +1 -0
- package/build/ui/custommessagehandlerbridge.d.ts +33 -0
- package/build/ui/custommessagehandlerbridge.d.ts.map +1 -0
- package/build/ui/custommessagehandlerbridge.js +72 -0
- package/build/ui/custommessagehandlerbridge.js.map +1 -0
- package/build/ui/custommessagesender.d.ts +5 -0
- package/build/ui/custommessagesender.d.ts.map +1 -0
- package/build/ui/custommessagesender.js +2 -0
- package/build/ui/custommessagesender.js.map +1 -0
- package/build/ui/fullscreenHandlerModule.d.ts +20 -0
- package/build/ui/fullscreenHandlerModule.d.ts.map +1 -0
- package/build/ui/fullscreenHandlerModule.js +3 -0
- package/build/ui/fullscreenHandlerModule.js.map +1 -0
- package/build/ui/fullscreenhandler.d.ts +18 -0
- package/build/ui/fullscreenhandler.d.ts.map +1 -0
- package/build/ui/fullscreenhandler.js +2 -0
- package/build/ui/fullscreenhandler.js.map +1 -0
- package/build/ui/fullscreenhandlerbridge.d.ts +26 -0
- package/build/ui/fullscreenhandlerbridge.d.ts.map +1 -0
- package/build/ui/fullscreenhandlerbridge.js +67 -0
- package/build/ui/fullscreenhandlerbridge.js.map +1 -0
- package/build/ui/index.d.ts +3 -0
- package/build/ui/index.d.ts.map +1 -0
- package/build/ui/index.js +3 -0
- package/build/ui/index.js.map +1 -0
- package/expo-module.config.json +40 -0
- package/ios/AppLifecycleDelegate.swift +25 -0
- package/ios/AudioSessionModule.swift +14 -40
- package/ios/BitmovinCastManagerModule.swift +30 -69
- package/ios/BufferModule.swift +26 -62
- package/ios/CustomMessageHandlerBridge.swift +11 -18
- package/ios/CustomMessageHandlerModule.swift +61 -63
- package/ios/DebugModule.swift +6 -27
- package/ios/DrmModule.swift +105 -379
- package/ios/Event+JSON.swift +1 -0
- package/ios/FullscreenHandlerBridge.swift +12 -5
- package/ios/FullscreenHandlerModule.swift +73 -57
- package/ios/LockedBox.swift +21 -0
- package/ios/ModuleRegistry+Generics.swift +11 -0
- package/ios/NetworkModule.swift +78 -82
- package/ios/OfflineContentManagerBridge.swift +11 -38
- package/ios/OfflineModule.swift +136 -454
- package/ios/PlayerAnalyticsModule.swift +24 -52
- package/ios/PlayerModule.swift +192 -770
- package/ios/RCTConvert+BitmovinPlayer.swift +38 -312
- package/ios/RNBitmovinPlayer.h +1 -8
- package/ios/RNBitmovinPlayer.podspec +47 -0
- package/ios/RNPlayerView.swift +600 -77
- package/ios/RNPlayerViewManager.swift +96 -210
- package/ios/Registry.swift +2 -2
- package/ios/ResultWaiter.swift +66 -0
- package/ios/SourceModule.swift +104 -223
- package/ios/UuidModule.swift +9 -18
- package/package.json +67 -71
- package/plugin/build/FeatureFlags.d.ts +24 -0
- package/plugin/build/FeatureFlags.js +2 -0
- package/plugin/build/index.d.ts +7 -0
- package/plugin/build/index.js +10 -0
- package/plugin/build/withAppGradleDependencies.d.ts +7 -0
- package/plugin/build/withAppGradleDependencies.js +49 -0
- package/plugin/build/withBitmovinAndroidConfig.d.ts +7 -0
- package/plugin/build/withBitmovinAndroidConfig.js +159 -0
- package/plugin/build/withBitmovinConfig.d.ts +7 -0
- package/plugin/build/withBitmovinConfig.js +21 -0
- package/plugin/build/withBitmovinIosConfig.d.ts +7 -0
- package/plugin/build/withBitmovinIosConfig.js +53 -0
- package/plugin/src/FeatureFlags.ts +21 -0
- package/plugin/src/index.ts +9 -0
- package/plugin/src/withAppGradleDependencies.ts +80 -0
- package/plugin/src/withBitmovinAndroidConfig.ts +224 -0
- package/plugin/src/withBitmovinConfig.ts +24 -0
- package/plugin/src/withBitmovinIosConfig.ts +71 -0
- package/plugin/tsconfig.json +9 -0
- package/plugin/tsconfig.tsbuildinfo +1 -0
- package/prettier.config.js +7 -0
- package/scripts/format-android.sh +2 -0
- package/scripts/format-swift.sh +3 -0
- package/scripts/lint-android.sh +2 -0
- package/scripts/lint-swift.sh +3 -0
- package/scripts/pre-commit.sh +14 -0
- package/scripts/setup-hooks.sh +58 -0
- package/src/BitmovinPlayerReactNative.types.ts +19 -0
- package/src/adaptationConfig.ts +1 -1
- package/src/advertising.ts +1 -1
- package/src/analytics/config.ts +4 -4
- package/src/analytics/player.ts +4 -6
- package/src/analytics/playerAnalyticsModule.ts +19 -0
- package/src/audioSession.ts +4 -6
- package/src/audioTrack.ts +1 -1
- package/src/bitmovinCastManager.ts +14 -10
- package/src/bufferApi.ts +1 -3
- package/src/bufferConfig.ts +2 -2
- package/src/components/PlayerView/events.ts +92 -94
- package/src/components/PlayerView/index.tsx +109 -159
- package/src/components/PlayerView/native.ts +24 -11
- package/src/components/PlayerView/nativeEvents.ts +113 -94
- package/src/components/PlayerView/pictureInPictureConfig.ts +1 -1
- package/src/components/PlayerView/playerViewConfig.ts +4 -8
- package/src/components/PlayerView/properties.ts +23 -22
- package/src/debug.ts +1 -3
- package/src/decoder/decoderConfig.ts +3 -3
- package/src/decoder/decoderConfigModule.ts +62 -0
- package/src/decoder/index.ts +32 -16
- package/src/drm/drmModule.ts +84 -0
- package/src/drm/fairplayConfig.ts +1 -1
- package/src/drm/index.ts +130 -40
- package/src/drm/widevineConfig.ts +5 -5
- package/src/events.ts +47 -41
- package/src/hooks/useProxy.ts +13 -20
- package/src/mediaControlConfig.ts +1 -1
- package/src/modules/AudioSessionModule.ts +13 -0
- package/src/modules/BitmovinCastManagerModule.ts +14 -0
- package/src/modules/BufferModule.ts +18 -0
- package/src/modules/DebugModule.ts +9 -0
- package/src/modules/PlayerModule.ts +251 -0
- package/src/modules/SourceModule.ts +74 -0
- package/src/modules/UuidModule.ts +9 -0
- package/src/nativeInstance.ts +3 -3
- package/src/network/index.ts +42 -15
- package/src/network/networkConfig.ts +3 -3
- package/src/network/networkModule.ts +51 -0
- package/src/offline/offlineContentConfig.ts +1 -1
- package/src/offline/offlineContentManager.ts +15 -50
- package/src/offline/offlineContentManagerListener.ts +20 -23
- package/src/offline/offlineContentOptions.ts +2 -2
- package/src/offline/offlineDownloadRequest.ts +1 -1
- package/src/offline/offlineModule.ts +46 -0
- package/src/offline/offlineSourceOptions.ts +2 -2
- package/src/offline/offlineState.ts +1 -1
- package/src/playbackConfig.ts +5 -6
- package/src/player.ts +53 -48
- package/src/source.ts +15 -14
- package/src/styleConfig.ts +5 -5
- package/src/subtitleFormat.ts +5 -5
- package/src/subtitleTrack.ts +1 -1
- package/src/tweaksConfig.ts +16 -16
- package/src/ui/customMessageHandlerModule.ts +46 -0
- package/src/ui/custommessagehandlerbridge.ts +45 -18
- package/src/ui/fullscreenHandlerModule.ts +35 -0
- package/src/ui/fullscreenhandlerbridge.ts +35 -15
- package/tsconfig.json +9 -0
- package/typedoc.json +23 -0
- package/RNBitmovinPlayer.podspec +0 -26
- package/android/src/main/java/com/bitmovin/player/reactnative/BitmovinBaseModule.kt +0 -114
- package/android/src/main/java/com/bitmovin/player/reactnative/EventRelay.kt +0 -47
- package/android/src/main/java/com/bitmovin/player/reactnative/RNPlayerViewPackage.kt +0 -48
- package/android/src/main/java/com/bitmovin/player/reactnative/extensions/ReactContextExtension.kt +0 -24
- package/android/src/main/java/com/bitmovin/player/reactnative/extensions/ReadableArray.kt +0 -20
- package/android/src/main/java/com/bitmovin/player/reactnative/extensions/ReadableMap.kt +0 -15
- package/android/src/main/java/com/bitmovin/player/reactnative/extensions/ReadableMapExtension.kt +0 -57
- package/android/src/main/java/com/bitmovin/player/reactnative/extensions/WritableMap.kt +0 -27
- package/android/src/main/java/com/bitmovin/player/reactnative/ui/CustomMessageHandlerModule.kt +0 -86
- package/android/src/main/java/com/bitmovin/player/reactnative/ui/FullscreenHandlerModule.kt +0 -78
- package/ios/AudioSessionModule.m +0 -10
- package/ios/BitmovinCastManagerModule.m +0 -14
- package/ios/BufferModule.m +0 -8
- package/ios/CustomMessageHandlerModule.m +0 -10
- package/ios/DebugModule.m +0 -7
- package/ios/DrmModule.m +0 -16
- package/ios/FullscreenHandlerModule.m +0 -10
- package/ios/NetworkModule.m +0 -10
- package/ios/OfflineModule.m +0 -19
- package/ios/PlayerAnalyticsModule.m +0 -8
- package/ios/PlayerModule.m +0 -130
- package/ios/PreprocessHttpRequestDelegateBridge.swift +0 -30
- package/ios/RCTBridge+Generics.swift +0 -6
- package/ios/RNBitmovinPlayer.xcodeproj/project.pbxproj +0 -303
- package/ios/RNPlayerView+PlayerListener.swift +0 -229
- package/ios/RNPlayerView+UserInterfaceListener.swift +0 -35
- package/ios/RNPlayerViewManager.m +0 -79
- package/ios/SourceModule.m +0 -42
- package/ios/UuidModule.m +0 -9
- package/lib/index.d.mts +0 -4303
- package/lib/index.d.ts +0 -4303
- package/lib/index.js +0 -1895
- package/lib/index.mjs +0 -1836
package/ios/RNPlayerView.swift
CHANGED
|
@@ -1,95 +1,618 @@
|
|
|
1
|
+
// swiftlint:disable file_length
|
|
1
2
|
import BitmovinPlayer
|
|
3
|
+
import ExpoModulesCore
|
|
2
4
|
|
|
3
|
-
|
|
4
|
-
public class RNPlayerView: UIView {
|
|
5
|
-
/// React component events. Directly mapped to props in `NativePlayerView`.
|
|
6
|
-
@objc var onBmpEvent: RCTBubblingEventBlock?
|
|
7
|
-
@objc var onBmpPlayerActive: RCTBubblingEventBlock?
|
|
8
|
-
@objc var onBmpPlayerError: RCTBubblingEventBlock?
|
|
9
|
-
@objc var onBmpPlayerWarning: RCTBubblingEventBlock?
|
|
10
|
-
@objc var onBmpDestroy: RCTBubblingEventBlock?
|
|
11
|
-
@objc var onBmpMuted: RCTBubblingEventBlock?
|
|
12
|
-
@objc var onBmpUnmuted: RCTBubblingEventBlock?
|
|
13
|
-
@objc var onBmpReady: RCTBubblingEventBlock?
|
|
14
|
-
@objc var onBmpPaused: RCTBubblingEventBlock?
|
|
15
|
-
@objc var onBmpPlay: RCTBubblingEventBlock?
|
|
16
|
-
@objc var onBmpPlaying: RCTBubblingEventBlock?
|
|
17
|
-
@objc var onBmpPlaybackFinished: RCTBubblingEventBlock?
|
|
18
|
-
@objc var onBmpSeek: RCTBubblingEventBlock?
|
|
19
|
-
@objc var onBmpSeeked: RCTBubblingEventBlock?
|
|
20
|
-
@objc var onBmpTimeShift: RCTBubblingEventBlock?
|
|
21
|
-
@objc var onBmpTimeShifted: RCTBubblingEventBlock?
|
|
22
|
-
@objc var onBmpStallStarted: RCTBubblingEventBlock?
|
|
23
|
-
@objc var onBmpStallEnded: RCTBubblingEventBlock?
|
|
24
|
-
@objc var onBmpTimeChanged: RCTBubblingEventBlock?
|
|
25
|
-
@objc var onBmpSourceLoad: RCTBubblingEventBlock?
|
|
26
|
-
@objc var onBmpSourceLoaded: RCTBubblingEventBlock?
|
|
27
|
-
@objc var onBmpSourceUnloaded: RCTBubblingEventBlock?
|
|
28
|
-
@objc var onBmpSourceError: RCTBubblingEventBlock?
|
|
29
|
-
@objc var onBmpSourceWarning: RCTBubblingEventBlock?
|
|
30
|
-
@objc var onBmpAudioAdded: RCTBubblingEventBlock?
|
|
31
|
-
@objc var onBmpAudioRemoved: RCTBubblingEventBlock?
|
|
32
|
-
@objc var onBmpAudioChanged: RCTBubblingEventBlock?
|
|
33
|
-
@objc var onBmpSubtitleAdded: RCTBubblingEventBlock?
|
|
34
|
-
@objc var onBmpSubtitleRemoved: RCTBubblingEventBlock?
|
|
35
|
-
@objc var onBmpSubtitleChanged: RCTBubblingEventBlock?
|
|
36
|
-
@objc var onBmpDownloadFinished: RCTBubblingEventBlock?
|
|
37
|
-
@objc var onBmpPictureInPictureEnter: RCTBubblingEventBlock?
|
|
38
|
-
@objc var onBmpPictureInPictureEntered: RCTBubblingEventBlock?
|
|
39
|
-
@objc var onBmpPictureInPictureExit: RCTBubblingEventBlock?
|
|
40
|
-
@objc var onBmpPictureInPictureExited: RCTBubblingEventBlock?
|
|
41
|
-
@objc var onBmpAdBreakFinished: RCTBubblingEventBlock?
|
|
42
|
-
@objc var onBmpAdBreakStarted: RCTBubblingEventBlock?
|
|
43
|
-
@objc var onBmpAdClicked: RCTBubblingEventBlock?
|
|
44
|
-
@objc var onBmpAdError: RCTBubblingEventBlock?
|
|
45
|
-
@objc var onBmpAdFinished: RCTBubblingEventBlock?
|
|
46
|
-
@objc var onBmpAdManifestLoad: RCTBubblingEventBlock?
|
|
47
|
-
@objc var onBmpAdManifestLoaded: RCTBubblingEventBlock?
|
|
48
|
-
@objc var onBmpAdQuartile: RCTBubblingEventBlock?
|
|
49
|
-
@objc var onBmpAdScheduled: RCTBubblingEventBlock?
|
|
50
|
-
@objc var onBmpAdSkipped: RCTBubblingEventBlock?
|
|
51
|
-
@objc var onBmpAdStarted: RCTBubblingEventBlock?
|
|
52
|
-
@objc var onBmpVideoDownloadQualityChanged: RCTBubblingEventBlock?
|
|
53
|
-
@objc var onBmpVideoPlaybackQualityChanged: RCTBubblingEventBlock?
|
|
54
|
-
@objc var onBmpFullscreenEnabled: RCTBubblingEventBlock?
|
|
55
|
-
@objc var onBmpFullscreenDisabled: RCTBubblingEventBlock?
|
|
56
|
-
@objc var onBmpFullscreenEnter: RCTBubblingEventBlock?
|
|
57
|
-
@objc var onBmpFullscreenExit: RCTBubblingEventBlock?
|
|
58
|
-
@objc var onBmpCastAvailable: RCTBubblingEventBlock?
|
|
59
|
-
@objc var onBmpCastPaused: RCTBubblingEventBlock?
|
|
60
|
-
@objc var onBmpCastPlaybackFinished: RCTBubblingEventBlock?
|
|
61
|
-
@objc var onBmpCastPlaying: RCTBubblingEventBlock?
|
|
62
|
-
@objc var onBmpCastStarted: RCTBubblingEventBlock?
|
|
63
|
-
@objc var onBmpCastStart: RCTBubblingEventBlock?
|
|
64
|
-
@objc var onBmpCastStopped: RCTBubblingEventBlock?
|
|
65
|
-
@objc var onBmpCastTimeUpdated: RCTBubblingEventBlock?
|
|
66
|
-
@objc var onBmpCastWaitingForDevice: RCTBubblingEventBlock?
|
|
67
|
-
@objc var onBmpPictureInPictureAvailabilityChanged: RCTBubblingEventBlock?
|
|
68
|
-
@objc var onBmpPlaybackSpeedChanged: RCTBubblingEventBlock?
|
|
69
|
-
@objc var onBmpCueEnter: RCTBubblingEventBlock?
|
|
70
|
-
@objc var onBmpCueExit: RCTBubblingEventBlock?
|
|
71
|
-
@objc var config: [String: Any]?
|
|
72
|
-
|
|
73
|
-
/// The `PlayerView` subview.
|
|
5
|
+
public class RNPlayerView: ExpoView {
|
|
74
6
|
var playerView: PlayerView? {
|
|
75
7
|
willSet {
|
|
8
|
+
playerView?.removeFromSuperview()
|
|
9
|
+
avPlayerViewControllerTransitionForced = false
|
|
76
10
|
newValue?.autoresizingMask = [
|
|
77
11
|
.flexibleWidth,
|
|
78
12
|
.flexibleHeight
|
|
79
13
|
]
|
|
80
14
|
}
|
|
81
15
|
didSet {
|
|
82
|
-
|
|
83
|
-
|
|
16
|
+
guard let playerView else {
|
|
17
|
+
return
|
|
84
18
|
}
|
|
19
|
+
addSubview(playerView)
|
|
20
|
+
maybeFixAVPlayerViewControllerVisibility()
|
|
21
|
+
if let fullscreenBridgeId {
|
|
22
|
+
attachFullscreenBridge(fullscreenBridgeId: fullscreenBridgeId)
|
|
23
|
+
}
|
|
24
|
+
if let scalingMode {
|
|
25
|
+
playerView.scalingMode = scalingMode
|
|
26
|
+
}
|
|
27
|
+
if let requestedFullscreenValue {
|
|
28
|
+
setFullscreenRequested(isFullscreen: requestedFullscreenValue)
|
|
29
|
+
}
|
|
30
|
+
if let requestedPictureInPictureValue {
|
|
31
|
+
setPictureInPicture(enterPictureInPicture: requestedPictureInPictureValue)
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
private var customMessageHandlerBridgeId: NativeId?
|
|
37
|
+
private var playerId: NativeId?
|
|
38
|
+
private var fullscreenBridgeId: NativeId?
|
|
39
|
+
private var scalingMode: ScalingMode?
|
|
40
|
+
private var requestedFullscreenValue: Bool?
|
|
41
|
+
private var requestedPictureInPictureValue: Bool?
|
|
42
|
+
private var avPlayerViewControllerTransitionForced = false
|
|
43
|
+
|
|
44
|
+
let onBmpEvent = EventDispatcher()
|
|
45
|
+
let onBmpPlayerActive = EventDispatcher()
|
|
46
|
+
let onBmpPlayerError = EventDispatcher()
|
|
47
|
+
let onBmpPlayerWarning = EventDispatcher()
|
|
48
|
+
let onBmpDestroy = EventDispatcher()
|
|
49
|
+
let onBmpMuted = EventDispatcher()
|
|
50
|
+
let onBmpUnmuted = EventDispatcher()
|
|
51
|
+
let onBmpReady = EventDispatcher()
|
|
52
|
+
let onBmpPaused = EventDispatcher()
|
|
53
|
+
let onBmpPlay = EventDispatcher()
|
|
54
|
+
let onBmpPlaying = EventDispatcher()
|
|
55
|
+
let onBmpPlaybackFinished = EventDispatcher()
|
|
56
|
+
let onBmpSeek = EventDispatcher()
|
|
57
|
+
let onBmpSeeked = EventDispatcher()
|
|
58
|
+
let onBmpTimeShift = EventDispatcher()
|
|
59
|
+
let onBmpTimeShifted = EventDispatcher()
|
|
60
|
+
let onBmpStallStarted = EventDispatcher()
|
|
61
|
+
let onBmpStallEnded = EventDispatcher()
|
|
62
|
+
let onBmpTimeChanged = EventDispatcher()
|
|
63
|
+
let onBmpSourceLoad = EventDispatcher()
|
|
64
|
+
let onBmpSourceLoaded = EventDispatcher()
|
|
65
|
+
let onBmpSourceUnloaded = EventDispatcher()
|
|
66
|
+
let onBmpSourceError = EventDispatcher()
|
|
67
|
+
let onBmpSourceWarning = EventDispatcher()
|
|
68
|
+
let onBmpAudioAdded = EventDispatcher()
|
|
69
|
+
let onBmpAudioRemoved = EventDispatcher()
|
|
70
|
+
let onBmpAudioChanged = EventDispatcher()
|
|
71
|
+
let onBmpSubtitleAdded = EventDispatcher()
|
|
72
|
+
let onBmpSubtitleRemoved = EventDispatcher()
|
|
73
|
+
let onBmpSubtitleChanged = EventDispatcher()
|
|
74
|
+
let onBmpDownloadFinished = EventDispatcher()
|
|
75
|
+
let onBmpPictureInPictureEnter = EventDispatcher()
|
|
76
|
+
let onBmpPictureInPictureEntered = EventDispatcher()
|
|
77
|
+
let onBmpPictureInPictureExit = EventDispatcher()
|
|
78
|
+
let onBmpPictureInPictureExited = EventDispatcher()
|
|
79
|
+
let onBmpAdBreakFinished = EventDispatcher()
|
|
80
|
+
let onBmpAdBreakStarted = EventDispatcher()
|
|
81
|
+
let onBmpAdClicked = EventDispatcher()
|
|
82
|
+
let onBmpAdError = EventDispatcher()
|
|
83
|
+
let onBmpAdFinished = EventDispatcher()
|
|
84
|
+
let onBmpAdManifestLoad = EventDispatcher()
|
|
85
|
+
let onBmpAdManifestLoaded = EventDispatcher()
|
|
86
|
+
let onBmpAdQuartile = EventDispatcher()
|
|
87
|
+
let onBmpAdScheduled = EventDispatcher()
|
|
88
|
+
let onBmpAdSkipped = EventDispatcher()
|
|
89
|
+
let onBmpAdStarted = EventDispatcher()
|
|
90
|
+
let onBmpVideoDownloadQualityChanged = EventDispatcher()
|
|
91
|
+
let onBmpVideoPlaybackQualityChanged = EventDispatcher()
|
|
92
|
+
let onBmpFullscreenEnabled = EventDispatcher()
|
|
93
|
+
let onBmpFullscreenDisabled = EventDispatcher()
|
|
94
|
+
let onBmpFullscreenEnter = EventDispatcher()
|
|
95
|
+
let onBmpFullscreenExit = EventDispatcher()
|
|
96
|
+
let onBmpCastAvailable = EventDispatcher()
|
|
97
|
+
let onBmpCastPaused = EventDispatcher()
|
|
98
|
+
let onBmpCastPlaybackFinished = EventDispatcher()
|
|
99
|
+
let onBmpCastPlaying = EventDispatcher()
|
|
100
|
+
let onBmpCastStarted = EventDispatcher()
|
|
101
|
+
let onBmpCastStart = EventDispatcher()
|
|
102
|
+
let onBmpCastStopped = EventDispatcher()
|
|
103
|
+
let onBmpCastTimeUpdated = EventDispatcher()
|
|
104
|
+
let onBmpCastWaitingForDevice = EventDispatcher()
|
|
105
|
+
let onBmpPictureInPictureAvailabilityChanged = EventDispatcher()
|
|
106
|
+
let onBmpPlaybackSpeedChanged = EventDispatcher()
|
|
107
|
+
let onBmpCueEnter = EventDispatcher()
|
|
108
|
+
let onBmpCueExit = EventDispatcher()
|
|
109
|
+
|
|
110
|
+
required init(appContext: AppContext? = nil) {
|
|
111
|
+
super.init(appContext: appContext)
|
|
112
|
+
clipsToBounds = true
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
override public func layoutSubviews() {
|
|
116
|
+
super.layoutSubviews()
|
|
117
|
+
maybeFixAVPlayerViewControllerVisibility()
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
internal func attachPlayer(
|
|
121
|
+
playerId: NativeId?,
|
|
122
|
+
playerViewConfigWrapper: RNPlayerViewConfig?,
|
|
123
|
+
customMessageHandlerBridgeId: NativeId?
|
|
124
|
+
) {
|
|
125
|
+
self.playerId = playerId
|
|
126
|
+
guard let playerId else {
|
|
127
|
+
playerView?.player?.remove(listener: self)
|
|
128
|
+
playerView?.player = nil
|
|
129
|
+
return
|
|
130
|
+
}
|
|
131
|
+
guard let player = self.appContext?.moduleRegistry.get(PlayerModule.self)?.retrieve(playerId) else {
|
|
132
|
+
return
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
if let userInterfaceConfig = maybeCreateUserInterfaceConfig(
|
|
136
|
+
styleConfig: player.config.styleConfig,
|
|
137
|
+
playerViewConfig: playerViewConfigWrapper,
|
|
138
|
+
customMessageHandlerBridgeId: customMessageHandlerBridgeId
|
|
139
|
+
) {
|
|
140
|
+
player.config.styleConfig.userInterfaceConfig = userInterfaceConfig
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
let previousPictureInPictureAvailableValue: Bool
|
|
144
|
+
if let playerView {
|
|
145
|
+
playerView.player = player
|
|
146
|
+
previousPictureInPictureAvailableValue = playerView.isPictureInPictureAvailable
|
|
147
|
+
} else {
|
|
148
|
+
self.playerView = PlayerView(
|
|
149
|
+
player: player,
|
|
150
|
+
frame: bounds,
|
|
151
|
+
playerViewConfig: playerViewConfigWrapper?.playerViewConfig ?? PlayerViewConfig()
|
|
152
|
+
)
|
|
153
|
+
previousPictureInPictureAvailableValue = false
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
player.add(listener: self)
|
|
157
|
+
playerView?.add(listener: self)
|
|
158
|
+
|
|
159
|
+
self.maybeEmitPictureInPictureAvailabilityEvent(
|
|
160
|
+
previousState: previousPictureInPictureAvailableValue
|
|
161
|
+
)
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
internal func attachFullscreenBridge(fullscreenBridgeId: NativeId) {
|
|
165
|
+
self.fullscreenBridgeId = fullscreenBridgeId
|
|
166
|
+
guard let fullscreenBridgeModule = self.appContext?.moduleRegistry.get(FullscreenHandlerModule.self),
|
|
167
|
+
let fullscreenBridge = fullscreenBridgeModule.retrieve(fullscreenBridgeId) else {
|
|
168
|
+
return
|
|
169
|
+
}
|
|
170
|
+
playerView?.fullscreenHandler = fullscreenBridge
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
internal func setFullscreenRequested(isFullscreen: Bool) {
|
|
174
|
+
guard let playerView else {
|
|
175
|
+
requestedFullscreenValue = isFullscreen
|
|
176
|
+
return
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
requestedFullscreenValue = nil
|
|
180
|
+
guard playerView.isFullscreen != isFullscreen else {
|
|
181
|
+
return
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
if isFullscreen {
|
|
185
|
+
playerView.enterFullscreen()
|
|
186
|
+
} else {
|
|
187
|
+
playerView.exitFullscreen()
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
internal func setPictureInPicture(enterPictureInPicture: Bool) {
|
|
192
|
+
guard let playerView else {
|
|
193
|
+
requestedPictureInPictureValue = enterPictureInPicture
|
|
194
|
+
return
|
|
195
|
+
}
|
|
196
|
+
requestedPictureInPictureValue = nil
|
|
197
|
+
guard playerView.isPictureInPicture != enterPictureInPicture else {
|
|
198
|
+
return
|
|
199
|
+
}
|
|
200
|
+
if enterPictureInPicture {
|
|
201
|
+
playerView.enterPictureInPicture()
|
|
202
|
+
} else {
|
|
203
|
+
playerView.exitPictureInPicture()
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
internal func setScalingMode(scalingMode: String?) {
|
|
208
|
+
switch scalingMode {
|
|
209
|
+
case "Zoom":
|
|
210
|
+
self.scalingMode = .zoom
|
|
211
|
+
case "Stretch":
|
|
212
|
+
self.scalingMode = .stretch
|
|
213
|
+
case "Fit":
|
|
214
|
+
self.scalingMode = .fit
|
|
215
|
+
default:
|
|
216
|
+
self.scalingMode = .fit
|
|
217
|
+
}
|
|
218
|
+
guard let playerView, let nativeScalingMode = self.scalingMode else {
|
|
219
|
+
return
|
|
220
|
+
}
|
|
221
|
+
playerView.scalingMode = nativeScalingMode
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
private extension RNPlayerView {
|
|
226
|
+
// Helper methods no longer needed - using EventDispatcher properties directly
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
private extension Event {
|
|
230
|
+
func eventPayload() -> [String: Any] {
|
|
231
|
+
guard let jsonConvertible = self as? JsonConvertible else {
|
|
232
|
+
return [:]
|
|
233
|
+
}
|
|
234
|
+
let anyHashableKeyedPayload = jsonConvertible.toJSON()
|
|
235
|
+
let stringKeyedPayload = anyHashableKeyedPayload.reduce(into: [String: Any]()) { result, pair in
|
|
236
|
+
if let key = pair.key as? String {
|
|
237
|
+
result[key] = pair.value
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
return stringKeyedPayload
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
extension RNPlayerView: PlayerListener {
|
|
245
|
+
public func onPlayerActive(_ event: PlayerActiveEvent, player: Player) {
|
|
246
|
+
onBmpPlayerActive(event.eventPayload())
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
public func onPlayerError(_ event: PlayerErrorEvent, player: Player) {
|
|
250
|
+
onBmpPlayerError(event.eventPayload())
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
public func onPlayerWarning(_ event: PlayerWarningEvent, player: Player) {
|
|
254
|
+
onBmpPlayerWarning(event.eventPayload())
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
public func onDestroy(_ event: DestroyEvent, player: Player) {
|
|
258
|
+
onBmpDestroy(event.eventPayload())
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
public func onMuted(_ event: MutedEvent, player: Player) {
|
|
262
|
+
onBmpMuted(event.eventPayload())
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
public func onUnmuted(_ event: UnmutedEvent, player: Player) {
|
|
266
|
+
onBmpUnmuted(event.eventPayload())
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
public func onReady(_ event: ReadyEvent, player: Player) {
|
|
270
|
+
onBmpReady(event.eventPayload())
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
public func onPaused(_ event: PausedEvent, player: Player) {
|
|
274
|
+
onBmpPaused(event.eventPayload())
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
public func onPlay(_ event: PlayEvent, player: Player) {
|
|
278
|
+
onBmpPlay(event.eventPayload())
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
public func onPlaying(_ event: PlayingEvent, player: Player) {
|
|
282
|
+
onBmpPlaying(event.eventPayload())
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
public func onPlaybackFinished(_ event: PlaybackFinishedEvent, player: Player) {
|
|
286
|
+
onBmpPlaybackFinished(event.eventPayload())
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
public func onSeek(_ event: SeekEvent, player: Player) {
|
|
290
|
+
onBmpSeek(event.eventPayload())
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
public func onSeeked(_ event: SeekedEvent, player: Player) {
|
|
294
|
+
onBmpSeeked(event.eventPayload())
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
public func onTimeShift(_ event: TimeShiftEvent, player: Player) {
|
|
298
|
+
onBmpTimeShift(event.eventPayload())
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
public func onTimeShifted(_ event: TimeShiftedEvent, player: Player) {
|
|
302
|
+
onBmpTimeShifted(event.eventPayload())
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
public func onStallStarted(_ event: StallStartedEvent, player: Player) {
|
|
306
|
+
onBmpStallStarted(event.eventPayload())
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
public func onStallEnded(_ event: StallEndedEvent, player: Player) {
|
|
310
|
+
onBmpStallEnded(event.eventPayload())
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
public func onTimeChanged(_ event: TimeChangedEvent, player: Player) {
|
|
314
|
+
onBmpTimeChanged(event.eventPayload())
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
public func onPlaybackSpeedChanged(_ event: PlaybackSpeedChangedEvent, player: Player) {
|
|
318
|
+
onBmpPlaybackSpeedChanged(event.eventPayload())
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
public func onSourceLoad(_ event: SourceLoadEvent, player: Player) {
|
|
322
|
+
onBmpSourceLoad(event.eventPayload())
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
public func onSourceLoaded(_ event: SourceLoadedEvent, player: Player) {
|
|
326
|
+
onBmpSourceLoaded(event.eventPayload())
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
public func onSourceUnloaded(_ event: SourceUnloadedEvent, player: Player) {
|
|
330
|
+
onBmpSourceUnloaded(event.eventPayload())
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
public func onSourceError(_ event: SourceErrorEvent, player: Player) {
|
|
334
|
+
onBmpSourceError(event.eventPayload())
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
public func onSourceWarning(_ event: SourceWarningEvent, player: Player) {
|
|
338
|
+
onBmpSourceWarning(event.eventPayload())
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
public func onAudioAdded(_ event: AudioAddedEvent, player: Player) {
|
|
342
|
+
onBmpAudioAdded(event.eventPayload())
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
public func onAudioRemoved(_ event: AudioRemovedEvent, player: Player) {
|
|
346
|
+
onBmpAudioRemoved(event.eventPayload())
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
public func onAudioChanged(_ event: AudioChangedEvent, player: Player) {
|
|
350
|
+
onBmpAudioChanged(event.eventPayload())
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
public func onSubtitleAdded(_ event: SubtitleAddedEvent, player: Player) {
|
|
354
|
+
onBmpSubtitleAdded(event.eventPayload())
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
public func onSubtitleRemoved(_ event: SubtitleRemovedEvent, player: Player) {
|
|
358
|
+
onBmpSubtitleRemoved(event.eventPayload())
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
public func onSubtitleChanged(_ event: SubtitleChangedEvent, player: Player) {
|
|
362
|
+
onBmpSubtitleChanged(event.eventPayload())
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
public func onDownloadFinished(_ event: DownloadFinishedEvent, player: Player) {
|
|
366
|
+
onBmpDownloadFinished(event.eventPayload())
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
public func onAdBreakFinished(_ event: AdBreakFinishedEvent, player: Player) {
|
|
370
|
+
onBmpAdBreakFinished(event.eventPayload())
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
public func onAdBreakStarted(_ event: AdBreakStartedEvent, player: Player) {
|
|
374
|
+
onBmpAdBreakStarted(event.eventPayload())
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
public func onAdClicked(_ event: AdClickedEvent, player: Player) {
|
|
378
|
+
onBmpAdClicked(event.eventPayload())
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
public func onAdError(_ event: AdErrorEvent, player: Player) {
|
|
382
|
+
onBmpAdError(event.eventPayload())
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
public func onAdFinished(_ event: AdFinishedEvent, player: Player) {
|
|
386
|
+
onBmpAdFinished(event.eventPayload())
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
public func onAdManifestLoad(_ event: AdManifestLoadEvent, player: Player) {
|
|
390
|
+
onBmpAdManifestLoad(event.eventPayload())
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
public func onAdManifestLoaded(_ event: AdManifestLoadedEvent, player: Player) {
|
|
394
|
+
onBmpAdManifestLoaded(event.eventPayload())
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
public func onAdQuartile(_ event: AdQuartileEvent, player: Player) {
|
|
398
|
+
onBmpAdQuartile(event.eventPayload())
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
public func onAdScheduled(_ event: AdScheduledEvent, player: Player) {
|
|
402
|
+
onBmpAdScheduled(event.eventPayload())
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
public func onAdSkipped(_ event: AdSkippedEvent, player: Player) {
|
|
406
|
+
onBmpAdSkipped(event.eventPayload())
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
public func onAdStarted(_ event: AdStartedEvent, player: Player) {
|
|
410
|
+
onBmpAdStarted(event.eventPayload())
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
public func onVideoDownloadQualityChanged(_ event: VideoDownloadQualityChangedEvent, player: Player) {
|
|
414
|
+
onBmpVideoDownloadQualityChanged(event.eventPayload())
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
public func onVideoPlaybackQualityChanged(_ event: VideoPlaybackQualityChangedEvent, player: Player) {
|
|
418
|
+
onBmpVideoPlaybackQualityChanged(event.eventPayload())
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
public func onCueEnter(_ event: CueEnterEvent, player: Player) {
|
|
422
|
+
onBmpCueEnter(event.eventPayload())
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
public func onCueExit(_ event: CueExitEvent, player: Player) {
|
|
426
|
+
onBmpCueExit(event.eventPayload())
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
#if os(iOS)
|
|
430
|
+
public func onCastAvailable(_ event: CastAvailableEvent, player: Player) {
|
|
431
|
+
onBmpCastAvailable(event.eventPayload())
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
public func onCastPaused(_ event: CastPausedEvent, player: Player) {
|
|
435
|
+
onBmpCastPaused(event.eventPayload())
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
public func onCastPlaybackFinished(_ event: CastPlaybackFinishedEvent, player: Player) {
|
|
439
|
+
onBmpCastPlaybackFinished(event.eventPayload())
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
public func onCastPlaying(_ event: CastPlayingEvent, player: Player) {
|
|
443
|
+
onBmpCastPlaying(event.eventPayload())
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
public func onCastStarted(_ event: CastStartedEvent, player: Player) {
|
|
447
|
+
onBmpCastStarted(event.eventPayload())
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
public func onCastStart(_ event: CastStartEvent, player: Player) {
|
|
451
|
+
onBmpCastStart(event.eventPayload())
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
public func onCastStopped(_ event: CastStoppedEvent, player: Player) {
|
|
455
|
+
onBmpCastStopped(event.eventPayload())
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
public func onCastTimeUpdated(_ event: CastTimeUpdatedEvent, player: Player) {
|
|
459
|
+
onBmpCastTimeUpdated(event.eventPayload())
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
public func onCastWaiting(forDevice event: CastWaitingForDeviceEvent, player: Player) {
|
|
463
|
+
onBmpCastWaitingForDevice(event.eventPayload())
|
|
464
|
+
}
|
|
465
|
+
#endif
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
extension RNPlayerView: UserInterfaceListener {
|
|
469
|
+
public func onPictureInPictureEnter(_ event: PictureInPictureEnterEvent, view: PlayerView) {
|
|
470
|
+
onBmpPictureInPictureEnter(event.eventPayload())
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
public func onPictureInPictureEntered(_ event: PictureInPictureEnteredEvent, view: PlayerView) {
|
|
474
|
+
onBmpPictureInPictureEntered(event.eventPayload())
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
public func onPictureInPictureExit(_ event: PictureInPictureExitEvent, view: PlayerView) {
|
|
478
|
+
onBmpPictureInPictureExit(event.eventPayload())
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
public func onPictureInPictureExited(_ event: PictureInPictureExitedEvent, view: PlayerView) {
|
|
482
|
+
onBmpPictureInPictureExited(event.eventPayload())
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
public func onFullscreenEnter(_ event: FullscreenEnterEvent, view: PlayerView) {
|
|
486
|
+
onBmpFullscreenEnter(event.eventPayload())
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
public func onFullscreenExit(_ event: FullscreenExitEvent, view: PlayerView) {
|
|
490
|
+
onBmpFullscreenExit(event.eventPayload())
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
public func onFullscreenEnabled(_ event: FullscreenEnabledEvent, view: PlayerView) {
|
|
494
|
+
onBmpFullscreenEnabled(event.eventPayload())
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
public func onFullscreenDisabled(_ event: FullscreenDisabledEvent, view: PlayerView) {
|
|
498
|
+
onBmpFullscreenDisabled(event.eventPayload())
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
public func onEvent(_ event: any Event, player: any Player) {
|
|
502
|
+
onBmpEvent(event.eventPayload())
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
private extension RNPlayerView {
|
|
507
|
+
/// This method is used to fix the visibility issue of `AVPlayerViewController` when it is presented on iOS 17
|
|
508
|
+
/// or earlier when using the new architecture.
|
|
509
|
+
func maybeFixAVPlayerViewControllerVisibility() {
|
|
510
|
+
#if RCT_NEW_ARCH_ENABLED
|
|
511
|
+
guard !avPlayerViewControllerTransitionForced,
|
|
512
|
+
let avPlayerViewController = AVPlayerViewController.findAVPlayerViewController(in: window) else {
|
|
513
|
+
return
|
|
514
|
+
}
|
|
515
|
+
avPlayerViewControllerTransitionForced = true
|
|
516
|
+
avPlayerViewController.beginAppearanceTransition(true, animated: false)
|
|
517
|
+
avPlayerViewController.endAppearanceTransition()
|
|
518
|
+
#endif
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
func maybeCreateUserInterfaceConfig(
|
|
522
|
+
styleConfig: StyleConfig,
|
|
523
|
+
playerViewConfig: RNPlayerViewConfig?,
|
|
524
|
+
customMessageHandlerBridgeId: NativeId?
|
|
525
|
+
) -> UserInterfaceConfig? {
|
|
526
|
+
#if os(iOS)
|
|
527
|
+
if styleConfig.userInterfaceType == .bitmovin {
|
|
528
|
+
let bitmovinUserInterfaceConfig = styleConfig
|
|
529
|
+
.userInterfaceConfig as? BitmovinUserInterfaceConfig ?? BitmovinUserInterfaceConfig()
|
|
530
|
+
|
|
531
|
+
if let uiConfig = playerViewConfig?.uiConfig {
|
|
532
|
+
bitmovinUserInterfaceConfig
|
|
533
|
+
.playbackSpeedSelectionEnabled = uiConfig.playbackSpeedSelectionEnabled
|
|
534
|
+
bitmovinUserInterfaceConfig.uiManagerFactoryFunction = uiConfig.uiManagerFactoryFunction
|
|
535
|
+
}
|
|
536
|
+
if let hideFirstFrame = playerViewConfig?.hideFirstFrame {
|
|
537
|
+
bitmovinUserInterfaceConfig.hideFirstFrame = hideFirstFrame
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
if let customMessageHandlerBridgeId {
|
|
541
|
+
attachCustomMessageHandlerBridge(id: customMessageHandlerBridgeId, to: bitmovinUserInterfaceConfig)
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
return bitmovinUserInterfaceConfig
|
|
545
|
+
}
|
|
546
|
+
#endif
|
|
547
|
+
if styleConfig.userInterfaceType == .system {
|
|
548
|
+
let systemUserInterfaceConfig = styleConfig
|
|
549
|
+
.userInterfaceConfig as? SystemUserInterfaceConfig ?? SystemUserInterfaceConfig()
|
|
550
|
+
|
|
551
|
+
if let hideFirstFrame = playerViewConfig?.hideFirstFrame {
|
|
552
|
+
systemUserInterfaceConfig.hideFirstFrame = hideFirstFrame
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
return systemUserInterfaceConfig
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
return nil
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
func attachCustomMessageHandlerBridge(
|
|
562
|
+
id customMessageHandlerBridgeId: NativeId,
|
|
563
|
+
to bitmovinUserInterfaceConfig: BitmovinUserInterfaceConfig
|
|
564
|
+
) {
|
|
565
|
+
guard let customMessageHandlerBridgeModule = self.appContext?.moduleRegistry
|
|
566
|
+
.get(CustomMessageHandlerModule.self) else {
|
|
567
|
+
return
|
|
85
568
|
}
|
|
569
|
+
guard let customMessageHandlerBridge = customMessageHandlerBridgeModule
|
|
570
|
+
.retrieve(customMessageHandlerBridgeId) else {
|
|
571
|
+
return
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
bitmovinUserInterfaceConfig.customMessageHandler = customMessageHandlerBridge.customMessageHandler
|
|
86
575
|
}
|
|
87
576
|
|
|
88
|
-
|
|
89
|
-
|
|
577
|
+
@MainActor
|
|
578
|
+
func maybeEmitPictureInPictureAvailabilityEvent(previousState: Bool) {
|
|
579
|
+
guard let playerView, playerView.isPictureInPictureAvailable != previousState else {
|
|
580
|
+
return
|
|
581
|
+
}
|
|
582
|
+
let event: [String: Any] = [
|
|
583
|
+
"isPictureInPictureAvailable": playerView.isPictureInPictureAvailable,
|
|
584
|
+
"name": "onPictureInPictureAvailabilityChanged",
|
|
585
|
+
"timestamp": Date().timeIntervalSince1970
|
|
586
|
+
]
|
|
587
|
+
|
|
588
|
+
onBmpPictureInPictureAvailabilityChanged(event)
|
|
90
589
|
}
|
|
590
|
+
}
|
|
91
591
|
|
|
92
|
-
|
|
93
|
-
|
|
592
|
+
private extension UIViewController {
|
|
593
|
+
func findChildViewController(matching check: (UIViewController) -> Bool) -> UIViewController? {
|
|
594
|
+
if check(self) {
|
|
595
|
+
return self
|
|
596
|
+
}
|
|
597
|
+
for child in children {
|
|
598
|
+
if check(child) {
|
|
599
|
+
return child
|
|
600
|
+
}
|
|
601
|
+
if let found = child.findChildViewController(matching: check) {
|
|
602
|
+
return found
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
return nil
|
|
606
|
+
}
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
private extension AVPlayerViewController {
|
|
610
|
+
static func findAVPlayerViewController(in window: UIWindow?) -> AVPlayerViewController? {
|
|
611
|
+
guard let avPlayerViewController = window?
|
|
612
|
+
.rootViewController?
|
|
613
|
+
.findChildViewController(matching: { $0 is AVPlayerViewController }) as? AVPlayerViewController else {
|
|
614
|
+
return nil
|
|
615
|
+
}
|
|
616
|
+
return avPlayerViewController
|
|
94
617
|
}
|
|
95
618
|
}
|