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/build/player.js
ADDED
|
@@ -0,0 +1,445 @@
|
|
|
1
|
+
import { Platform } from 'react-native';
|
|
2
|
+
import PlayerModule from './modules/PlayerModule';
|
|
3
|
+
import NativeInstance from './nativeInstance';
|
|
4
|
+
import { Source } from './source';
|
|
5
|
+
import { AnalyticsApi } from './analytics/player';
|
|
6
|
+
import { BufferApi } from './bufferApi';
|
|
7
|
+
import { Network } from './network';
|
|
8
|
+
import { DecoderConfigBridge } from './decoder';
|
|
9
|
+
/**
|
|
10
|
+
* Loads, controls and renders audio and video content represented through {@link Source}s. A player
|
|
11
|
+
* instance can be created via the {@link usePlayer} hook and will idle until one or more {@link Source}s are
|
|
12
|
+
* loaded. Once {@link Player.load} or {@link Player.loadSource} is called, the player becomes active and initiates necessary downloads to
|
|
13
|
+
* start playback of the loaded source(s).
|
|
14
|
+
*
|
|
15
|
+
* Can be attached to {@link PlayerView} component in order to use Bitmovin's Player Web UI.
|
|
16
|
+
* @see PlayerView
|
|
17
|
+
*/
|
|
18
|
+
export class Player extends NativeInstance {
|
|
19
|
+
/**
|
|
20
|
+
* Whether the native `Player` object has been created.
|
|
21
|
+
*/
|
|
22
|
+
isInitialized = false;
|
|
23
|
+
/**
|
|
24
|
+
* Whether the native `Player` object has been disposed.
|
|
25
|
+
*/
|
|
26
|
+
isDestroyed = false;
|
|
27
|
+
/**
|
|
28
|
+
* Currently active source, or `null` if none is active.
|
|
29
|
+
*/
|
|
30
|
+
source;
|
|
31
|
+
/**
|
|
32
|
+
* The `AnalyticsApi` for interactions regarding the `Player`'s analytics.
|
|
33
|
+
*
|
|
34
|
+
* `undefined` if the player was created without analytics support.
|
|
35
|
+
*/
|
|
36
|
+
analytics = undefined;
|
|
37
|
+
/**
|
|
38
|
+
* The {@link BufferApi} for interactions regarding the buffer.
|
|
39
|
+
*/
|
|
40
|
+
buffer = new BufferApi(this.nativeId);
|
|
41
|
+
network;
|
|
42
|
+
decoderConfig;
|
|
43
|
+
/**
|
|
44
|
+
* Allocates the native `Player` instance and its resources natively.
|
|
45
|
+
*/
|
|
46
|
+
initialize = async () => {
|
|
47
|
+
if (!this.isInitialized) {
|
|
48
|
+
if (this.config?.networkConfig) {
|
|
49
|
+
this.network = new Network(this.config.networkConfig);
|
|
50
|
+
await this.network.initialize();
|
|
51
|
+
}
|
|
52
|
+
await this.maybeInitDecoderConfig();
|
|
53
|
+
const analyticsConfig = this.config?.analyticsConfig;
|
|
54
|
+
if (analyticsConfig) {
|
|
55
|
+
await PlayerModule.initializeWithAnalyticsConfig(this.nativeId, analyticsConfig, this.config, this.network?.nativeId, this.decoderConfig?.nativeId);
|
|
56
|
+
this.analytics = new AnalyticsApi(this.nativeId);
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
await PlayerModule.initializeWithConfig(this.nativeId, this.config, this.network?.nativeId, this.decoderConfig?.nativeId);
|
|
60
|
+
}
|
|
61
|
+
this.isInitialized = true;
|
|
62
|
+
}
|
|
63
|
+
return Promise.resolve();
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* Destroys the native `Player` and releases all of its allocated resources.
|
|
67
|
+
*/
|
|
68
|
+
destroy = () => {
|
|
69
|
+
if (!this.isDestroyed) {
|
|
70
|
+
PlayerModule.destroy(this.nativeId);
|
|
71
|
+
this.source?.destroy();
|
|
72
|
+
this.network?.destroy();
|
|
73
|
+
this.decoderConfig?.destroy();
|
|
74
|
+
this.isDestroyed = true;
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
/**
|
|
78
|
+
* Loads a new {@link Source} from `sourceConfig` into the player.
|
|
79
|
+
*/
|
|
80
|
+
load = (sourceConfig) => {
|
|
81
|
+
this.loadSource(new Source(sourceConfig));
|
|
82
|
+
};
|
|
83
|
+
/**
|
|
84
|
+
* Loads the downloaded content from {@link OfflineContentManager} into the player.
|
|
85
|
+
*/
|
|
86
|
+
loadOfflineContent = (offlineContentManager, options) => {
|
|
87
|
+
PlayerModule.loadOfflineContent(this.nativeId, offlineContentManager.nativeId, options);
|
|
88
|
+
};
|
|
89
|
+
/**
|
|
90
|
+
* Loads the given {@link Source} into the player.
|
|
91
|
+
*/
|
|
92
|
+
loadSource = (source) => {
|
|
93
|
+
this.source = source;
|
|
94
|
+
source.initialize().then(() => {
|
|
95
|
+
PlayerModule.loadSource(this.nativeId, source.nativeId);
|
|
96
|
+
});
|
|
97
|
+
};
|
|
98
|
+
/**
|
|
99
|
+
* Unloads all {@link Source}s from the player.
|
|
100
|
+
*/
|
|
101
|
+
unload = () => {
|
|
102
|
+
PlayerModule.unload(this.nativeId);
|
|
103
|
+
};
|
|
104
|
+
/**
|
|
105
|
+
* Starts or resumes playback after being paused. Has no effect if the player is already playing.
|
|
106
|
+
*/
|
|
107
|
+
play = () => {
|
|
108
|
+
PlayerModule.play(this.nativeId);
|
|
109
|
+
};
|
|
110
|
+
/**
|
|
111
|
+
* Pauses the video if it is playing. Has no effect if the player is already paused.
|
|
112
|
+
*/
|
|
113
|
+
pause = () => {
|
|
114
|
+
PlayerModule.pause(this.nativeId);
|
|
115
|
+
};
|
|
116
|
+
/**
|
|
117
|
+
* Seeks to the given playback time specified by the parameter `time` in seconds. Must not be
|
|
118
|
+
* greater than the total duration of the video. Has no effect when watching a live stream since
|
|
119
|
+
* seeking is not possible.
|
|
120
|
+
*
|
|
121
|
+
* @param time - The time to seek to in seconds.
|
|
122
|
+
*/
|
|
123
|
+
seek = (time) => {
|
|
124
|
+
PlayerModule.seek(this.nativeId, time);
|
|
125
|
+
};
|
|
126
|
+
/**
|
|
127
|
+
* Shifts the time to the given `offset` in seconds from the live edge. The resulting offset has to be within the
|
|
128
|
+
* timeShift window as specified by `maxTimeShift` (which is a negative value) and 0. When the provided `offset` is
|
|
129
|
+
* positive, it will be interpreted as a UNIX timestamp in seconds and converted to fit into the timeShift window.
|
|
130
|
+
* When the provided `offset` is negative, but lower than `maxTimeShift`, then it will be clamped to `maxTimeShift`.
|
|
131
|
+
* Has no effect for VoD.
|
|
132
|
+
*
|
|
133
|
+
* Has no effect if no sources are loaded.
|
|
134
|
+
*
|
|
135
|
+
* @param offset - Target offset from the live edge in seconds.
|
|
136
|
+
*/
|
|
137
|
+
timeShift = (offset) => {
|
|
138
|
+
PlayerModule.timeShift(this.nativeId, offset);
|
|
139
|
+
};
|
|
140
|
+
/**
|
|
141
|
+
* Mutes the player if an audio track is available. Has no effect if the player is already muted.
|
|
142
|
+
*/
|
|
143
|
+
mute = () => {
|
|
144
|
+
PlayerModule.mute(this.nativeId);
|
|
145
|
+
};
|
|
146
|
+
/**
|
|
147
|
+
* Unmutes the player if it is muted. Has no effect if the player is already unmuted.
|
|
148
|
+
*/
|
|
149
|
+
unmute = () => {
|
|
150
|
+
PlayerModule.unmute(this.nativeId);
|
|
151
|
+
};
|
|
152
|
+
/**
|
|
153
|
+
* Sets the player's volume between 0 (silent) and 100 (max volume).
|
|
154
|
+
*
|
|
155
|
+
* @param volume - The volume level to set.
|
|
156
|
+
*/
|
|
157
|
+
setVolume = (volume) => {
|
|
158
|
+
PlayerModule.setVolume(this.nativeId, volume);
|
|
159
|
+
};
|
|
160
|
+
/**
|
|
161
|
+
* @returns The player's current volume level.
|
|
162
|
+
*/
|
|
163
|
+
getVolume = async () => {
|
|
164
|
+
return (await PlayerModule.getVolume(this.nativeId)) ?? 0;
|
|
165
|
+
};
|
|
166
|
+
/**
|
|
167
|
+
* @returns The current playback time in seconds.
|
|
168
|
+
*
|
|
169
|
+
* For VoD streams the returned time ranges between 0 and the duration of the asset.
|
|
170
|
+
*
|
|
171
|
+
* For live streams it can be specified if an absolute UNIX timestamp or a value
|
|
172
|
+
* relative to the playback start should be returned.
|
|
173
|
+
*
|
|
174
|
+
* @param mode - The time mode to specify: an absolute UNIX timestamp ('absolute') or relative time ('relative').
|
|
175
|
+
*/
|
|
176
|
+
getCurrentTime = async (mode = 'absolute') => {
|
|
177
|
+
return (await PlayerModule.currentTime(this.nativeId, mode)) ?? 0;
|
|
178
|
+
};
|
|
179
|
+
/**
|
|
180
|
+
* @returns The total duration in seconds of the current video or INFINITY if it’s a live stream.
|
|
181
|
+
*/
|
|
182
|
+
getDuration = async () => {
|
|
183
|
+
return (await PlayerModule.duration(this.nativeId)) ?? 0;
|
|
184
|
+
};
|
|
185
|
+
/**
|
|
186
|
+
* @returns `true` if the player is muted.
|
|
187
|
+
*/
|
|
188
|
+
isMuted = async () => {
|
|
189
|
+
return (await PlayerModule.isMuted(this.nativeId)) ?? false;
|
|
190
|
+
};
|
|
191
|
+
/**
|
|
192
|
+
* @returns `true` if the player is currently playing, i.e. has started and is not paused.
|
|
193
|
+
*/
|
|
194
|
+
isPlaying = async () => {
|
|
195
|
+
return (await PlayerModule.isPlaying(this.nativeId)) ?? false;
|
|
196
|
+
};
|
|
197
|
+
/**
|
|
198
|
+
* @returns `true` if the player has started playback but it's currently paused.
|
|
199
|
+
*/
|
|
200
|
+
isPaused = async () => {
|
|
201
|
+
return (await PlayerModule.isPaused(this.nativeId)) ?? false;
|
|
202
|
+
};
|
|
203
|
+
/**
|
|
204
|
+
* @returns `true` if the displayed video is a live stream.
|
|
205
|
+
*/
|
|
206
|
+
isLive = async () => {
|
|
207
|
+
return (await PlayerModule.isLive(this.nativeId)) ?? false;
|
|
208
|
+
};
|
|
209
|
+
/**
|
|
210
|
+
* @remarks Only available for iOS devices.
|
|
211
|
+
* @returns `true` when media is played externally using AirPlay.
|
|
212
|
+
*/
|
|
213
|
+
isAirPlayActive = async () => {
|
|
214
|
+
if (Platform.OS === 'android') {
|
|
215
|
+
console.warn(`[Player ${this.nativeId}] Method isAirPlayActive is not available for Android. Only iOS devices.`);
|
|
216
|
+
return false;
|
|
217
|
+
}
|
|
218
|
+
return (await PlayerModule.isAirPlayActive(this.nativeId)) ?? false;
|
|
219
|
+
};
|
|
220
|
+
/**
|
|
221
|
+
* @remarks Only available for iOS devices.
|
|
222
|
+
* @returns `true` when AirPlay is available.
|
|
223
|
+
*/
|
|
224
|
+
isAirPlayAvailable = async () => {
|
|
225
|
+
if (Platform.OS === 'android') {
|
|
226
|
+
console.warn(`[Player ${this.nativeId}] Method isAirPlayAvailable is not available for Android. Only iOS devices.`);
|
|
227
|
+
return false;
|
|
228
|
+
}
|
|
229
|
+
return (await PlayerModule.isAirPlayAvailable(this.nativeId)) ?? false;
|
|
230
|
+
};
|
|
231
|
+
/**
|
|
232
|
+
* @returns The currently selected audio track or `null`.
|
|
233
|
+
*/
|
|
234
|
+
getAudioTrack = async () => {
|
|
235
|
+
return PlayerModule.getAudioTrack(this.nativeId);
|
|
236
|
+
};
|
|
237
|
+
/**
|
|
238
|
+
* @returns An array containing {@link AudioTrack} objects for all available audio tracks.
|
|
239
|
+
*/
|
|
240
|
+
getAvailableAudioTracks = async () => {
|
|
241
|
+
return PlayerModule.getAvailableAudioTracks(this.nativeId);
|
|
242
|
+
};
|
|
243
|
+
/**
|
|
244
|
+
* Sets the audio track to the ID specified by trackIdentifier. A list can be retrieved by calling getAvailableAudioTracks.
|
|
245
|
+
*
|
|
246
|
+
* @param trackIdentifier - The {@link AudioTrack.identifier} to be set.
|
|
247
|
+
*/
|
|
248
|
+
setAudioTrack = async (trackIdentifier) => {
|
|
249
|
+
return PlayerModule.setAudioTrack(this.nativeId, trackIdentifier);
|
|
250
|
+
};
|
|
251
|
+
/**
|
|
252
|
+
* @returns The currently selected {@link SubtitleTrack} or `null`.
|
|
253
|
+
*/
|
|
254
|
+
getSubtitleTrack = async () => {
|
|
255
|
+
return PlayerModule.getSubtitleTrack(this.nativeId);
|
|
256
|
+
};
|
|
257
|
+
/**
|
|
258
|
+
* @returns An array containing SubtitleTrack objects for all available subtitle tracks.
|
|
259
|
+
*/
|
|
260
|
+
getAvailableSubtitles = async () => {
|
|
261
|
+
return PlayerModule.getAvailableSubtitles(this.nativeId);
|
|
262
|
+
};
|
|
263
|
+
/**
|
|
264
|
+
* Sets the subtitle track to the ID specified by trackIdentifier. A list can be retrieved by calling getAvailableSubtitles.
|
|
265
|
+
*
|
|
266
|
+
* @param trackIdentifier - The {@link SubtitleTrack.identifier} to be set.
|
|
267
|
+
*/
|
|
268
|
+
setSubtitleTrack = async (trackIdentifier) => {
|
|
269
|
+
return PlayerModule.setSubtitleTrack(this.nativeId, trackIdentifier ?? '');
|
|
270
|
+
};
|
|
271
|
+
/**
|
|
272
|
+
* Dynamically schedules the {@link AdItem} for playback.
|
|
273
|
+
* Has no effect if there is no active playback session.
|
|
274
|
+
*
|
|
275
|
+
* @param adItem - Ad to be scheduled for playback.
|
|
276
|
+
*
|
|
277
|
+
* @remarks Platform: iOS, Android
|
|
278
|
+
*/
|
|
279
|
+
scheduleAd = (adItem) => {
|
|
280
|
+
PlayerModule.scheduleAd(this.nativeId, adItem);
|
|
281
|
+
};
|
|
282
|
+
/**
|
|
283
|
+
* Skips the current ad.
|
|
284
|
+
* Has no effect if the current ad is not skippable or if no ad is being played back.
|
|
285
|
+
*
|
|
286
|
+
* @remarks Platform: iOS, Android
|
|
287
|
+
*/
|
|
288
|
+
skipAd = () => {
|
|
289
|
+
PlayerModule.skipAd(this.nativeId);
|
|
290
|
+
};
|
|
291
|
+
/**
|
|
292
|
+
* @returns `true` while an ad is being played back or when main content playback has been paused for ad playback.
|
|
293
|
+
* @remarks Platform: iOS, Android
|
|
294
|
+
*/
|
|
295
|
+
isAd = async () => {
|
|
296
|
+
return (await PlayerModule.isAd(this.nativeId)) ?? false;
|
|
297
|
+
};
|
|
298
|
+
/**
|
|
299
|
+
* The current time shift of the live stream in seconds. This value is always 0 if the active {@link Source} is not a
|
|
300
|
+
* live stream or no sources are loaded.
|
|
301
|
+
*/
|
|
302
|
+
getTimeShift = async () => {
|
|
303
|
+
return (await PlayerModule.getTimeShift(this.nativeId)) ?? 0;
|
|
304
|
+
};
|
|
305
|
+
/**
|
|
306
|
+
* The limit in seconds for time shifting. This value is either negative or 0 and it is always 0 if the active
|
|
307
|
+
* {@link Source} is not a live stream or no sources are loaded.
|
|
308
|
+
*/
|
|
309
|
+
getMaxTimeShift = async () => {
|
|
310
|
+
return (await PlayerModule.getMaxTimeShift(this.nativeId)) ?? 0;
|
|
311
|
+
};
|
|
312
|
+
/**
|
|
313
|
+
* Sets the upper bitrate boundary for video qualities. All qualities with a bitrate
|
|
314
|
+
* that is higher than this threshold will not be eligible for automatic quality selection.
|
|
315
|
+
*
|
|
316
|
+
* Can be set to `null` for no limitation.
|
|
317
|
+
*/
|
|
318
|
+
setMaxSelectableBitrate = (bitrate) => {
|
|
319
|
+
PlayerModule.setMaxSelectableBitrate(this.nativeId, bitrate || -1);
|
|
320
|
+
};
|
|
321
|
+
/**
|
|
322
|
+
* @returns a {@link Thumbnail} for the specified playback time for the currently active source if available.
|
|
323
|
+
* Supported thumbnail formats are:
|
|
324
|
+
* - `WebVtt` configured via {@link SourceConfig.thumbnailTrack}, on all supported platforms
|
|
325
|
+
* - HLS `Image Media Playlist` in the multivariant playlist, Android-only
|
|
326
|
+
* - DASH `Image Adaptation Set` as specified in DASH-IF IOP, Android-only
|
|
327
|
+
* If a `WebVtt` thumbnail track is provided, any potential in-manifest thumbnails are ignored on Android.
|
|
328
|
+
*
|
|
329
|
+
* @param time - The time in seconds for which to retrieve the thumbnail.
|
|
330
|
+
*/
|
|
331
|
+
getThumbnail = async (time) => {
|
|
332
|
+
return PlayerModule.getThumbnail(this.nativeId, time);
|
|
333
|
+
};
|
|
334
|
+
/**
|
|
335
|
+
* Whether casting to a cast-compatible remote device is available. {@link CastAvailableEvent} signals when
|
|
336
|
+
* casting becomes available.
|
|
337
|
+
*
|
|
338
|
+
* @remarks Platform: iOS, Android
|
|
339
|
+
*/
|
|
340
|
+
isCastAvailable = async () => {
|
|
341
|
+
return (await PlayerModule.isCastAvailable(this.nativeId)) ?? false;
|
|
342
|
+
};
|
|
343
|
+
/**
|
|
344
|
+
* Whether video is currently being casted to a remote device and not played locally.
|
|
345
|
+
*
|
|
346
|
+
* @remarks Platform: iOS, Android
|
|
347
|
+
*/
|
|
348
|
+
isCasting = async () => {
|
|
349
|
+
return (await PlayerModule.isCasting(this.nativeId)) ?? false;
|
|
350
|
+
};
|
|
351
|
+
/**
|
|
352
|
+
* Initiates casting the current video to a cast-compatible remote device. The user has to choose to which device it
|
|
353
|
+
* should be sent.
|
|
354
|
+
*
|
|
355
|
+
* @remarks Platform: iOS, Android
|
|
356
|
+
*/
|
|
357
|
+
castVideo = () => {
|
|
358
|
+
PlayerModule.castVideo(this.nativeId);
|
|
359
|
+
};
|
|
360
|
+
/**
|
|
361
|
+
* Stops casting the current video. Has no effect if {@link Player.isCasting} is `false`.
|
|
362
|
+
*
|
|
363
|
+
* @remarks Platform: iOS, Android
|
|
364
|
+
*/
|
|
365
|
+
castStop = () => {
|
|
366
|
+
PlayerModule.castStop(this.nativeId);
|
|
367
|
+
};
|
|
368
|
+
/**
|
|
369
|
+
* Returns the currently selected video quality.
|
|
370
|
+
* @returns The currently selected video quality.
|
|
371
|
+
*/
|
|
372
|
+
getVideoQuality = async () => {
|
|
373
|
+
return PlayerModule.getVideoQuality(this.nativeId);
|
|
374
|
+
};
|
|
375
|
+
/**
|
|
376
|
+
* Returns an array containing all available video qualities the player can adapt between.
|
|
377
|
+
* @returns An array containing all available video qualities the player can adapt between.
|
|
378
|
+
*/
|
|
379
|
+
getAvailableVideoQualities = async () => {
|
|
380
|
+
return PlayerModule.getAvailableVideoQualities(this.nativeId);
|
|
381
|
+
};
|
|
382
|
+
/**
|
|
383
|
+
* Sets the video quality.
|
|
384
|
+
* @remarks Platform: Android
|
|
385
|
+
*
|
|
386
|
+
* @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.
|
|
387
|
+
*/
|
|
388
|
+
setVideoQuality = (qualityId) => {
|
|
389
|
+
if (Platform.OS !== 'android') {
|
|
390
|
+
console.warn(`[Player ${this.nativeId}] Method setVideoQuality is not available for iOS and tvOS devices. Only Android devices.`);
|
|
391
|
+
return;
|
|
392
|
+
}
|
|
393
|
+
PlayerModule.setVideoQuality(this.nativeId, qualityId);
|
|
394
|
+
};
|
|
395
|
+
/**
|
|
396
|
+
* Sets the playback speed of the player. Fast forward, slow motion and reverse playback are supported.
|
|
397
|
+
* @remarks
|
|
398
|
+
* Platform: iOS, tvOS
|
|
399
|
+
*
|
|
400
|
+
* - Slow motion is indicated by values between `0` and `1`.
|
|
401
|
+
* - Fast forward by values greater than `1`.
|
|
402
|
+
* - Slow reverse is used by values between `0` and `-1`, and fast reverse is used by values less than `-1`. iOS and tvOS only.
|
|
403
|
+
* - Negative values are ignored during Casting and on Android.
|
|
404
|
+
* - During reverse playback the playback will continue until the beginning of the active source is
|
|
405
|
+
* reached. When reaching the beginning of the source, playback will be paused and the playback
|
|
406
|
+
* speed will be reset to its default value of `1`. No {@link PlaybackFinishedEvent} will be
|
|
407
|
+
* emitted in this case.
|
|
408
|
+
*
|
|
409
|
+
* @param playbackSpeed - The playback speed to set.
|
|
410
|
+
*/
|
|
411
|
+
setPlaybackSpeed = (playbackSpeed) => {
|
|
412
|
+
PlayerModule.setPlaybackSpeed(this.nativeId, playbackSpeed);
|
|
413
|
+
};
|
|
414
|
+
/**
|
|
415
|
+
* @see {@link setPlaybackSpeed} for details on which values playback speed can assume.
|
|
416
|
+
* @returns The player's current playback speed.
|
|
417
|
+
*/
|
|
418
|
+
getPlaybackSpeed = async () => {
|
|
419
|
+
return (await PlayerModule.getPlaybackSpeed(this.nativeId)) ?? 0;
|
|
420
|
+
};
|
|
421
|
+
/**
|
|
422
|
+
* Checks the possibility to play the media at specified playback speed.
|
|
423
|
+
* @param playbackSpeed - The playback speed to check.
|
|
424
|
+
* @returns `true` if it's possible to play the media at the specified playback speed, otherwise `false`. On Android it always returns `undefined`.
|
|
425
|
+
* @remarks Platform: iOS, tvOS
|
|
426
|
+
*/
|
|
427
|
+
canPlayAtPlaybackSpeed = async (playbackSpeed) => {
|
|
428
|
+
if (Platform.OS === 'android') {
|
|
429
|
+
console.warn(`[Player ${this.nativeId}] Method canPlayAtPlaybackSpeed is not available for Android. Only iOS and tvOS devices.`);
|
|
430
|
+
return undefined;
|
|
431
|
+
}
|
|
432
|
+
return ((await PlayerModule.canPlayAtPlaybackSpeed(this.nativeId, playbackSpeed)) ?? false);
|
|
433
|
+
};
|
|
434
|
+
maybeInitDecoderConfig = () => {
|
|
435
|
+
if (this.config?.playbackConfig?.decoderConfig == null) {
|
|
436
|
+
return;
|
|
437
|
+
}
|
|
438
|
+
if (Platform.OS === 'ios') {
|
|
439
|
+
return;
|
|
440
|
+
}
|
|
441
|
+
this.decoderConfig = new DecoderConfigBridge(this.config.playbackConfig.decoderConfig);
|
|
442
|
+
this.decoderConfig.initialize();
|
|
443
|
+
};
|
|
444
|
+
}
|
|
445
|
+
//# sourceMappingURL=player.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"player.js","sourceRoot":"","sources":["../src/player.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,YAAY,MAAM,wBAAwB,CAAC;AAClD,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAgB,MAAM,UAAU,CAAC;AAKhD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAGlD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAEhD;;;;;;;;GAQG;AACH,MAAM,OAAO,MAAO,SAAQ,cAA4B;IACtD;;OAEG;IACH,aAAa,GAAG,KAAK,CAAC;IACtB;;OAEG;IACH,WAAW,GAAG,KAAK,CAAC;IACpB;;OAEG;IACH,MAAM,CAAU;IAChB;;;;OAIG;IACH,SAAS,GAAkB,S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;IACH,sBAAsB,GAAG,KAAK,EAC5B,aAAqB,EACS,EAAE;QAChC,IAAI,QAAQ,CAAC,EAAE,KAAK,SAAS,EAAE,CAAC;YAC9B,OAAO,CAAC,IAAI,CACV,WAAW,IAAI,CAAC,QAAQ,0FAA0F,CACnH,CAAC;YACF,OAAO,SAAS,CAAC;QACnB,CAAC;QACD,OAAO,CACL,CAAC,MAAM,YAAY,CAAC,sBAAsB,CACxC,IAAI,CAAC,QAAQ,EACb,aAAa,CACd,CAAC,IAAI,KAAK,CACZ,CAAC;IACJ,CAAC,CAAC;IAEM,sBAAsB,GAAG,GAAG,EAAE;QACpC,IAAI,IAAI,CAAC,MAAM,EAAE,cAAc,EAAE,aAAa,IAAI,IAAI,EAAE,CAAC;YACvD,OAAO;QACT,CAAC;QACD,IAAI,QAAQ,CAAC,EAAE,KAAK,KAAK,EAAE,CAAC;YAC1B,OAAO;QACT,CAAC;QAED,IAAI,CAAC,aAAa,GAAG,IAAI,mBAAmB,CAC1C,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,aAAa,CACzC,CAAC;QACF,IAAI,CAAC,aAAa,CAAC,UAAU,EAAE,CAAC;IAClC,CAAC,CAAC;CACH","sourcesContent":["import { Platform } from 'react-native';\nimport PlayerModule from './modules/PlayerModule';\nimport NativeInstance from './nativeInstance';\nimport { Source, SourceConfig } from './source';\nimport { AudioTrack } from './audioTrack';\nimport { SubtitleTrack } from './subtitleTrack';\nimport { OfflineContentManager, OfflineSourceOptions } from './offline';\nimport { Thumbnail } from './thumbnail';\nimport { AnalyticsApi } from './analytics/player';\nimport { PlayerConfig } from './playerConfig';\nimport { AdItem } from './advertising';\nimport { BufferApi } from './bufferApi';\nimport { VideoQuality } from './media';\nimport { Network } from './network';\nimport { DecoderConfigBridge } from './decoder';\n\n/**\n * Loads, controls and renders audio and video content represented through {@link Source}s. A player\n * instance can be created via the {@link usePlayer} hook and will idle until one or more {@link Source}s are\n * loaded. Once {@link Player.load} or {@link Player.loadSource} is called, the player becomes active and initiates necessary downloads to\n * start playback of the loaded source(s).\n *\n * Can be attached to {@link PlayerView} component in order to use Bitmovin's Player Web UI.\n * @see PlayerView\n */\nexport class Player extends NativeInstance<PlayerConfig> {\n /**\n * Whether the native `Player` object has been created.\n */\n isInitialized = false;\n /**\n * Whether the native `Player` object has been disposed.\n */\n isDestroyed = false;\n /**\n * Currently active source, or `null` if none is active.\n */\n source?: Source;\n /**\n * The `AnalyticsApi` for interactions regarding the `Player`'s analytics.\n *\n * `undefined` if the player was created without analytics support.\n */\n analytics?: AnalyticsApi = undefined;\n /**\n * The {@link BufferApi} for interactions regarding the buffer.\n */\n buffer: BufferApi = new BufferApi(this.nativeId);\n\n private network?: Network;\n\n private decoderConfig?: DecoderConfigBridge;\n /**\n * Allocates the native `Player` instance and its resources natively.\n */\n initialize = async (): Promise<void> => {\n if (!this.isInitialized) {\n if (this.config?.networkConfig) {\n this.network = new Network(this.config.networkConfig);\n await this.network.initialize();\n }\n await this.maybeInitDecoderConfig();\n const analyticsConfig = this.config?.analyticsConfig;\n if (analyticsConfig) {\n await PlayerModule.initializeWithAnalyticsConfig(\n this.nativeId,\n analyticsConfig,\n this.config,\n this.network?.nativeId,\n this.decoderConfig?.nativeId\n );\n this.analytics = new AnalyticsApi(this.nativeId);\n } else {\n await PlayerModule.initializeWithConfig(\n this.nativeId,\n this.config,\n this.network?.nativeId,\n this.decoderConfig?.nativeId\n );\n }\n\n this.isInitialized = true;\n }\n return Promise.resolve();\n };\n\n /**\n * Destroys the native `Player` and releases all of its allocated resources.\n */\n destroy = () => {\n if (!this.isDestroyed) {\n PlayerModule.destroy(this.nativeId);\n this.source?.destroy();\n this.network?.destroy();\n this.decoderConfig?.destroy();\n this.isDestroyed = true;\n }\n };\n\n /**\n * Loads a new {@link Source} from `sourceConfig` into the player.\n */\n load = (sourceConfig: SourceConfig) => {\n this.loadSource(new Source(sourceConfig));\n };\n\n /**\n * Loads the downloaded content from {@link OfflineContentManager} into the player.\n */\n loadOfflineContent = (\n offlineContentManager: OfflineContentManager,\n options?: OfflineSourceOptions\n ) => {\n PlayerModule.loadOfflineContent(\n this.nativeId,\n offlineContentManager.nativeId,\n options\n );\n };\n\n /**\n * Loads the given {@link Source} into the player.\n */\n loadSource = (source: Source) => {\n this.source = source;\n source.initialize().then(() => {\n PlayerModule.loadSource(this.nativeId, source.nativeId);\n });\n };\n\n /**\n * Unloads all {@link Source}s from the player.\n */\n unload = () => {\n PlayerModule.unload(this.nativeId);\n };\n\n /**\n * Starts or resumes playback after being paused. Has no effect if the player is already playing.\n */\n play = () => {\n PlayerModule.play(this.nativeId);\n };\n\n /**\n * Pauses the video if it is playing. Has no effect if the player is already paused.\n */\n pause = () => {\n PlayerModule.pause(this.nativeId);\n };\n\n /**\n * Seeks to the given playback time specified by the parameter `time` in seconds. Must not be\n * greater than the total duration of the video. Has no effect when watching a live stream since\n * seeking is not possible.\n *\n * @param time - The time to seek to in seconds.\n */\n seek = (time: number) => {\n PlayerModule.seek(this.nativeId, time);\n };\n\n /**\n * Shifts the time to the given `offset` in seconds from the live edge. The resulting offset has to be within the\n * timeShift window as specified by `maxTimeShift` (which is a negative value) and 0. When the provided `offset` is\n * positive, it will be interpreted as a UNIX timestamp in seconds and converted to fit into the timeShift window.\n * When the provided `offset` is negative, but lower than `maxTimeShift`, then it will be clamped to `maxTimeShift`.\n * Has no effect for VoD.\n *\n * Has no effect if no sources are loaded.\n *\n * @param offset - Target offset from the live edge in seconds.\n */\n timeShift = (offset: number) => {\n PlayerModule.timeShift(this.nativeId, offset);\n };\n\n /**\n * Mutes the player if an audio track is available. Has no effect if the player is already muted.\n */\n mute = () => {\n PlayerModule.mute(this.nativeId);\n };\n\n /**\n * Unmutes the player if it is muted. Has no effect if the player is already unmuted.\n */\n unmute = () => {\n PlayerModule.unmute(this.nativeId);\n };\n\n /**\n * Sets the player's volume between 0 (silent) and 100 (max volume).\n *\n * @param volume - The volume level to set.\n */\n setVolume = (volume: number) => {\n PlayerModule.setVolume(this.nativeId, volume);\n };\n\n /**\n * @returns The player's current volume level.\n */\n getVolume = async (): Promise<number> => {\n return (await PlayerModule.getVolume(this.nativeId)) ?? 0;\n };\n\n /**\n * @returns The current playback time in seconds.\n *\n * For VoD streams the returned time ranges between 0 and the duration of the asset.\n *\n * For live streams it can be specified if an absolute UNIX timestamp or a value\n * relative to the playback start should be returned.\n *\n * @param mode - The time mode to specify: an absolute UNIX timestamp ('absolute') or relative time ('relative').\n */\n getCurrentTime = async (\n mode: 'relative' | 'absolute' = 'absolute'\n ): Promise<number> => {\n return (await PlayerModule.currentTime(this.nativeId, mode)) ?? 0;\n };\n\n /**\n * @returns The total duration in seconds of the current video or INFINITY if it’s a live stream.\n */\n getDuration = async (): Promise<number> => {\n return (await PlayerModule.duration(this.nativeId)) ?? 0;\n };\n\n /**\n * @returns `true` if the player is muted.\n */\n isMuted = async (): Promise<boolean> => {\n return (await PlayerModule.isMuted(this.nativeId)) ?? false;\n };\n\n /**\n * @returns `true` if the player is currently playing, i.e. has started and is not paused.\n */\n isPlaying = async (): Promise<boolean> => {\n return (await PlayerModule.isPlaying(this.nativeId)) ?? false;\n };\n\n /**\n * @returns `true` if the player has started playback but it's currently paused.\n */\n isPaused = async (): Promise<boolean> => {\n return (await PlayerModule.isPaused(this.nativeId)) ?? false;\n };\n\n /**\n * @returns `true` if the displayed video is a live stream.\n */\n isLive = async (): Promise<boolean> => {\n return (await PlayerModule.isLive(this.nativeId)) ?? false;\n };\n\n /**\n * @remarks Only available for iOS devices.\n * @returns `true` when media is played externally using AirPlay.\n */\n isAirPlayActive = async (): Promise<boolean> => {\n if (Platform.OS === 'android') {\n console.warn(\n `[Player ${this.nativeId}] Method isAirPlayActive is not available for Android. Only iOS devices.`\n );\n return false;\n }\n return (await PlayerModule.isAirPlayActive(this.nativeId)) ?? false;\n };\n\n /**\n * @remarks Only available for iOS devices.\n * @returns `true` when AirPlay is available.\n */\n isAirPlayAvailable = async (): Promise<boolean> => {\n if (Platform.OS === 'android') {\n console.warn(\n `[Player ${this.nativeId}] Method isAirPlayAvailable is not available for Android. Only iOS devices.`\n );\n return false;\n }\n return (await PlayerModule.isAirPlayAvailable(this.nativeId)) ?? false;\n };\n\n /**\n * @returns The currently selected audio track or `null`.\n */\n getAudioTrack = async (): Promise<AudioTrack | null> => {\n return PlayerModule.getAudioTrack(this.nativeId);\n };\n\n /**\n * @returns An array containing {@link AudioTrack} objects for all available audio tracks.\n */\n getAvailableAudioTracks = async (): Promise<AudioTrack[]> => {\n return PlayerModule.getAvailableAudioTracks(this.nativeId);\n };\n\n /**\n * Sets the audio track to the ID specified by trackIdentifier. A list can be retrieved by calling getAvailableAudioTracks.\n *\n * @param trackIdentifier - The {@link AudioTrack.identifier} to be set.\n */\n setAudioTrack = async (trackIdentifier: string): Promise<void> => {\n return PlayerModule.setAudioTrack(this.nativeId, trackIdentifier);\n };\n\n /**\n * @returns The currently selected {@link SubtitleTrack} or `null`.\n */\n getSubtitleTrack = async (): Promise<SubtitleTrack | null> => {\n return PlayerModule.getSubtitleTrack(this.nativeId);\n };\n\n /**\n * @returns An array containing SubtitleTrack objects for all available subtitle tracks.\n */\n getAvailableSubtitles = async (): Promise<SubtitleTrack[]> => {\n return PlayerModule.getAvailableSubtitles(this.nativeId);\n };\n\n /**\n * Sets the subtitle track to the ID specified by trackIdentifier. A list can be retrieved by calling getAvailableSubtitles.\n *\n * @param trackIdentifier - The {@link SubtitleTrack.identifier} to be set.\n */\n setSubtitleTrack = async (trackIdentifier?: string): Promise<void> => {\n return PlayerModule.setSubtitleTrack(this.nativeId, trackIdentifier ?? '');\n };\n\n /**\n * Dynamically schedules the {@link AdItem} for playback.\n * Has no effect if there is no active playback session.\n *\n * @param adItem - Ad to be scheduled for playback.\n *\n * @remarks Platform: iOS, Android\n */\n scheduleAd = (adItem: AdItem) => {\n PlayerModule.scheduleAd(this.nativeId, adItem);\n };\n\n /**\n * Skips the current ad.\n * Has no effect if the current ad is not skippable or if no ad is being played back.\n *\n * @remarks Platform: iOS, Android\n */\n skipAd = () => {\n PlayerModule.skipAd(this.nativeId);\n };\n\n /**\n * @returns `true` while an ad is being played back or when main content playback has been paused for ad playback.\n * @remarks Platform: iOS, Android\n */\n isAd = async (): Promise<boolean> => {\n return (await PlayerModule.isAd(this.nativeId)) ?? false;\n };\n\n /**\n * The current time shift of the live stream in seconds. This value is always 0 if the active {@link Source} is not a\n * live stream or no sources are loaded.\n */\n getTimeShift = async (): Promise<number> => {\n return (await PlayerModule.getTimeShift(this.nativeId)) ?? 0;\n };\n\n /**\n * The limit in seconds for time shifting. This value is either negative or 0 and it is always 0 if the active\n * {@link Source} is not a live stream or no sources are loaded.\n */\n getMaxTimeShift = async (): Promise<number> => {\n return (await PlayerModule.getMaxTimeShift(this.nativeId)) ?? 0;\n };\n\n /**\n * Sets the upper bitrate boundary for video qualities. All qualities with a bitrate\n * that is higher than this threshold will not be eligible for automatic quality selection.\n *\n * Can be set to `null` for no limitation.\n */\n setMaxSelectableBitrate = (bitrate: number | null) => {\n PlayerModule.setMaxSelectableBitrate(this.nativeId, bitrate || -1);\n };\n\n /**\n * @returns a {@link Thumbnail} for the specified playback time for the currently active source if available.\n * Supported thumbnail formats are:\n * - `WebVtt` configured via {@link SourceConfig.thumbnailTrack}, on all supported platforms\n * - HLS `Image Media Playlist` in the multivariant playlist, Android-only\n * - DASH `Image Adaptation Set` as specified in DASH-IF IOP, Android-only\n * If a `WebVtt` thumbnail track is provided, any potential in-manifest thumbnails are ignored on Android.\n *\n * @param time - The time in seconds for which to retrieve the thumbnail.\n */\n getThumbnail = async (time: number): Promise<Thumbnail | null> => {\n return PlayerModule.getThumbnail(this.nativeId, time);\n };\n\n /**\n * Whether casting to a cast-compatible remote device is available. {@link CastAvailableEvent} signals when\n * casting becomes available.\n *\n * @remarks Platform: iOS, Android\n */\n isCastAvailable = async (): Promise<boolean> => {\n return (await PlayerModule.isCastAvailable(this.nativeId)) ?? false;\n };\n\n /**\n * Whether video is currently being casted to a remote device and not played locally.\n *\n * @remarks Platform: iOS, Android\n */\n isCasting = async (): Promise<boolean> => {\n return (await PlayerModule.isCasting(this.nativeId)) ?? false;\n };\n\n /**\n * Initiates casting the current video to a cast-compatible remote device. The user has to choose to which device it\n * should be sent.\n *\n * @remarks Platform: iOS, Android\n */\n castVideo = () => {\n PlayerModule.castVideo(this.nativeId);\n };\n\n /**\n * Stops casting the current video. Has no effect if {@link Player.isCasting} is `false`.\n *\n * @remarks Platform: iOS, Android\n */\n castStop = () => {\n PlayerModule.castStop(this.nativeId);\n };\n\n /**\n * Returns the currently selected video quality.\n * @returns The currently selected video quality.\n */\n getVideoQuality = async (): Promise<VideoQuality> => {\n return PlayerModule.getVideoQuality(this.nativeId);\n };\n\n /**\n * Returns an array containing all available video qualities the player can adapt between.\n * @returns An array containing all available video qualities the player can adapt between.\n */\n getAvailableVideoQualities = async (): Promise<VideoQuality[]> => {\n return PlayerModule.getAvailableVideoQualities(this.nativeId);\n };\n\n /**\n * Sets the video quality.\n * @remarks Platform: Android\n *\n * @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.\n */\n setVideoQuality = (qualityId: string) => {\n if (Platform.OS !== 'android') {\n console.warn(\n `[Player ${this.nativeId}] Method setVideoQuality is not available for iOS and tvOS devices. Only Android devices.`\n );\n return;\n }\n PlayerModule.setVideoQuality(this.nativeId, qualityId);\n };\n\n /**\n * Sets the playback speed of the player. Fast forward, slow motion and reverse playback are supported.\n * @remarks\n * Platform: iOS, tvOS\n *\n * - Slow motion is indicated by values between `0` and `1`.\n * - Fast forward by values greater than `1`.\n * - Slow reverse is used by values between `0` and `-1`, and fast reverse is used by values less than `-1`. iOS and tvOS only.\n * - Negative values are ignored during Casting and on Android.\n * - During reverse playback the playback will continue until the beginning of the active source is\n * reached. When reaching the beginning of the source, playback will be paused and the playback\n * speed will be reset to its default value of `1`. No {@link PlaybackFinishedEvent} will be\n * emitted in this case.\n *\n * @param playbackSpeed - The playback speed to set.\n */\n setPlaybackSpeed = (playbackSpeed: number) => {\n PlayerModule.setPlaybackSpeed(this.nativeId, playbackSpeed);\n };\n\n /**\n * @see {@link setPlaybackSpeed} for details on which values playback speed can assume.\n * @returns The player's current playback speed.\n */\n getPlaybackSpeed = async (): Promise<number> => {\n return (await PlayerModule.getPlaybackSpeed(this.nativeId)) ?? 0;\n };\n\n /**\n * Checks the possibility to play the media at specified playback speed.\n * @param playbackSpeed - The playback speed to check.\n * @returns `true` if it's possible to play the media at the specified playback speed, otherwise `false`. On Android it always returns `undefined`.\n * @remarks Platform: iOS, tvOS\n */\n canPlayAtPlaybackSpeed = async (\n playbackSpeed: number\n ): Promise<boolean | undefined> => {\n if (Platform.OS === 'android') {\n console.warn(\n `[Player ${this.nativeId}] Method canPlayAtPlaybackSpeed is not available for Android. Only iOS and tvOS devices.`\n );\n return undefined;\n }\n return (\n (await PlayerModule.canPlayAtPlaybackSpeed(\n this.nativeId,\n playbackSpeed\n )) ?? false\n );\n };\n\n private maybeInitDecoderConfig = () => {\n if (this.config?.playbackConfig?.decoderConfig == null) {\n return;\n }\n if (Platform.OS === 'ios') {\n return;\n }\n\n this.decoderConfig = new DecoderConfigBridge(\n this.config.playbackConfig.decoderConfig\n );\n this.decoderConfig.initialize();\n };\n}\n"]}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { AdvertisingConfig } from './advertising';
|
|
2
|
+
import { AnalyticsConfig } from './analytics';
|
|
3
|
+
import { StyleConfig } from './styleConfig';
|
|
4
|
+
import { TweaksConfig } from './tweaksConfig';
|
|
5
|
+
import { AdaptationConfig } from './adaptationConfig';
|
|
6
|
+
import { RemoteControlConfig } from './remoteControlConfig';
|
|
7
|
+
import { BufferConfig } from './bufferConfig';
|
|
8
|
+
import { NativeInstanceConfig } from './nativeInstance';
|
|
9
|
+
import { PlaybackConfig } from './playbackConfig';
|
|
10
|
+
import { LiveConfig } from './liveConfig';
|
|
11
|
+
import { NetworkConfig } from './network/networkConfig';
|
|
12
|
+
import { MediaControlConfig } from './mediaControlConfig';
|
|
13
|
+
/**
|
|
14
|
+
* Object used to configure a new `Player` instance.
|
|
15
|
+
*/
|
|
16
|
+
export interface PlayerConfig extends NativeInstanceConfig {
|
|
17
|
+
/**
|
|
18
|
+
* Bitmovin license key that can be found in the Bitmovin portal.
|
|
19
|
+
* If a license key is set here, it will be used instead of the license key found in the `Info.plist` and `AndroidManifest.xml`.
|
|
20
|
+
* @example
|
|
21
|
+
* Configuring the player license key from source code:
|
|
22
|
+
* ```
|
|
23
|
+
* const player = new Player({
|
|
24
|
+
* licenseKey: '\<LICENSE-KEY-CODE\>',
|
|
25
|
+
* });
|
|
26
|
+
* ```
|
|
27
|
+
* @example
|
|
28
|
+
* `licenseKey` can be safely omitted from source code if it has
|
|
29
|
+
* been configured in Info.plist/AndroidManifest.xml.
|
|
30
|
+
* ```
|
|
31
|
+
* const player = new Player(); // omit `licenseKey`
|
|
32
|
+
* player.play(); // call methods and properties...
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
licenseKey?: string;
|
|
36
|
+
/**
|
|
37
|
+
* Configures playback behaviour. A default {@link PlaybackConfig} is set initially.
|
|
38
|
+
*/
|
|
39
|
+
playbackConfig?: PlaybackConfig;
|
|
40
|
+
/**
|
|
41
|
+
* Configures the visual presentation and behaviour of the player UI. A default {@link StyleConfig} is set initially.
|
|
42
|
+
*/
|
|
43
|
+
styleConfig?: StyleConfig;
|
|
44
|
+
/**
|
|
45
|
+
* Configures advertising functionality. A default {@link AdvertisingConfig} is set initially.
|
|
46
|
+
*/
|
|
47
|
+
advertisingConfig?: AdvertisingConfig;
|
|
48
|
+
/**
|
|
49
|
+
* Configures experimental features. A default {@link TweaksConfig} is set initially.
|
|
50
|
+
*/
|
|
51
|
+
tweaksConfig?: TweaksConfig;
|
|
52
|
+
/**
|
|
53
|
+
* Configures analytics functionality.
|
|
54
|
+
*/
|
|
55
|
+
analyticsConfig?: AnalyticsConfig;
|
|
56
|
+
/**
|
|
57
|
+
* Configures adaptation logic.
|
|
58
|
+
*/
|
|
59
|
+
adaptationConfig?: AdaptationConfig;
|
|
60
|
+
/**
|
|
61
|
+
* Configures remote playback functionality.
|
|
62
|
+
*/
|
|
63
|
+
remoteControlConfig?: RemoteControlConfig;
|
|
64
|
+
/**
|
|
65
|
+
* Configures buffer settings. A default {@link BufferConfig} is set initially.
|
|
66
|
+
*/
|
|
67
|
+
bufferConfig?: BufferConfig;
|
|
68
|
+
/**
|
|
69
|
+
* Configures behaviour when playing live content. A default {@link LiveConfig} is set initially.
|
|
70
|
+
*/
|
|
71
|
+
liveConfig?: LiveConfig;
|
|
72
|
+
/**
|
|
73
|
+
* Configures network request manipulation functionality. A default {@link NetworkConfig} is set initially.
|
|
74
|
+
*/
|
|
75
|
+
networkConfig?: NetworkConfig;
|
|
76
|
+
/**
|
|
77
|
+
* Configures the media control information for the application. This information will be displayed
|
|
78
|
+
* wherever current media information typically appears, such as the lock screen, in notifications,
|
|
79
|
+
* and inside the control center.
|
|
80
|
+
*/
|
|
81
|
+
mediaControlConfig?: MediaControlConfig;
|
|
82
|
+
}
|
|
83
|
+
//# sourceMappingURL=playerConfig.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"playerConfig.d.ts","sourceRoot":"","sources":["../src/playerConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D;;GAEG;AACH,MAAM,WAAW,YAAa,SAAQ,oBAAoB;IACxD;;;;;;;;;;;;;;;;;OAiBG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC;;OAEG;IACH,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B;;OAEG;IACH,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC;;OAEG;IACH,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B;;OAEG;IACH,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC;;OAEG;IACH,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC;;OAEG;IACH,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;IAC1C;;OAEG;IACH,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B;;OAEG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB;;OAEG;IACH,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;CACzC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"playerConfig.js","sourceRoot":"","sources":["../src/playerConfig.ts"],"names":[],"mappings":"","sourcesContent":["import { AdvertisingConfig } from './advertising';\nimport { AnalyticsConfig } from './analytics';\nimport { StyleConfig } from './styleConfig';\nimport { TweaksConfig } from './tweaksConfig';\nimport { AdaptationConfig } from './adaptationConfig';\nimport { RemoteControlConfig } from './remoteControlConfig';\nimport { BufferConfig } from './bufferConfig';\nimport { NativeInstanceConfig } from './nativeInstance';\nimport { PlaybackConfig } from './playbackConfig';\nimport { LiveConfig } from './liveConfig';\nimport { NetworkConfig } from './network/networkConfig';\nimport { MediaControlConfig } from './mediaControlConfig';\n\n/**\n * Object used to configure a new `Player` instance.\n */\nexport interface PlayerConfig extends NativeInstanceConfig {\n /**\n * Bitmovin license key that can be found in the Bitmovin portal.\n * If a license key is set here, it will be used instead of the license key found in the `Info.plist` and `AndroidManifest.xml`.\n * @example\n * Configuring the player license key from source code:\n * ```\n * const player = new Player({\n * licenseKey: '\\<LICENSE-KEY-CODE\\>',\n * });\n * ```\n * @example\n * `licenseKey` can be safely omitted from source code if it has\n * been configured in Info.plist/AndroidManifest.xml.\n * ```\n * const player = new Player(); // omit `licenseKey`\n * player.play(); // call methods and properties...\n * ```\n */\n licenseKey?: string;\n /**\n * Configures playback behaviour. A default {@link PlaybackConfig} is set initially.\n */\n playbackConfig?: PlaybackConfig;\n /**\n * Configures the visual presentation and behaviour of the player UI. A default {@link StyleConfig} is set initially.\n */\n styleConfig?: StyleConfig;\n /**\n * Configures advertising functionality. A default {@link AdvertisingConfig} is set initially.\n */\n advertisingConfig?: AdvertisingConfig;\n /**\n * Configures experimental features. A default {@link TweaksConfig} is set initially.\n */\n tweaksConfig?: TweaksConfig;\n /**\n * Configures analytics functionality.\n */\n analyticsConfig?: AnalyticsConfig;\n /**\n * Configures adaptation logic.\n */\n adaptationConfig?: AdaptationConfig;\n /**\n * Configures remote playback functionality.\n */\n remoteControlConfig?: RemoteControlConfig;\n /**\n * Configures buffer settings. A default {@link BufferConfig} is set initially.\n */\n bufferConfig?: BufferConfig;\n /**\n * Configures behaviour when playing live content. A default {@link LiveConfig} is set initially.\n */\n liveConfig?: LiveConfig;\n /**\n * Configures network request manipulation functionality. A default {@link NetworkConfig} is set initially.\n */\n networkConfig?: NetworkConfig;\n /**\n * Configures the media control information for the application. This information will be displayed\n * wherever current media information typically appears, such as the lock screen, in notifications,\n * and inside the control center.\n */\n mediaControlConfig?: MediaControlConfig;\n}\n"]}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configures remote playback behavior.
|
|
3
|
+
*/
|
|
4
|
+
export interface RemoteControlConfig {
|
|
5
|
+
/**
|
|
6
|
+
* A URL to a CSS file the receiver app loads to style the receiver app.
|
|
7
|
+
* Default value is `null`, indicating that the default CSS of the receiver app will be used.
|
|
8
|
+
*/
|
|
9
|
+
receiverStylesheetUrl?: string | null;
|
|
10
|
+
/**
|
|
11
|
+
* A Map containing custom configuration values that are sent to the remote control receiver.
|
|
12
|
+
* Default value is an empty map.
|
|
13
|
+
*/
|
|
14
|
+
customReceiverConfig?: Record<string, string>;
|
|
15
|
+
/**
|
|
16
|
+
* Whether casting is enabled.
|
|
17
|
+
* Default value is `true`.
|
|
18
|
+
*
|
|
19
|
+
* Has no effect if the `BitmovinCastManager` is not initialized before the `Player` is created with this configuration.
|
|
20
|
+
*/
|
|
21
|
+
isCastEnabled?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Indicates whether cookies and credentials will be sent along manifest requests on the cast receiver
|
|
24
|
+
* Default value is `false`.
|
|
25
|
+
*/
|
|
26
|
+
sendManifestRequestsWithCredentials?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Indicates whether cookies and credentials will be sent along segment requests on the cast receiver
|
|
29
|
+
* Default value is `false`.
|
|
30
|
+
*/
|
|
31
|
+
sendSegmentRequestsWithCredentials?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Indicates whether cookies and credentials will be sent along DRM licence requests on the cast receiver
|
|
34
|
+
* Default value is `false`.
|
|
35
|
+
*/
|
|
36
|
+
sendDrmLicenseRequestsWithCredentials?: boolean;
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=remoteControlConfig.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remoteControlConfig.d.ts","sourceRoot":"","sources":["../src/remoteControlConfig.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;OAGG;IACH,qBAAqB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtC;;;OAGG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9C;;;;;OAKG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;;OAGG;IACH,mCAAmC,CAAC,EAAE,OAAO,CAAC;IAC9C;;;OAGG;IACH,kCAAkC,CAAC,EAAE,OAAO,CAAC;IAC7C;;;OAGG;IACH,qCAAqC,CAAC,EAAE,OAAO,CAAC;CACjD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remoteControlConfig.js","sourceRoot":"","sources":["../src/remoteControlConfig.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Configures remote playback behavior.\n */\nexport interface RemoteControlConfig {\n /**\n * A URL to a CSS file the receiver app loads to style the receiver app.\n * Default value is `null`, indicating that the default CSS of the receiver app will be used.\n */\n receiverStylesheetUrl?: string | null;\n /**\n * A Map containing custom configuration values that are sent to the remote control receiver.\n * Default value is an empty map.\n */\n customReceiverConfig?: Record<string, string>;\n /**\n * Whether casting is enabled.\n * Default value is `true`.\n *\n * Has no effect if the `BitmovinCastManager` is not initialized before the `Player` is created with this configuration.\n */\n isCastEnabled?: boolean;\n /**\n * Indicates whether cookies and credentials will be sent along manifest requests on the cast receiver\n * Default value is `false`.\n */\n sendManifestRequestsWithCredentials?: boolean;\n /**\n * Indicates whether cookies and credentials will be sent along segment requests on the cast receiver\n * Default value is `false`.\n */\n sendSegmentRequestsWithCredentials?: boolean;\n /**\n * Indicates whether cookies and credentials will be sent along DRM licence requests on the cast receiver\n * Default value is `false`.\n */\n sendDrmLicenseRequestsWithCredentials?: boolean;\n}\n"]}
|