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/src/player.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Platform } from 'react-native';
|
|
2
|
+
import PlayerModule from './modules/PlayerModule';
|
|
2
3
|
import NativeInstance from './nativeInstance';
|
|
3
4
|
import { Source, SourceConfig } from './source';
|
|
4
5
|
import { AudioTrack } from './audioTrack';
|
|
@@ -13,8 +14,6 @@ import { VideoQuality } from './media';
|
|
|
13
14
|
import { Network } from './network';
|
|
14
15
|
import { DecoderConfigBridge } from './decoder';
|
|
15
16
|
|
|
16
|
-
const PlayerModule = NativeModules.PlayerModule;
|
|
17
|
-
|
|
18
17
|
/**
|
|
19
18
|
* Loads, controls and renders audio and video content represented through {@link Source}s. A player
|
|
20
19
|
* instance can be created via the {@link usePlayer} hook and will idle until one or more {@link Source}s are
|
|
@@ -54,25 +53,25 @@ export class Player extends NativeInstance<PlayerConfig> {
|
|
|
54
53
|
/**
|
|
55
54
|
* Allocates the native `Player` instance and its resources natively.
|
|
56
55
|
*/
|
|
57
|
-
initialize = () => {
|
|
56
|
+
initialize = async (): Promise<void> => {
|
|
58
57
|
if (!this.isInitialized) {
|
|
59
58
|
if (this.config?.networkConfig) {
|
|
60
59
|
this.network = new Network(this.config.networkConfig);
|
|
61
|
-
this.network.initialize();
|
|
60
|
+
await this.network.initialize();
|
|
62
61
|
}
|
|
63
|
-
this.maybeInitDecoderConfig();
|
|
62
|
+
await this.maybeInitDecoderConfig();
|
|
64
63
|
const analyticsConfig = this.config?.analyticsConfig;
|
|
65
64
|
if (analyticsConfig) {
|
|
66
|
-
PlayerModule.
|
|
65
|
+
await PlayerModule.initializeWithAnalyticsConfig(
|
|
67
66
|
this.nativeId,
|
|
67
|
+
analyticsConfig,
|
|
68
68
|
this.config,
|
|
69
69
|
this.network?.nativeId,
|
|
70
|
-
this.decoderConfig?.nativeId
|
|
71
|
-
analyticsConfig
|
|
70
|
+
this.decoderConfig?.nativeId
|
|
72
71
|
);
|
|
73
72
|
this.analytics = new AnalyticsApi(this.nativeId);
|
|
74
73
|
} else {
|
|
75
|
-
PlayerModule.
|
|
74
|
+
await PlayerModule.initializeWithConfig(
|
|
76
75
|
this.nativeId,
|
|
77
76
|
this.config,
|
|
78
77
|
this.network?.nativeId,
|
|
@@ -82,6 +81,7 @@ export class Player extends NativeInstance<PlayerConfig> {
|
|
|
82
81
|
|
|
83
82
|
this.isInitialized = true;
|
|
84
83
|
}
|
|
84
|
+
return Promise.resolve();
|
|
85
85
|
};
|
|
86
86
|
|
|
87
87
|
/**
|
|
@@ -122,9 +122,10 @@ export class Player extends NativeInstance<PlayerConfig> {
|
|
|
122
122
|
* Loads the given {@link Source} into the player.
|
|
123
123
|
*/
|
|
124
124
|
loadSource = (source: Source) => {
|
|
125
|
-
source.initialize();
|
|
126
125
|
this.source = source;
|
|
127
|
-
|
|
126
|
+
source.initialize().then(() => {
|
|
127
|
+
PlayerModule.loadSource(this.nativeId, source.nativeId);
|
|
128
|
+
});
|
|
128
129
|
};
|
|
129
130
|
|
|
130
131
|
/**
|
|
@@ -201,7 +202,7 @@ export class Player extends NativeInstance<PlayerConfig> {
|
|
|
201
202
|
* @returns The player's current volume level.
|
|
202
203
|
*/
|
|
203
204
|
getVolume = async (): Promise<number> => {
|
|
204
|
-
return PlayerModule.getVolume(this.nativeId);
|
|
205
|
+
return (await PlayerModule.getVolume(this.nativeId)) ?? 0;
|
|
205
206
|
};
|
|
206
207
|
|
|
207
208
|
/**
|
|
@@ -217,42 +218,42 @@ export class Player extends NativeInstance<PlayerConfig> {
|
|
|
217
218
|
getCurrentTime = async (
|
|
218
219
|
mode: 'relative' | 'absolute' = 'absolute'
|
|
219
220
|
): Promise<number> => {
|
|
220
|
-
return PlayerModule.currentTime(this.nativeId, mode);
|
|
221
|
+
return (await PlayerModule.currentTime(this.nativeId, mode)) ?? 0;
|
|
221
222
|
};
|
|
222
223
|
|
|
223
224
|
/**
|
|
224
225
|
* @returns The total duration in seconds of the current video or INFINITY if it’s a live stream.
|
|
225
226
|
*/
|
|
226
227
|
getDuration = async (): Promise<number> => {
|
|
227
|
-
return PlayerModule.duration(this.nativeId);
|
|
228
|
+
return (await PlayerModule.duration(this.nativeId)) ?? 0;
|
|
228
229
|
};
|
|
229
230
|
|
|
230
231
|
/**
|
|
231
232
|
* @returns `true` if the player is muted.
|
|
232
233
|
*/
|
|
233
234
|
isMuted = async (): Promise<boolean> => {
|
|
234
|
-
return PlayerModule.isMuted(this.nativeId);
|
|
235
|
+
return (await PlayerModule.isMuted(this.nativeId)) ?? false;
|
|
235
236
|
};
|
|
236
237
|
|
|
237
238
|
/**
|
|
238
239
|
* @returns `true` if the player is currently playing, i.e. has started and is not paused.
|
|
239
240
|
*/
|
|
240
241
|
isPlaying = async (): Promise<boolean> => {
|
|
241
|
-
return PlayerModule.isPlaying(this.nativeId);
|
|
242
|
+
return (await PlayerModule.isPlaying(this.nativeId)) ?? false;
|
|
242
243
|
};
|
|
243
244
|
|
|
244
245
|
/**
|
|
245
246
|
* @returns `true` if the player has started playback but it's currently paused.
|
|
246
247
|
*/
|
|
247
248
|
isPaused = async (): Promise<boolean> => {
|
|
248
|
-
return PlayerModule.isPaused(this.nativeId);
|
|
249
|
+
return (await PlayerModule.isPaused(this.nativeId)) ?? false;
|
|
249
250
|
};
|
|
250
251
|
|
|
251
252
|
/**
|
|
252
253
|
* @returns `true` if the displayed video is a live stream.
|
|
253
254
|
*/
|
|
254
255
|
isLive = async (): Promise<boolean> => {
|
|
255
|
-
return PlayerModule.isLive(this.nativeId);
|
|
256
|
+
return (await PlayerModule.isLive(this.nativeId)) ?? false;
|
|
256
257
|
};
|
|
257
258
|
|
|
258
259
|
/**
|
|
@@ -266,7 +267,7 @@ export class Player extends NativeInstance<PlayerConfig> {
|
|
|
266
267
|
);
|
|
267
268
|
return false;
|
|
268
269
|
}
|
|
269
|
-
return PlayerModule.isAirPlayActive(this.nativeId);
|
|
270
|
+
return (await PlayerModule.isAirPlayActive(this.nativeId)) ?? false;
|
|
270
271
|
};
|
|
271
272
|
|
|
272
273
|
/**
|
|
@@ -280,7 +281,7 @@ export class Player extends NativeInstance<PlayerConfig> {
|
|
|
280
281
|
);
|
|
281
282
|
return false;
|
|
282
283
|
}
|
|
283
|
-
return PlayerModule.isAirPlayAvailable(this.nativeId);
|
|
284
|
+
return (await PlayerModule.isAirPlayAvailable(this.nativeId)) ?? false;
|
|
284
285
|
};
|
|
285
286
|
|
|
286
287
|
/**
|
|
@@ -326,7 +327,7 @@ export class Player extends NativeInstance<PlayerConfig> {
|
|
|
326
327
|
* @param trackIdentifier - The {@link SubtitleTrack.identifier} to be set.
|
|
327
328
|
*/
|
|
328
329
|
setSubtitleTrack = async (trackIdentifier?: string): Promise<void> => {
|
|
329
|
-
return PlayerModule.setSubtitleTrack(this.nativeId, trackIdentifier);
|
|
330
|
+
return PlayerModule.setSubtitleTrack(this.nativeId, trackIdentifier ?? '');
|
|
330
331
|
};
|
|
331
332
|
|
|
332
333
|
/**
|
|
@@ -335,7 +336,7 @@ export class Player extends NativeInstance<PlayerConfig> {
|
|
|
335
336
|
*
|
|
336
337
|
* @param adItem - Ad to be scheduled for playback.
|
|
337
338
|
*
|
|
338
|
-
* @
|
|
339
|
+
* @remarks Platform: iOS, Android
|
|
339
340
|
*/
|
|
340
341
|
scheduleAd = (adItem: AdItem) => {
|
|
341
342
|
PlayerModule.scheduleAd(this.nativeId, adItem);
|
|
@@ -345,7 +346,7 @@ export class Player extends NativeInstance<PlayerConfig> {
|
|
|
345
346
|
* Skips the current ad.
|
|
346
347
|
* Has no effect if the current ad is not skippable or if no ad is being played back.
|
|
347
348
|
*
|
|
348
|
-
* @
|
|
349
|
+
* @remarks Platform: iOS, Android
|
|
349
350
|
*/
|
|
350
351
|
skipAd = () => {
|
|
351
352
|
PlayerModule.skipAd(this.nativeId);
|
|
@@ -353,10 +354,10 @@ export class Player extends NativeInstance<PlayerConfig> {
|
|
|
353
354
|
|
|
354
355
|
/**
|
|
355
356
|
* @returns `true` while an ad is being played back or when main content playback has been paused for ad playback.
|
|
356
|
-
* @
|
|
357
|
+
* @remarks Platform: iOS, Android
|
|
357
358
|
*/
|
|
358
359
|
isAd = async (): Promise<boolean> => {
|
|
359
|
-
return PlayerModule.isAd(this.nativeId);
|
|
360
|
+
return (await PlayerModule.isAd(this.nativeId)) ?? false;
|
|
360
361
|
};
|
|
361
362
|
|
|
362
363
|
/**
|
|
@@ -364,7 +365,7 @@ export class Player extends NativeInstance<PlayerConfig> {
|
|
|
364
365
|
* live stream or no sources are loaded.
|
|
365
366
|
*/
|
|
366
367
|
getTimeShift = async (): Promise<number> => {
|
|
367
|
-
return PlayerModule.getTimeShift(this.nativeId);
|
|
368
|
+
return (await PlayerModule.getTimeShift(this.nativeId)) ?? 0;
|
|
368
369
|
};
|
|
369
370
|
|
|
370
371
|
/**
|
|
@@ -372,7 +373,7 @@ export class Player extends NativeInstance<PlayerConfig> {
|
|
|
372
373
|
* {@link Source} is not a live stream or no sources are loaded.
|
|
373
374
|
*/
|
|
374
375
|
getMaxTimeShift = async (): Promise<number> => {
|
|
375
|
-
return PlayerModule.getMaxTimeShift(this.nativeId);
|
|
376
|
+
return (await PlayerModule.getMaxTimeShift(this.nativeId)) ?? 0;
|
|
376
377
|
};
|
|
377
378
|
|
|
378
379
|
/**
|
|
@@ -403,26 +404,26 @@ export class Player extends NativeInstance<PlayerConfig> {
|
|
|
403
404
|
* Whether casting to a cast-compatible remote device is available. {@link CastAvailableEvent} signals when
|
|
404
405
|
* casting becomes available.
|
|
405
406
|
*
|
|
406
|
-
* @
|
|
407
|
+
* @remarks Platform: iOS, Android
|
|
407
408
|
*/
|
|
408
409
|
isCastAvailable = async (): Promise<boolean> => {
|
|
409
|
-
return PlayerModule.isCastAvailable(this.nativeId);
|
|
410
|
+
return (await PlayerModule.isCastAvailable(this.nativeId)) ?? false;
|
|
410
411
|
};
|
|
411
412
|
|
|
412
413
|
/**
|
|
413
414
|
* Whether video is currently being casted to a remote device and not played locally.
|
|
414
415
|
*
|
|
415
|
-
* @
|
|
416
|
+
* @remarks Platform: iOS, Android
|
|
416
417
|
*/
|
|
417
418
|
isCasting = async (): Promise<boolean> => {
|
|
418
|
-
return PlayerModule.isCasting(this.nativeId);
|
|
419
|
+
return (await PlayerModule.isCasting(this.nativeId)) ?? false;
|
|
419
420
|
};
|
|
420
421
|
|
|
421
422
|
/**
|
|
422
423
|
* Initiates casting the current video to a cast-compatible remote device. The user has to choose to which device it
|
|
423
424
|
* should be sent.
|
|
424
425
|
*
|
|
425
|
-
* @
|
|
426
|
+
* @remarks Platform: iOS, Android
|
|
426
427
|
*/
|
|
427
428
|
castVideo = () => {
|
|
428
429
|
PlayerModule.castVideo(this.nativeId);
|
|
@@ -431,7 +432,7 @@ export class Player extends NativeInstance<PlayerConfig> {
|
|
|
431
432
|
/**
|
|
432
433
|
* Stops casting the current video. Has no effect if {@link Player.isCasting} is `false`.
|
|
433
434
|
*
|
|
434
|
-
* @
|
|
435
|
+
* @remarks Platform: iOS, Android
|
|
435
436
|
*/
|
|
436
437
|
castStop = () => {
|
|
437
438
|
PlayerModule.castStop(this.nativeId);
|
|
@@ -455,12 +456,11 @@ export class Player extends NativeInstance<PlayerConfig> {
|
|
|
455
456
|
|
|
456
457
|
/**
|
|
457
458
|
* Sets the video quality.
|
|
458
|
-
* @remarks
|
|
459
|
-
* @platform Android
|
|
459
|
+
* @remarks Platform: Android
|
|
460
460
|
*
|
|
461
461
|
* @param qualityId value obtained from {@link VideoQuality}'s `id` property, which can be obtained via `Player.getAvailableVideoQualities()` to select a specific quality. To use automatic quality selection, 'auto' can be passed here.
|
|
462
462
|
*/
|
|
463
|
-
setVideoQuality = (qualityId:
|
|
463
|
+
setVideoQuality = (qualityId: string) => {
|
|
464
464
|
if (Platform.OS !== 'android') {
|
|
465
465
|
console.warn(
|
|
466
466
|
`[Player ${this.nativeId}] Method setVideoQuality is not available for iOS and tvOS devices. Only Android devices.`
|
|
@@ -472,17 +472,17 @@ export class Player extends NativeInstance<PlayerConfig> {
|
|
|
472
472
|
|
|
473
473
|
/**
|
|
474
474
|
* Sets the playback speed of the player. Fast forward, slow motion and reverse playback are supported.
|
|
475
|
-
* @
|
|
475
|
+
* @remarks
|
|
476
|
+
* Platform: iOS, tvOS
|
|
477
|
+
*
|
|
476
478
|
* - Slow motion is indicated by values between `0` and `1`.
|
|
477
479
|
* - Fast forward by values greater than `1`.
|
|
478
480
|
* - Slow reverse is used by values between `0` and `-1`, and fast reverse is used by values less than `-1`. iOS and tvOS only.
|
|
479
|
-
*
|
|
480
|
-
*
|
|
481
|
-
*
|
|
482
|
-
*
|
|
483
|
-
*
|
|
484
|
-
* speed will be reset to its default value of `1`. No {@link PlaybackFinishedEvent} will be
|
|
485
|
-
* emitted in this case.
|
|
481
|
+
* - Negative values are ignored during Casting and on Android.
|
|
482
|
+
* - During reverse playback the playback will continue until the beginning of the active source is
|
|
483
|
+
* reached. When reaching the beginning of the source, playback will be paused and the playback
|
|
484
|
+
* speed will be reset to its default value of `1`. No {@link PlaybackFinishedEvent} will be
|
|
485
|
+
* emitted in this case.
|
|
486
486
|
*
|
|
487
487
|
* @param playbackSpeed - The playback speed to set.
|
|
488
488
|
*/
|
|
@@ -495,14 +495,14 @@ export class Player extends NativeInstance<PlayerConfig> {
|
|
|
495
495
|
* @returns The player's current playback speed.
|
|
496
496
|
*/
|
|
497
497
|
getPlaybackSpeed = async (): Promise<number> => {
|
|
498
|
-
return PlayerModule.getPlaybackSpeed(this.nativeId);
|
|
498
|
+
return (await PlayerModule.getPlaybackSpeed(this.nativeId)) ?? 0;
|
|
499
499
|
};
|
|
500
500
|
|
|
501
501
|
/**
|
|
502
502
|
* Checks the possibility to play the media at specified playback speed.
|
|
503
503
|
* @param playbackSpeed - The playback speed to check.
|
|
504
504
|
* @returns `true` if it's possible to play the media at the specified playback speed, otherwise `false`. On Android it always returns `undefined`.
|
|
505
|
-
* @
|
|
505
|
+
* @remarks Platform: iOS, tvOS
|
|
506
506
|
*/
|
|
507
507
|
canPlayAtPlaybackSpeed = async (
|
|
508
508
|
playbackSpeed: number
|
|
@@ -513,7 +513,12 @@ export class Player extends NativeInstance<PlayerConfig> {
|
|
|
513
513
|
);
|
|
514
514
|
return undefined;
|
|
515
515
|
}
|
|
516
|
-
return
|
|
516
|
+
return (
|
|
517
|
+
(await PlayerModule.canPlayAtPlaybackSpeed(
|
|
518
|
+
this.nativeId,
|
|
519
|
+
playbackSpeed
|
|
520
|
+
)) ?? false
|
|
521
|
+
);
|
|
517
522
|
};
|
|
518
523
|
|
|
519
524
|
private maybeInitDecoderConfig = () => {
|
package/src/source.ts
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import { NativeModules } from 'react-native';
|
|
2
1
|
import { Drm, DrmConfig } from './drm';
|
|
3
2
|
import NativeInstance, { NativeInstanceConfig } from './nativeInstance';
|
|
4
3
|
import { SideLoadedSubtitleTrack } from './subtitleTrack';
|
|
5
4
|
import { Thumbnail } from './thumbnail';
|
|
6
5
|
import { SourceMetadata } from './analytics';
|
|
7
|
-
|
|
8
|
-
const SourceModule = NativeModules.SourceModule;
|
|
6
|
+
import SourceModule from './modules/SourceModule';
|
|
9
7
|
|
|
10
8
|
/**
|
|
11
9
|
* Types of media that can be handled by the player.
|
|
@@ -138,7 +136,7 @@ export interface SourceConfig extends NativeInstanceConfig {
|
|
|
138
136
|
|
|
139
137
|
/**
|
|
140
138
|
* The remote control config for a source.
|
|
141
|
-
* @
|
|
139
|
+
* @remarks Platform: iOS
|
|
142
140
|
*/
|
|
143
141
|
export interface SourceRemoteControlConfig {
|
|
144
142
|
/**
|
|
@@ -163,7 +161,7 @@ export class Source extends NativeInstance<SourceConfig> {
|
|
|
163
161
|
* The remote control config for this source.
|
|
164
162
|
* This is only supported on iOS.
|
|
165
163
|
*
|
|
166
|
-
* @
|
|
164
|
+
* @remarks Platform: iOS
|
|
167
165
|
*/
|
|
168
166
|
remoteControl: SourceRemoteControlConfig | null = null;
|
|
169
167
|
/**
|
|
@@ -178,7 +176,7 @@ export class Source extends NativeInstance<SourceConfig> {
|
|
|
178
176
|
/**
|
|
179
177
|
* Allocates the native {@link Source} instance and its resources natively.
|
|
180
178
|
*/
|
|
181
|
-
initialize = () => {
|
|
179
|
+
initialize = async (): Promise<void> => {
|
|
182
180
|
if (!this.isInitialized) {
|
|
183
181
|
const sourceMetadata = this.config?.analyticsSourceMetadata;
|
|
184
182
|
if (this.config?.drmConfig) {
|
|
@@ -186,23 +184,24 @@ export class Source extends NativeInstance<SourceConfig> {
|
|
|
186
184
|
this.drm.initialize();
|
|
187
185
|
}
|
|
188
186
|
if (sourceMetadata) {
|
|
189
|
-
SourceModule.
|
|
187
|
+
await SourceModule.initializeWithAnalyticsConfig(
|
|
190
188
|
this.nativeId,
|
|
191
189
|
this.drm?.nativeId,
|
|
192
190
|
this.config,
|
|
193
|
-
this.remoteControl,
|
|
191
|
+
this.remoteControl || undefined,
|
|
194
192
|
sourceMetadata
|
|
195
193
|
);
|
|
196
194
|
} else {
|
|
197
|
-
SourceModule.
|
|
195
|
+
await SourceModule.initializeWithConfig(
|
|
198
196
|
this.nativeId,
|
|
199
197
|
this.drm?.nativeId,
|
|
200
198
|
this.config,
|
|
201
|
-
this.remoteControl
|
|
199
|
+
this.remoteControl || undefined
|
|
202
200
|
);
|
|
203
201
|
}
|
|
204
202
|
this.isInitialized = true;
|
|
205
203
|
}
|
|
204
|
+
return Promise.resolve();
|
|
206
205
|
};
|
|
207
206
|
|
|
208
207
|
/**
|
|
@@ -221,7 +220,7 @@ export class Source extends NativeInstance<SourceConfig> {
|
|
|
221
220
|
* Default value is `0` if the duration is not available or not known.
|
|
222
221
|
*/
|
|
223
222
|
duration = async (): Promise<number> => {
|
|
224
|
-
return SourceModule.duration(this.nativeId);
|
|
223
|
+
return (await SourceModule.duration(this.nativeId)) || 0;
|
|
225
224
|
};
|
|
226
225
|
|
|
227
226
|
/**
|
|
@@ -229,14 +228,14 @@ export class Source extends NativeInstance<SourceConfig> {
|
|
|
229
228
|
* Only one source can be active in the same player instance at any time.
|
|
230
229
|
*/
|
|
231
230
|
isActive = async (): Promise<boolean> => {
|
|
232
|
-
return SourceModule.isActive(this.nativeId);
|
|
231
|
+
return (await SourceModule.isActive(this.nativeId)) ?? false;
|
|
233
232
|
};
|
|
234
233
|
|
|
235
234
|
/**
|
|
236
235
|
* Whether the source is currently attached to a player instance.
|
|
237
236
|
*/
|
|
238
237
|
isAttachedToPlayer = async (): Promise<boolean> => {
|
|
239
|
-
return SourceModule.isAttachedToPlayer(this.nativeId);
|
|
238
|
+
return (await SourceModule.isAttachedToPlayer(this.nativeId)) ?? false;
|
|
240
239
|
};
|
|
241
240
|
|
|
242
241
|
/**
|
|
@@ -260,7 +259,9 @@ export class Source extends NativeInstance<SourceConfig> {
|
|
|
260
259
|
* The current `LoadingState` of the source.
|
|
261
260
|
*/
|
|
262
261
|
loadingState = async (): Promise<LoadingState> => {
|
|
263
|
-
return
|
|
262
|
+
return (
|
|
263
|
+
(await SourceModule.loadingState(this.nativeId)) || LoadingState.UNLOADED
|
|
264
|
+
);
|
|
264
265
|
};
|
|
265
266
|
|
|
266
267
|
/**
|
package/src/styleConfig.ts
CHANGED
|
@@ -26,7 +26,7 @@ export interface StyleConfig {
|
|
|
26
26
|
* },
|
|
27
27
|
* });
|
|
28
28
|
* ```
|
|
29
|
-
* @
|
|
29
|
+
* @remarks Platform: iOS, tvOS
|
|
30
30
|
*/
|
|
31
31
|
userInterfaceType?: UserInterfaceType;
|
|
32
32
|
/**
|
|
@@ -39,7 +39,7 @@ export interface StyleConfig {
|
|
|
39
39
|
* },
|
|
40
40
|
* });
|
|
41
41
|
* ```
|
|
42
|
-
* @
|
|
42
|
+
* @remarks Platform: iOS, Android
|
|
43
43
|
*/
|
|
44
44
|
playerUiCss?: string;
|
|
45
45
|
/**
|
|
@@ -52,7 +52,7 @@ export interface StyleConfig {
|
|
|
52
52
|
* },
|
|
53
53
|
* });
|
|
54
54
|
* ```
|
|
55
|
-
* @
|
|
55
|
+
* @remarks Platform: iOS, Android
|
|
56
56
|
*/
|
|
57
57
|
supplementalPlayerUiCss?: string;
|
|
58
58
|
/**
|
|
@@ -65,7 +65,7 @@ export interface StyleConfig {
|
|
|
65
65
|
* },
|
|
66
66
|
* });
|
|
67
67
|
* ```
|
|
68
|
-
* @
|
|
68
|
+
* @remarks Platform: iOS, Android
|
|
69
69
|
*/
|
|
70
70
|
playerUiJs?: string;
|
|
71
71
|
/**
|
|
@@ -111,7 +111,7 @@ export enum UserInterfaceType {
|
|
|
111
111
|
Bitmovin = 'Bitmovin',
|
|
112
112
|
/**
|
|
113
113
|
* Indicates that the system UI should be used.
|
|
114
|
-
* @
|
|
114
|
+
* @remarks Platform: iOS, tvOS
|
|
115
115
|
*/
|
|
116
116
|
System = 'System',
|
|
117
117
|
/**
|
package/src/subtitleFormat.ts
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Supported subtitle/caption file formats.
|
|
3
|
-
* @
|
|
3
|
+
* @remarks Platform: Android, iOS, tvOS
|
|
4
4
|
*/
|
|
5
5
|
export enum SubtitleFormat {
|
|
6
6
|
/**
|
|
7
7
|
* Closed Captioning (CEA) subtitle format.
|
|
8
|
-
* @
|
|
8
|
+
* @remarks Platform: Android, iOS, tvOS
|
|
9
9
|
*/
|
|
10
10
|
CEA = 'cea',
|
|
11
11
|
/**
|
|
12
12
|
* Timed Text Markup Language (TTML) subtitle format.
|
|
13
|
-
* @
|
|
13
|
+
* @remarks Platform: Android, iOS, tvOS
|
|
14
14
|
*/
|
|
15
15
|
TTML = 'ttml',
|
|
16
16
|
/**
|
|
17
17
|
* Web Video Text Tracks Format (WebVTT) subtitle format.
|
|
18
|
-
* @
|
|
18
|
+
* @remarks Platform: Android, iOS, tvOS
|
|
19
19
|
*/
|
|
20
20
|
VTT = 'vtt',
|
|
21
21
|
/**
|
|
22
22
|
* SubRip (SRT) subtitle format.
|
|
23
|
-
* @
|
|
23
|
+
* @remarks Platform: Android, iOS, tvOS
|
|
24
24
|
*/
|
|
25
25
|
SRT = 'srt',
|
|
26
26
|
}
|
package/src/subtitleTrack.ts
CHANGED
package/src/tweaksConfig.ts
CHANGED
|
@@ -35,7 +35,7 @@ export interface TweaksConfig {
|
|
|
35
35
|
* Default value in iOS is `1.0`.
|
|
36
36
|
* Default value in Android is `0.2`.
|
|
37
37
|
*
|
|
38
|
-
* @
|
|
38
|
+
* @remarks Platform: iOS, Android
|
|
39
39
|
*/
|
|
40
40
|
timeChangedInterval?: number;
|
|
41
41
|
/**
|
|
@@ -49,7 +49,7 @@ export interface TweaksConfig {
|
|
|
49
49
|
*
|
|
50
50
|
* Default is false.
|
|
51
51
|
*
|
|
52
|
-
* @
|
|
52
|
+
* @remarks Platform: iOS
|
|
53
53
|
*/
|
|
54
54
|
isNativeHlsParsingEnabled?: boolean;
|
|
55
55
|
/**
|
|
@@ -62,7 +62,7 @@ export interface TweaksConfig {
|
|
|
62
62
|
*
|
|
63
63
|
* Default is true.
|
|
64
64
|
*
|
|
65
|
-
* @
|
|
65
|
+
* @remarks Platform: iOS
|
|
66
66
|
*/
|
|
67
67
|
isCustomHlsLoadingEnabled?: boolean;
|
|
68
68
|
/**
|
|
@@ -76,7 +76,7 @@ export interface TweaksConfig {
|
|
|
76
76
|
*
|
|
77
77
|
* Default is 0.5.
|
|
78
78
|
*
|
|
79
|
-
* @
|
|
79
|
+
* @remarks Platform: iOS
|
|
80
80
|
*/
|
|
81
81
|
seekToEndThreshold?: number;
|
|
82
82
|
/**
|
|
@@ -85,7 +85,7 @@ export interface TweaksConfig {
|
|
|
85
85
|
* - 'relaxed': Starts playback when enough media data is buffered and continuous playback without stalling can be ensured. If insufficient media data is buffered for playback to start, the player will act as if the buffer became empty during playback.
|
|
86
86
|
* - 'aggressive': When the buffer is not empty, this setting will cause the player to start playback of available media immediately. If insufficient media data is buffered for playback to start, the player will act as if the buffer became empty during playback.
|
|
87
87
|
*
|
|
88
|
-
* @
|
|
88
|
+
* @remarks Platform: iOS
|
|
89
89
|
*/
|
|
90
90
|
playbackStartBehaviour?: 'relaxed' | 'aggressive';
|
|
91
91
|
/**
|
|
@@ -94,20 +94,20 @@ export interface TweaksConfig {
|
|
|
94
94
|
* - 'relaxed': The player will wait until the buffer is filled that it can, most likely, ensure continuous playback without another stalling right after playback continued.
|
|
95
95
|
* - 'aggressive': The player will try to unstall as soon as some media data became available and will start playback of this media immediately.
|
|
96
96
|
*
|
|
97
|
-
* @
|
|
97
|
+
* @remarks Platform: iOS
|
|
98
98
|
*/
|
|
99
99
|
unstallingBehaviour?: 'relaxed' | 'aggressive';
|
|
100
100
|
/**
|
|
101
101
|
* Constantly aggregated and weighted bandwidth samples are summed up to this weight limit to calculate an bandwidth estimation. Remaining samples (i.e. that would lead to exceeding the limit) are dropped from memory as they are not relevant anymore.
|
|
102
102
|
* Default is 2000.
|
|
103
103
|
*
|
|
104
|
-
* @
|
|
104
|
+
* @remarks Platform: Android
|
|
105
105
|
*/
|
|
106
106
|
bandwidthEstimateWeightLimit?: number;
|
|
107
107
|
/**
|
|
108
108
|
* Some devices have an incorrect implementation of MediaCodec.setOutputSurface. This leads to failure when the surface changes. To prevent failure, the codec will be released and re-instantiated in those scenarios.
|
|
109
109
|
*
|
|
110
|
-
* @
|
|
110
|
+
* @remarks Platform: Android
|
|
111
111
|
*/
|
|
112
112
|
devicesThatRequireSurfaceWorkaround?: {
|
|
113
113
|
/**
|
|
@@ -132,14 +132,14 @@ export interface TweaksConfig {
|
|
|
132
132
|
* - "en_us" is normalized to "en-us"
|
|
133
133
|
* - "en-US-x-lvariant-POSIX" is normalized to "en-us-posix"
|
|
134
134
|
*
|
|
135
|
-
* @
|
|
135
|
+
* @remarks Platform: Android
|
|
136
136
|
*/
|
|
137
137
|
languagePropertyNormalization?: boolean;
|
|
138
138
|
/**
|
|
139
139
|
* The interval in which dynamic DASH windows are updated locally. I.e. The rate by which the
|
|
140
140
|
* playback window is moved forward on the timeline.
|
|
141
141
|
*
|
|
142
|
-
* @
|
|
142
|
+
* @remarks Platform: Android
|
|
143
143
|
*/
|
|
144
144
|
localDynamicDashWindowUpdateInterval?: number;
|
|
145
145
|
/**
|
|
@@ -147,7 +147,7 @@ export interface TweaksConfig {
|
|
|
147
147
|
* DRM sessions for clear content avoids the recreation of decoders when transitioning between clear
|
|
148
148
|
* and encrypted sections of content. Default is false.
|
|
149
149
|
*
|
|
150
|
-
* @
|
|
150
|
+
* @remarks Platform: Android
|
|
151
151
|
*/
|
|
152
152
|
useDrmSessionForClearPeriods?: boolean;
|
|
153
153
|
/**
|
|
@@ -156,7 +156,7 @@ export interface TweaksConfig {
|
|
|
156
156
|
* periods in a DRM protected source. Using DRM sessions for clear content avoids the recreation of
|
|
157
157
|
* decoders when transitioning between clear and encrypted sections of content. Default is false.
|
|
158
158
|
*
|
|
159
|
-
* @
|
|
159
|
+
* @remarks Platform: Android
|
|
160
160
|
*/
|
|
161
161
|
useDrmSessionForClearSources?: boolean;
|
|
162
162
|
/**
|
|
@@ -164,7 +164,7 @@ export interface TweaksConfig {
|
|
|
164
164
|
* matching extractor was found. If the fallback is applied, this will ignore potential incompatibilities
|
|
165
165
|
* with streams and thus can result in unstable or failing playback.
|
|
166
166
|
*
|
|
167
|
-
* @
|
|
167
|
+
* @remarks Platform: Android
|
|
168
168
|
*/
|
|
169
169
|
useFiletypeExtractorFallbackForHls?: boolean;
|
|
170
170
|
/**
|
|
@@ -177,7 +177,7 @@ export interface TweaksConfig {
|
|
|
177
177
|
* Default is `true`.
|
|
178
178
|
*
|
|
179
179
|
* @deprecated To enable the Now Playing information use {@link MediaControlConfig.isEnabled}
|
|
180
|
-
* @
|
|
180
|
+
* @remarks Platform: iOS
|
|
181
181
|
*/
|
|
182
182
|
updatesNowPlayingInfoCenter?: boolean;
|
|
183
183
|
|
|
@@ -192,7 +192,7 @@ export interface TweaksConfig {
|
|
|
192
192
|
*
|
|
193
193
|
* Default is `null` i.e not set
|
|
194
194
|
*
|
|
195
|
-
* @
|
|
195
|
+
* @remarks Platform: Android
|
|
196
196
|
*/
|
|
197
|
-
forceReuseVideoCodecReasons?:
|
|
197
|
+
forceReuseVideoCodecReasons?: ForceReuseVideoCodecReason[];
|
|
198
198
|
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { NativeModule, requireNativeModule } from 'expo-modules-core';
|
|
2
|
+
|
|
3
|
+
export type CustomMessageHandlerModuleEvents = {
|
|
4
|
+
onReceivedSynchronousMessage: ({
|
|
5
|
+
nativeId,
|
|
6
|
+
id,
|
|
7
|
+
message,
|
|
8
|
+
data,
|
|
9
|
+
}: {
|
|
10
|
+
nativeId: string;
|
|
11
|
+
id: number;
|
|
12
|
+
message: string;
|
|
13
|
+
data: string | undefined;
|
|
14
|
+
}) => void;
|
|
15
|
+
onReceivedAsynchronousMessage: ({
|
|
16
|
+
nativeId,
|
|
17
|
+
message,
|
|
18
|
+
data,
|
|
19
|
+
}: {
|
|
20
|
+
nativeId: string;
|
|
21
|
+
message: string;
|
|
22
|
+
data: string | undefined;
|
|
23
|
+
}) => void;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Native CustomMessageHandlerModule using Expo modules API.
|
|
28
|
+
* Provides modern async/await interface while maintaining backward compatibility.
|
|
29
|
+
*/
|
|
30
|
+
declare class CustomMessageHandlerModule extends NativeModule<CustomMessageHandlerModuleEvents> {
|
|
31
|
+
registerHandler(nativeId: string): Promise<void>;
|
|
32
|
+
destroy(nativeId: string): Promise<void>;
|
|
33
|
+
onReceivedSynchronousMessageResult(
|
|
34
|
+
id: number,
|
|
35
|
+
result: string | undefined
|
|
36
|
+
): Promise<void>;
|
|
37
|
+
sendMessage(
|
|
38
|
+
nativeId: string,
|
|
39
|
+
message: string,
|
|
40
|
+
data: string | undefined
|
|
41
|
+
): Promise<void>;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export default requireNativeModule<CustomMessageHandlerModule>(
|
|
45
|
+
'CustomMessageHandlerModule'
|
|
46
|
+
);
|