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
|
@@ -1,628 +1,352 @@
|
|
|
1
1
|
package com.bitmovin.player.reactnative
|
|
2
2
|
|
|
3
|
-
import android.util.Log
|
|
4
3
|
import com.bitmovin.analytics.api.DefaultMetadata
|
|
5
4
|
import com.bitmovin.player.api.Player
|
|
6
5
|
import com.bitmovin.player.api.PlayerConfig
|
|
7
6
|
import com.bitmovin.player.api.analytics.create
|
|
8
|
-
import com.bitmovin.player.api.event.PlayerEvent
|
|
9
7
|
import com.bitmovin.player.reactnative.converter.toAdItem
|
|
10
8
|
import com.bitmovin.player.reactnative.converter.toAnalyticsConfig
|
|
11
9
|
import com.bitmovin.player.reactnative.converter.toAnalyticsDefaultMetadata
|
|
12
10
|
import com.bitmovin.player.reactnative.converter.toJson
|
|
13
11
|
import com.bitmovin.player.reactnative.converter.toMediaControlConfig
|
|
14
12
|
import com.bitmovin.player.reactnative.converter.toPlayerConfig
|
|
15
|
-
import com.bitmovin.player.reactnative.extensions.
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
13
|
+
import com.bitmovin.player.reactnative.extensions.getMap
|
|
14
|
+
import expo.modules.kotlin.functions.Queues
|
|
15
|
+
import expo.modules.kotlin.modules.Module
|
|
16
|
+
import expo.modules.kotlin.modules.ModuleDefinition
|
|
19
17
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
@ReactModule(name = MODULE_NAME)
|
|
23
|
-
class PlayerModule(context: ReactApplicationContext) : BitmovinBaseModule(context) {
|
|
18
|
+
class PlayerModule : Module() {
|
|
24
19
|
/**
|
|
25
20
|
* In-memory mapping from [NativeId]s to [Player] instances.
|
|
21
|
+
* This must match the Registry pattern from legacy PlayerModule
|
|
26
22
|
*/
|
|
27
23
|
private val players: Registry<Player> = mutableMapOf()
|
|
28
24
|
|
|
29
|
-
val mediaSessionPlaybackManager
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* JS exported module name.
|
|
33
|
-
*/
|
|
34
|
-
override fun getName() = MODULE_NAME
|
|
25
|
+
val mediaSessionPlaybackManager by lazy { MediaSessionPlaybackManager(appContext) }
|
|
35
26
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
*/
|
|
39
|
-
fun getPlayerOrNull(nativeId: NativeId): Player? = players[nativeId]
|
|
27
|
+
override fun definition() = ModuleDefinition {
|
|
28
|
+
Name("PlayerModule")
|
|
40
29
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
*/
|
|
45
|
-
@ReactMethod
|
|
46
|
-
fun initWithConfig(
|
|
47
|
-
nativeId: NativeId,
|
|
48
|
-
config: ReadableMap?,
|
|
49
|
-
networkNativeId: NativeId?,
|
|
50
|
-
decoderNativeId: NativeId?,
|
|
51
|
-
promise: Promise,
|
|
52
|
-
) {
|
|
53
|
-
init(
|
|
54
|
-
nativeId,
|
|
55
|
-
config,
|
|
56
|
-
networkNativeId = networkNativeId,
|
|
57
|
-
decoderNativeId = decoderNativeId,
|
|
58
|
-
analyticsConfigJson = null,
|
|
59
|
-
promise,
|
|
60
|
-
)
|
|
61
|
-
}
|
|
30
|
+
OnCreate {
|
|
31
|
+
// Module initialization
|
|
32
|
+
}
|
|
62
33
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
playerConfigJson: ReadableMap?,
|
|
72
|
-
networkNativeId: NativeId?,
|
|
73
|
-
decoderNativeId: NativeId?,
|
|
74
|
-
analyticsConfigJson: ReadableMap,
|
|
75
|
-
promise: Promise,
|
|
76
|
-
) = init(
|
|
77
|
-
nativeId,
|
|
78
|
-
playerConfigJson,
|
|
79
|
-
networkNativeId,
|
|
80
|
-
decoderNativeId,
|
|
81
|
-
analyticsConfigJson,
|
|
82
|
-
promise,
|
|
83
|
-
)
|
|
84
|
-
|
|
85
|
-
private fun init(
|
|
86
|
-
nativeId: NativeId,
|
|
87
|
-
playerConfigJson: ReadableMap?,
|
|
88
|
-
networkNativeId: NativeId?,
|
|
89
|
-
decoderNativeId: NativeId?,
|
|
90
|
-
analyticsConfigJson: ReadableMap?,
|
|
91
|
-
promise: Promise,
|
|
92
|
-
) = promise.unit.resolveOnUiThread {
|
|
93
|
-
if (players.containsKey(nativeId)) {
|
|
94
|
-
if (playerConfigJson != null || analyticsConfigJson != null) {
|
|
95
|
-
Log.w("BitmovinPlayerModule", "Cannot reconfigure an existing player")
|
|
34
|
+
OnDestroy {
|
|
35
|
+
// Clean up all players when module is destroyed
|
|
36
|
+
players.values.forEach { player ->
|
|
37
|
+
try {
|
|
38
|
+
player.destroy()
|
|
39
|
+
} catch (e: Exception) {
|
|
40
|
+
// Log but don't crash on cleanup
|
|
41
|
+
}
|
|
96
42
|
}
|
|
97
|
-
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
43
|
+
players.clear()
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
AsyncFunction("play") { nativeId: NativeId ->
|
|
47
|
+
val player = players[nativeId]
|
|
48
|
+
player?.play()
|
|
49
|
+
}.runOnQueue(Queues.MAIN)
|
|
50
|
+
|
|
51
|
+
AsyncFunction("pause") { nativeId: NativeId ->
|
|
52
|
+
val player = players[nativeId]
|
|
53
|
+
player?.pause()
|
|
54
|
+
}.runOnQueue(Queues.MAIN)
|
|
55
|
+
|
|
56
|
+
AsyncFunction("mute") { nativeId: NativeId ->
|
|
57
|
+
val player = players[nativeId]
|
|
58
|
+
player?.mute()
|
|
59
|
+
}.runOnQueue(Queues.MAIN)
|
|
60
|
+
|
|
61
|
+
AsyncFunction("unmute") { nativeId: NativeId ->
|
|
62
|
+
val player = players[nativeId]
|
|
63
|
+
player?.unmute()
|
|
64
|
+
}.runOnQueue(Queues.MAIN)
|
|
65
|
+
|
|
66
|
+
AsyncFunction("seek") { nativeId: NativeId, time: Double ->
|
|
67
|
+
val player = players[nativeId]
|
|
68
|
+
player?.seek(time)
|
|
69
|
+
}.runOnQueue(Queues.MAIN)
|
|
70
|
+
|
|
71
|
+
AsyncFunction("timeShift") { nativeId: NativeId, offset: Double ->
|
|
72
|
+
val player = players[nativeId]
|
|
73
|
+
player?.timeShift(offset)
|
|
74
|
+
}.runOnQueue(Queues.MAIN)
|
|
75
|
+
|
|
76
|
+
AsyncFunction("destroy") { nativeId: NativeId ->
|
|
77
|
+
val player = players[nativeId]
|
|
78
|
+
if (player != null) {
|
|
79
|
+
// Note: MediaSession cleanup would need to be handled here
|
|
80
|
+
// For now, just destroy the player and remove from registry
|
|
81
|
+
player.destroy()
|
|
82
|
+
players.remove(nativeId)
|
|
83
|
+
}
|
|
84
|
+
}.runOnQueue(Queues.MAIN)
|
|
104
85
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
}
|
|
86
|
+
AsyncFunction("setVolume") { nativeId: NativeId, volume: Double ->
|
|
87
|
+
val player = players[nativeId]
|
|
88
|
+
player?.volume = volume.toInt()
|
|
89
|
+
}.runOnQueue(Queues.MAIN)
|
|
109
90
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
91
|
+
AsyncFunction("getVolume") { nativeId: NativeId ->
|
|
92
|
+
val player = players[nativeId]
|
|
93
|
+
return@AsyncFunction player?.volume?.toDouble()
|
|
113
94
|
}
|
|
114
95
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
)
|
|
96
|
+
AsyncFunction("currentTime") { nativeId: NativeId, mode: String? ->
|
|
97
|
+
val player = players[nativeId]
|
|
98
|
+
return@AsyncFunction when {
|
|
99
|
+
player == null -> null
|
|
100
|
+
mode == "relative" -> player.currentTime + player.playbackTimeOffsetToRelativeTime
|
|
101
|
+
mode == "absolute" -> player.currentTime + player.playbackTimeOffsetToAbsoluteTime
|
|
102
|
+
else -> player.currentTime
|
|
103
|
+
}
|
|
124
104
|
}
|
|
125
105
|
|
|
126
|
-
|
|
127
|
-
|
|
106
|
+
AsyncFunction("isPlaying") { nativeId: NativeId ->
|
|
107
|
+
val player = players[nativeId]
|
|
108
|
+
return@AsyncFunction player?.isPlaying
|
|
128
109
|
}
|
|
129
|
-
}
|
|
130
110
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
* @param sourceNativeId Target source.
|
|
135
|
-
*/
|
|
136
|
-
@ReactMethod
|
|
137
|
-
fun loadSource(nativeId: NativeId, sourceNativeId: String, promise: Promise) {
|
|
138
|
-
promise.unit.resolveOnUiThread {
|
|
139
|
-
getPlayer(nativeId, this@PlayerModule).load(getSource(sourceNativeId))
|
|
111
|
+
AsyncFunction("isPaused") { nativeId: NativeId ->
|
|
112
|
+
val player = players[nativeId]
|
|
113
|
+
return@AsyncFunction player?.isPaused
|
|
140
114
|
}
|
|
141
|
-
}
|
|
142
115
|
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
* @param offlineContentManagerBridgeId Target offline module.
|
|
147
|
-
* @param options Source configuration options from JS.
|
|
148
|
-
*/
|
|
149
|
-
@ReactMethod
|
|
150
|
-
fun loadOfflineContent(
|
|
151
|
-
nativeId: NativeId,
|
|
152
|
-
offlineContentManagerBridgeId: String,
|
|
153
|
-
options: ReadableMap?,
|
|
154
|
-
promise: Promise,
|
|
155
|
-
) {
|
|
156
|
-
promise.unit.resolveOnUiThread {
|
|
157
|
-
offlineModule
|
|
158
|
-
.getOfflineContentManagerBridgeOrNull(offlineContentManagerBridgeId)
|
|
159
|
-
?.offlineContentManager
|
|
160
|
-
?.offlineSourceConfig
|
|
161
|
-
?.let { getPlayer(nativeId).load(it) }
|
|
116
|
+
AsyncFunction("duration") { nativeId: NativeId ->
|
|
117
|
+
val player = players[nativeId]
|
|
118
|
+
return@AsyncFunction player?.duration
|
|
162
119
|
}
|
|
163
|
-
}
|
|
164
120
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
*/
|
|
169
|
-
@ReactMethod
|
|
170
|
-
fun unload(nativeId: NativeId, promise: Promise) {
|
|
171
|
-
promise.unit.resolveOnUiThreadWithPlayer(nativeId) {
|
|
172
|
-
unload()
|
|
121
|
+
AsyncFunction("isMuted") { nativeId: NativeId ->
|
|
122
|
+
val player = players[nativeId]
|
|
123
|
+
return@AsyncFunction player?.isMuted
|
|
173
124
|
}
|
|
174
|
-
}
|
|
175
125
|
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
@ReactMethod
|
|
181
|
-
fun play(nativeId: NativeId, promise: Promise) {
|
|
182
|
-
promise.unit.resolveOnUiThreadWithPlayer(nativeId) {
|
|
183
|
-
play()
|
|
184
|
-
}
|
|
185
|
-
}
|
|
126
|
+
AsyncFunction("unload") { nativeId: NativeId ->
|
|
127
|
+
val player = players[nativeId]
|
|
128
|
+
player?.unload()
|
|
129
|
+
}.runOnQueue(Queues.MAIN)
|
|
186
130
|
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
*/
|
|
191
|
-
@ReactMethod
|
|
192
|
-
fun pause(nativeId: NativeId, promise: Promise) {
|
|
193
|
-
promise.unit.resolveOnUiThreadWithPlayer(nativeId) {
|
|
194
|
-
pause()
|
|
131
|
+
AsyncFunction("getTimeShift") { nativeId: NativeId ->
|
|
132
|
+
val player = players[nativeId]
|
|
133
|
+
return@AsyncFunction player?.timeShift
|
|
195
134
|
}
|
|
196
|
-
}
|
|
197
135
|
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
* @param time Seek time in seconds.
|
|
202
|
-
*/
|
|
203
|
-
@ReactMethod
|
|
204
|
-
fun seek(nativeId: NativeId, time: Double, promise: Promise) {
|
|
205
|
-
promise.unit.resolveOnUiThreadWithPlayer(nativeId) {
|
|
206
|
-
seek(time)
|
|
136
|
+
AsyncFunction("isLive") { nativeId: NativeId ->
|
|
137
|
+
val player = players[nativeId]
|
|
138
|
+
return@AsyncFunction player?.isLive
|
|
207
139
|
}
|
|
208
|
-
}
|
|
209
140
|
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
* @param offset Offset time in seconds.
|
|
214
|
-
*/
|
|
215
|
-
@ReactMethod
|
|
216
|
-
fun timeShift(nativeId: NativeId, offset: Double, promise: Promise) {
|
|
217
|
-
promise.unit.resolveOnUiThreadWithPlayer(nativeId) {
|
|
218
|
-
timeShift(offset)
|
|
141
|
+
AsyncFunction("getMaxTimeShift") { nativeId: NativeId ->
|
|
142
|
+
val player = players[nativeId]
|
|
143
|
+
return@AsyncFunction player?.maxTimeShift
|
|
219
144
|
}
|
|
220
|
-
}
|
|
221
145
|
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
*/
|
|
226
|
-
@ReactMethod
|
|
227
|
-
fun mute(nativeId: NativeId, promise: Promise) {
|
|
228
|
-
promise.unit.resolveOnUiThreadWithPlayer(nativeId) {
|
|
229
|
-
mute()
|
|
146
|
+
AsyncFunction("getPlaybackSpeed") { nativeId: NativeId ->
|
|
147
|
+
val player = players[nativeId]
|
|
148
|
+
return@AsyncFunction player?.playbackSpeed?.toDouble()
|
|
230
149
|
}
|
|
231
|
-
}
|
|
232
150
|
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
@ReactMethod
|
|
238
|
-
fun unmute(nativeId: NativeId, promise: Promise) {
|
|
239
|
-
promise.unit.resolveOnUiThreadWithPlayer(nativeId) {
|
|
240
|
-
unmute()
|
|
241
|
-
}
|
|
242
|
-
}
|
|
151
|
+
AsyncFunction("setPlaybackSpeed") { nativeId: NativeId, playbackSpeed: Double ->
|
|
152
|
+
val player = players[nativeId]
|
|
153
|
+
player?.playbackSpeed = playbackSpeed.toFloat()
|
|
154
|
+
}.runOnQueue(Queues.MAIN)
|
|
243
155
|
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
*/
|
|
248
|
-
@ReactMethod
|
|
249
|
-
fun destroy(nativeId: NativeId, promise: Promise) {
|
|
250
|
-
mediaSessionPlaybackManager.destroy(nativeId)
|
|
251
|
-
promise.unit.resolveOnUiThreadWithPlayer(nativeId) {
|
|
252
|
-
destroy()
|
|
253
|
-
players.remove(nativeId)
|
|
156
|
+
AsyncFunction("isAd") { nativeId: NativeId ->
|
|
157
|
+
val player = players[nativeId]
|
|
158
|
+
return@AsyncFunction player?.isAd
|
|
254
159
|
}
|
|
255
|
-
}
|
|
256
160
|
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
*/
|
|
262
|
-
@ReactMethod
|
|
263
|
-
fun setVolume(nativeId: NativeId, volume: Int, promise: Promise) {
|
|
264
|
-
promise.unit.resolveOnUiThreadWithPlayer(nativeId) {
|
|
265
|
-
this.volume = volume
|
|
266
|
-
}
|
|
267
|
-
}
|
|
161
|
+
AsyncFunction("setMaxSelectableBitrate") { nativeId: NativeId, maxBitrate: Double ->
|
|
162
|
+
val player = players[nativeId]
|
|
163
|
+
player?.setMaxSelectableVideoBitrate(maxBitrate.toInt())
|
|
164
|
+
}.runOnQueue(Queues.MAIN)
|
|
268
165
|
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
* @param promise JS promise object.
|
|
273
|
-
*/
|
|
274
|
-
@ReactMethod
|
|
275
|
-
fun getVolume(nativeId: NativeId, promise: Promise) {
|
|
276
|
-
promise.int.resolveOnUiThreadWithPlayer(nativeId) {
|
|
277
|
-
volume
|
|
166
|
+
AsyncFunction("isAirPlayActive") { _: String ->
|
|
167
|
+
// AirPlay is iOS-only, return null on Android
|
|
168
|
+
false
|
|
278
169
|
}
|
|
279
|
-
}
|
|
280
170
|
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
* @param promise JS promise object.
|
|
285
|
-
*/
|
|
286
|
-
@ReactMethod
|
|
287
|
-
fun source(nativeId: NativeId, promise: Promise) {
|
|
288
|
-
promise.map.nullable.resolveOnUiThreadWithPlayer(nativeId) {
|
|
289
|
-
source?.toJson()
|
|
171
|
+
AsyncFunction("isAirPlayAvailable") { _: String ->
|
|
172
|
+
// AirPlay is iOS-only, return null on Android
|
|
173
|
+
false
|
|
290
174
|
}
|
|
291
|
-
}
|
|
292
175
|
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
* @param promise JS promise object.
|
|
297
|
-
*/
|
|
298
|
-
@ReactMethod
|
|
299
|
-
fun currentTime(nativeId: NativeId, mode: String?, promise: Promise) {
|
|
300
|
-
promise.double.resolveOnUiThreadWithPlayer(nativeId) {
|
|
301
|
-
currentTime + when (mode) {
|
|
302
|
-
"relative" -> playbackTimeOffsetToRelativeTime
|
|
303
|
-
"absolute" -> playbackTimeOffsetToAbsoluteTime
|
|
304
|
-
else -> throw InvalidParameterException("Unknown mode $mode")
|
|
305
|
-
}
|
|
176
|
+
AsyncFunction("isCastAvailable") { nativeId: NativeId ->
|
|
177
|
+
val player = players[nativeId]
|
|
178
|
+
return@AsyncFunction player?.isCastAvailable
|
|
306
179
|
}
|
|
307
|
-
}
|
|
308
180
|
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
* @param promise JS promise object.
|
|
313
|
-
*/
|
|
314
|
-
@ReactMethod
|
|
315
|
-
fun duration(nativeId: NativeId, promise: Promise) {
|
|
316
|
-
promise.double.resolveOnUiThreadWithPlayer(nativeId) {
|
|
317
|
-
duration
|
|
181
|
+
AsyncFunction("isCasting") { nativeId: NativeId ->
|
|
182
|
+
val player = players[nativeId]
|
|
183
|
+
return@AsyncFunction player?.isCasting
|
|
318
184
|
}
|
|
319
|
-
}
|
|
320
185
|
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
*/
|
|
326
|
-
@ReactMethod
|
|
327
|
-
fun isMuted(nativeId: NativeId, promise: Promise) {
|
|
328
|
-
promise.bool.resolveOnUiThreadWithPlayer(nativeId) {
|
|
329
|
-
isMuted
|
|
330
|
-
}
|
|
331
|
-
}
|
|
186
|
+
AsyncFunction("castVideo") { nativeId: NativeId ->
|
|
187
|
+
val player = players[nativeId]
|
|
188
|
+
player?.castVideo()
|
|
189
|
+
}.runOnQueue(Queues.MAIN)
|
|
332
190
|
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
*/
|
|
338
|
-
@ReactMethod
|
|
339
|
-
fun isPlaying(nativeId: NativeId, promise: Promise) {
|
|
340
|
-
promise.bool.resolveOnUiThreadWithPlayer(nativeId) {
|
|
341
|
-
isPlaying
|
|
342
|
-
}
|
|
343
|
-
}
|
|
191
|
+
AsyncFunction("castStop") { nativeId: NativeId ->
|
|
192
|
+
val player = players[nativeId]
|
|
193
|
+
player?.castStop()
|
|
194
|
+
}.runOnQueue(Queues.MAIN)
|
|
344
195
|
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
*/
|
|
350
|
-
@ReactMethod
|
|
351
|
-
fun isPaused(nativeId: NativeId, promise: Promise) {
|
|
352
|
-
promise.bool.resolveOnUiThreadWithPlayer(nativeId) {
|
|
353
|
-
isPaused
|
|
354
|
-
}
|
|
355
|
-
}
|
|
196
|
+
AsyncFunction("skipAd") { nativeId: NativeId ->
|
|
197
|
+
val player = players[nativeId]
|
|
198
|
+
player?.skipAd()
|
|
199
|
+
}.runOnQueue(Queues.MAIN)
|
|
356
200
|
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
* @param promise JS promise object.
|
|
361
|
-
*/
|
|
362
|
-
@ReactMethod
|
|
363
|
-
fun isLive(nativeId: NativeId, promise: Promise) {
|
|
364
|
-
promise.bool.resolveOnUiThreadWithPlayer(nativeId) {
|
|
365
|
-
isLive
|
|
201
|
+
AsyncFunction("canPlayAtPlaybackSpeed") { _: String, _: Double ->
|
|
202
|
+
// This method is iOS-only, return false on Android
|
|
203
|
+
false
|
|
366
204
|
}
|
|
367
|
-
}
|
|
368
205
|
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
* @param promise JS promise object.
|
|
373
|
-
*/
|
|
374
|
-
@ReactMethod
|
|
375
|
-
fun getAudioTrack(nativeId: NativeId, promise: Promise) {
|
|
376
|
-
promise.map.nullable.resolveOnUiThreadWithPlayer(nativeId) {
|
|
377
|
-
source?.selectedAudioTrack?.toJson()
|
|
206
|
+
AsyncFunction("getAudioTrack") { nativeId: NativeId ->
|
|
207
|
+
val player = players[nativeId]
|
|
208
|
+
return@AsyncFunction player?.source?.selectedAudioTrack?.toJson()
|
|
378
209
|
}
|
|
379
|
-
}
|
|
380
210
|
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
* @param promise JS promise object.
|
|
385
|
-
*/
|
|
386
|
-
@ReactMethod
|
|
387
|
-
fun getAvailableAudioTracks(nativeId: NativeId, promise: Promise) {
|
|
388
|
-
promise.array.resolveOnUiThreadWithPlayer(nativeId) {
|
|
389
|
-
source?.availableAudioTracks?.mapToReactArray { it.toJson() } ?: Arguments.createArray()
|
|
211
|
+
AsyncFunction("getAvailableAudioTracks") { nativeId: NativeId ->
|
|
212
|
+
val player = players[nativeId]
|
|
213
|
+
return@AsyncFunction player?.source?.availableAudioTracks?.map { it.toJson() } ?: emptyList()
|
|
390
214
|
}
|
|
391
|
-
}
|
|
392
215
|
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
* @param promise JS promise object.
|
|
398
|
-
*/
|
|
399
|
-
@ReactMethod
|
|
400
|
-
fun setAudioTrack(nativeId: NativeId, trackIdentifier: String, promise: Promise) {
|
|
401
|
-
promise.unit.resolveOnUiThreadWithPlayer(nativeId) {
|
|
402
|
-
source?.setAudioTrack(trackIdentifier)
|
|
403
|
-
}
|
|
404
|
-
}
|
|
216
|
+
AsyncFunction("setAudioTrack") { nativeId: NativeId, trackIdentifier: String ->
|
|
217
|
+
val player = players[nativeId]
|
|
218
|
+
player?.source?.setAudioTrack(trackIdentifier)
|
|
219
|
+
}.runOnQueue(Queues.MAIN)
|
|
405
220
|
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
* @param promise JS promise object.
|
|
410
|
-
*/
|
|
411
|
-
@ReactMethod
|
|
412
|
-
fun getSubtitleTrack(nativeId: NativeId, promise: Promise) {
|
|
413
|
-
promise.map.nullable.resolveOnUiThreadWithPlayer(nativeId) {
|
|
414
|
-
source?.selectedSubtitleTrack?.toJson()
|
|
221
|
+
AsyncFunction("getSubtitleTrack") { nativeId: NativeId ->
|
|
222
|
+
val player = players[nativeId]
|
|
223
|
+
return@AsyncFunction player?.source?.selectedSubtitleTrack?.toJson()
|
|
415
224
|
}
|
|
416
|
-
}
|
|
417
225
|
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
* @param promise JS promise object.
|
|
422
|
-
*/
|
|
423
|
-
@ReactMethod
|
|
424
|
-
fun getAvailableSubtitles(nativeId: NativeId, promise: Promise) {
|
|
425
|
-
promise.array.resolveOnUiThreadWithPlayer(nativeId) {
|
|
426
|
-
source?.availableSubtitleTracks?.mapToReactArray { it.toJson() } ?: Arguments.createArray()
|
|
226
|
+
AsyncFunction("getAvailableSubtitles") { nativeId: NativeId ->
|
|
227
|
+
val player = players[nativeId]
|
|
228
|
+
return@AsyncFunction player?.source?.availableSubtitleTracks?.map { it.toJson() } ?: emptyList()
|
|
427
229
|
}
|
|
428
|
-
}
|
|
429
230
|
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
* @param promise JS promise object.
|
|
435
|
-
*/
|
|
436
|
-
@ReactMethod
|
|
437
|
-
fun setSubtitleTrack(nativeId: NativeId, trackIdentifier: String?, promise: Promise) {
|
|
438
|
-
promise.unit.resolveOnUiThreadWithPlayer(nativeId) {
|
|
439
|
-
source?.setSubtitleTrack(trackIdentifier)
|
|
440
|
-
}
|
|
441
|
-
}
|
|
231
|
+
AsyncFunction("setSubtitleTrack") { nativeId: NativeId, trackIdentifier: String? ->
|
|
232
|
+
val player = players[nativeId]
|
|
233
|
+
player?.source?.setSubtitleTrack(trackIdentifier)
|
|
234
|
+
}.runOnQueue(Queues.MAIN)
|
|
442
235
|
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
* @param adItemJson Json representation of the `AdItem` to be scheduled.
|
|
447
|
-
*/
|
|
448
|
-
@ReactMethod
|
|
449
|
-
fun scheduleAd(nativeId: NativeId, adItemJson: ReadableMap, promise: Promise) {
|
|
450
|
-
promise.unit.resolveOnUiThreadWithPlayer(nativeId) {
|
|
451
|
-
scheduleAd(adItemJson.toAdItem() ?: throw IllegalArgumentException("invalid adItem"))
|
|
236
|
+
AsyncFunction("getVideoQuality") { nativeId: NativeId ->
|
|
237
|
+
val player = players[nativeId]
|
|
238
|
+
return@AsyncFunction player?.videoQuality?.toJson()
|
|
452
239
|
}
|
|
453
|
-
}
|
|
454
240
|
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
* @param nativeId Target player id.
|
|
459
|
-
*/
|
|
460
|
-
@ReactMethod
|
|
461
|
-
fun skipAd(nativeId: NativeId, promise: Promise) {
|
|
462
|
-
promise.unit.resolveOnUiThreadWithPlayer(nativeId) {
|
|
463
|
-
skipAd()
|
|
241
|
+
AsyncFunction("getAvailableVideoQualities") { nativeId: NativeId ->
|
|
242
|
+
val player = players[nativeId]
|
|
243
|
+
return@AsyncFunction player?.availableVideoQualities?.map { it.toJson() } ?: emptyList()
|
|
464
244
|
}
|
|
465
|
-
}
|
|
466
245
|
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
@ReactMethod
|
|
472
|
-
fun isAd(nativeId: NativeId, promise: Promise) {
|
|
473
|
-
promise.unit.resolveOnUiThreadWithPlayer(nativeId) {
|
|
474
|
-
isAd
|
|
475
|
-
}
|
|
476
|
-
}
|
|
246
|
+
AsyncFunction("setVideoQuality") { nativeId: NativeId, qualityId: String ->
|
|
247
|
+
val player = players[nativeId]
|
|
248
|
+
player?.source?.setVideoQuality(qualityId)
|
|
249
|
+
}.runOnQueue(Queues.MAIN)
|
|
477
250
|
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
* @param nativeId Target player id.
|
|
482
|
-
*/
|
|
483
|
-
@ReactMethod
|
|
484
|
-
fun getTimeShift(nativeId: NativeId, promise: Promise) {
|
|
485
|
-
promise.double.resolveOnUiThreadWithPlayer(nativeId) {
|
|
486
|
-
timeShift
|
|
251
|
+
AsyncFunction("getThumbnail") { nativeId: NativeId, time: Double ->
|
|
252
|
+
val player = players[nativeId]
|
|
253
|
+
return@AsyncFunction player?.getThumbnail(time)?.toJson()
|
|
487
254
|
}
|
|
488
|
-
|
|
255
|
+
AsyncFunction("loadOfflineContent") { nativeId: NativeId, offlineContentManagerBridgeId: String,
|
|
256
|
+
options: Map<String, Any>?, ->
|
|
257
|
+
val player = players[nativeId] ?: return@AsyncFunction
|
|
258
|
+
val offlineContentManagerBridge = appContext.registry.getModule<OfflineModule>()
|
|
259
|
+
?.getOfflineContentManagerBridge(offlineContentManagerBridgeId)
|
|
489
260
|
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
*/
|
|
495
|
-
@ReactMethod
|
|
496
|
-
fun getMaxTimeShift(nativeId: NativeId, promise: Promise) {
|
|
497
|
-
promise.double.resolveOnUiThreadWithPlayer(nativeId) {
|
|
498
|
-
maxTimeShift
|
|
499
|
-
}
|
|
500
|
-
}
|
|
261
|
+
offlineContentManagerBridge?.offlineContentManager?.offlineSourceConfig?.let {
|
|
262
|
+
player.load(it)
|
|
263
|
+
}
|
|
264
|
+
}.runOnQueue(Queues.MAIN)
|
|
501
265
|
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
)
|
|
513
|
-
}
|
|
514
|
-
|
|
266
|
+
AsyncFunction("scheduleAd") { nativeId: NativeId, adItemJson: Map<String, Any> ->
|
|
267
|
+
val player = players[nativeId]
|
|
268
|
+
val adItem = adItemJson.toAdItem()
|
|
269
|
+
if (player != null && adItem != null) {
|
|
270
|
+
player.scheduleAd(adItem)
|
|
271
|
+
}
|
|
272
|
+
}.runOnQueue(Queues.MAIN)
|
|
273
|
+
|
|
274
|
+
AsyncFunction("initializeWithConfig") { nativeId: NativeId, config: Map<String, Any>?,
|
|
275
|
+
networkNativeId: NativeId?, decoderNativeId: NativeId?, ->
|
|
276
|
+
initializePlayer(nativeId, config, networkNativeId, decoderNativeId, null)
|
|
277
|
+
}.runOnQueue(Queues.MAIN)
|
|
278
|
+
|
|
279
|
+
AsyncFunction("initializeWithAnalyticsConfig") { nativeId: NativeId, analyticsConfigJson: Map<String, Any>,
|
|
280
|
+
config: Map<String, Any>?, networkNativeId: NativeId?, decoderNativeId: NativeId?, ->
|
|
281
|
+
initializePlayer(nativeId, config, networkNativeId, decoderNativeId, analyticsConfigJson)
|
|
282
|
+
}.runOnQueue(Queues.MAIN)
|
|
283
|
+
|
|
284
|
+
AsyncFunction("loadSource") { nativeId: NativeId, sourceNativeId: NativeId ->
|
|
285
|
+
val player = players[nativeId]
|
|
286
|
+
val source = appContext.registry.getModule<SourceModule>()?.getSourceOrNull(sourceNativeId)
|
|
287
|
+
if (player != null && source != null) {
|
|
288
|
+
player.load(source)
|
|
289
|
+
}
|
|
290
|
+
}.runOnQueue(Queues.MAIN)
|
|
515
291
|
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
* @param time Playback time for the thumbnail.
|
|
520
|
-
*/
|
|
521
|
-
@ReactMethod
|
|
522
|
-
fun getThumbnail(nativeId: NativeId, time: Double, promise: Promise) {
|
|
523
|
-
promise.map.nullable.resolveOnUiThreadWithPlayer(nativeId) {
|
|
524
|
-
source?.getThumbnail(time)?.toJson()
|
|
292
|
+
AsyncFunction("source") { nativeId: NativeId ->
|
|
293
|
+
val player = players[nativeId]
|
|
294
|
+
return@AsyncFunction player?.source?.toJson()
|
|
525
295
|
}
|
|
526
296
|
}
|
|
527
297
|
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
298
|
+
private fun initializePlayer(
|
|
299
|
+
nativeId: NativeId,
|
|
300
|
+
config: Map<String, Any>?,
|
|
301
|
+
networkNativeId: NativeId?,
|
|
302
|
+
decoderNativeId: NativeId?,
|
|
303
|
+
analyticsConfigJson: Map<String, Any>?,
|
|
304
|
+
) {
|
|
305
|
+
if (players.containsKey(nativeId)) {
|
|
306
|
+
// Player already exists for this nativeId
|
|
307
|
+
return
|
|
536
308
|
}
|
|
537
|
-
}
|
|
538
309
|
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
@ReactMethod
|
|
543
|
-
fun castStop(nativeId: NativeId, promise: Promise) {
|
|
544
|
-
promise.unit.resolveOnUiThreadWithPlayer(nativeId) {
|
|
545
|
-
castStop()
|
|
546
|
-
}
|
|
547
|
-
}
|
|
310
|
+
val playerConfig = config?.toPlayerConfig() ?: PlayerConfig()
|
|
311
|
+
val enableMediaSession = config?.getMap("mediaControlConfig")
|
|
312
|
+
?.toMediaControlConfig()?.isEnabled ?: true
|
|
548
313
|
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
* casting becomes available.
|
|
552
|
-
*/
|
|
553
|
-
@ReactMethod
|
|
554
|
-
fun isCastAvailable(nativeId: NativeId, promise: Promise) {
|
|
555
|
-
promise.bool.resolveOnUiThreadWithPlayer(nativeId) {
|
|
556
|
-
isCastAvailable
|
|
314
|
+
val networkConfig = networkNativeId?.let { id ->
|
|
315
|
+
appContext.registry.getModule<NetworkModule>()?.getConfig(id)
|
|
557
316
|
}
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
/**
|
|
561
|
-
* Whether video is currently being casted to a remote device and not played locally.
|
|
562
|
-
*/
|
|
563
|
-
@ReactMethod
|
|
564
|
-
fun isCasting(nativeId: NativeId, promise: Promise) {
|
|
565
|
-
promise.bool.resolveOnUiThreadWithPlayer(nativeId) {
|
|
566
|
-
isCasting
|
|
317
|
+
networkConfig?.let {
|
|
318
|
+
playerConfig.networkConfig = it
|
|
567
319
|
}
|
|
568
|
-
}
|
|
569
320
|
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
*/
|
|
573
|
-
@ReactMethod
|
|
574
|
-
fun getVideoQuality(nativeId: NativeId, promise: Promise) {
|
|
575
|
-
promise.map.nullable.resolveOnUiThreadWithPlayer(nativeId) {
|
|
576
|
-
source?.selectedVideoQuality?.toJson()
|
|
321
|
+
val decoderConfig = decoderNativeId?.let {
|
|
322
|
+
appContext.registry.getModule<DecoderConfigModule>()?.getDecoderConfig(it)
|
|
577
323
|
}
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
/**
|
|
581
|
-
* Resolve [nativeId]'s current available video qualities.
|
|
582
|
-
*/
|
|
583
|
-
@ReactMethod
|
|
584
|
-
fun getAvailableVideoQualities(nativeId: NativeId, promise: Promise) {
|
|
585
|
-
promise.array.resolveOnUiThreadWithPlayer(nativeId) {
|
|
586
|
-
source?.availableVideoQualities?.mapToReactArray { it.toJson() } ?: Arguments.createArray()
|
|
324
|
+
if (decoderConfig != null) {
|
|
325
|
+
playerConfig.playbackConfig = playerConfig.playbackConfig.copy(decoderConfig = decoderConfig)
|
|
587
326
|
}
|
|
588
|
-
}
|
|
589
327
|
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
* @param qualityId The videoQualityId identifier. A list of currently available VideoQualitys can be retrieved via availableVideoQualities. To use automatic quality selection, Quality.AUTO_ID can be passed as qualityId.
|
|
595
|
-
* @param promise JS promise object.
|
|
596
|
-
*/
|
|
597
|
-
@ReactMethod
|
|
598
|
-
fun setVideoQuality(nativeId: NativeId, qualityId: String, promise: Promise) {
|
|
599
|
-
promise.unit.resolveOnUiThreadWithPlayer(nativeId) {
|
|
600
|
-
source?.setVideoQuality(qualityId)
|
|
601
|
-
}
|
|
602
|
-
}
|
|
328
|
+
val applicationContext = appContext.reactContext?.applicationContext
|
|
329
|
+
?: throw IllegalStateException("Application context is not available")
|
|
330
|
+
val analyticsConfig = analyticsConfigJson?.toAnalyticsConfig()
|
|
331
|
+
val defaultMetadata = analyticsConfigJson?.getMap("defaultMetadata")?.toAnalyticsDefaultMetadata()
|
|
603
332
|
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
333
|
+
val player = if (analyticsConfig != null) {
|
|
334
|
+
Player.create(
|
|
335
|
+
context = applicationContext,
|
|
336
|
+
playerConfig = playerConfig,
|
|
337
|
+
analyticsConfig = analyticsConfig,
|
|
338
|
+
defaultMetadata = defaultMetadata ?: DefaultMetadata(),
|
|
339
|
+
)
|
|
340
|
+
} else {
|
|
341
|
+
Player.create(applicationContext, playerConfig)
|
|
611
342
|
}
|
|
612
|
-
|
|
343
|
+
players[nativeId] = player
|
|
613
344
|
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
*/
|
|
617
|
-
@ReactMethod
|
|
618
|
-
fun setPlaybackSpeed(nativeId: NativeId, playbackSpeed: Float, promise: Promise) {
|
|
619
|
-
promise.unit.resolveOnUiThreadWithPlayer(nativeId) {
|
|
620
|
-
this.playbackSpeed = playbackSpeed
|
|
345
|
+
if (enableMediaSession) {
|
|
346
|
+
mediaSessionPlaybackManager.setupMediaSessionPlayback(nativeId)
|
|
621
347
|
}
|
|
622
348
|
}
|
|
623
349
|
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
crossinline block: Player.() -> T,
|
|
627
|
-
) = resolveOnUiThread { getPlayer(nativeId, this@PlayerModule).block() }
|
|
350
|
+
// CRITICAL: This method must remain available for cross-module access
|
|
351
|
+
fun getPlayerOrNull(nativeId: NativeId): Player? = players[nativeId]
|
|
628
352
|
}
|