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/lib/index.d.mts
DELETED
|
@@ -1,4303 +0,0 @@
|
|
|
1
|
-
import React$1 from 'react';
|
|
2
|
-
import { ViewStyle } from 'react-native';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Configures the adaptation logic.
|
|
6
|
-
*/
|
|
7
|
-
interface AdaptationConfig {
|
|
8
|
-
/**
|
|
9
|
-
* The upper bitrate boundary in bits per second for approximate network bandwidth consumption of the played source.
|
|
10
|
-
* Can be set to `undefined` for no limitation.
|
|
11
|
-
*/
|
|
12
|
-
maxSelectableBitrate?: number;
|
|
13
|
-
/**
|
|
14
|
-
* The initial bandwidth estimate in bits per second the player uses to select the optimal media tracks before actual bandwidth data is available. Overriding this value should only be done in specific cases and will most of the time not result in better selection logic.
|
|
15
|
-
*
|
|
16
|
-
* @platform Android
|
|
17
|
-
* @see https://cdn.bitmovin.com/player/android/3/docs/player-core/com.bitmovin.player.api.media/-adaptation-config/initial-bandwidth-estimate-override.html
|
|
18
|
-
*/
|
|
19
|
-
initialBandwidthEstimateOverride?: number;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Quartiles that can be reached during an ad playback.
|
|
24
|
-
*/
|
|
25
|
-
declare enum AdQuartile {
|
|
26
|
-
/**
|
|
27
|
-
* Fist ad quartile.
|
|
28
|
-
*/
|
|
29
|
-
FIRST = "first",
|
|
30
|
-
/**
|
|
31
|
-
* Mid ad quartile.
|
|
32
|
-
*/
|
|
33
|
-
MID_POINT = "mid_point",
|
|
34
|
-
/**
|
|
35
|
-
* Third ad quartile.
|
|
36
|
-
*/
|
|
37
|
-
THIRD = "third"
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* The possible types an `AdSource` can be.
|
|
41
|
-
*/
|
|
42
|
-
declare enum AdSourceType {
|
|
43
|
-
/**
|
|
44
|
-
* Google Interactive Media Ads.
|
|
45
|
-
*/
|
|
46
|
-
IMA = "ima",
|
|
47
|
-
/**
|
|
48
|
-
* Unknown ad source type.
|
|
49
|
-
*/
|
|
50
|
-
UNKNOWN = "unknown",
|
|
51
|
-
/**
|
|
52
|
-
* Progressive ad type.
|
|
53
|
-
*/
|
|
54
|
-
PROGRESSIVE = "progressive"
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* Represents an ad source which can be assigned to an `AdItem`. An `AdItem` can have multiple `AdSource`s
|
|
58
|
-
* as waterfalling option.
|
|
59
|
-
*/
|
|
60
|
-
interface AdSource {
|
|
61
|
-
/**
|
|
62
|
-
* The ad tag / url to the ad manifest.
|
|
63
|
-
*/
|
|
64
|
-
tag: string;
|
|
65
|
-
/**
|
|
66
|
-
* The `AdSourceType` of this `AdSource`.
|
|
67
|
-
*/
|
|
68
|
-
type: AdSourceType;
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* Represents an ad break which can be scheduled for playback.
|
|
72
|
-
*
|
|
73
|
-
* One single `AdItem` can have multiple `AdSource`s where all but the first act as fallback ad sources
|
|
74
|
-
* if the first one fails to load. The start and end of an ad break are signaled via `AdBreakStartedEvent`
|
|
75
|
-
* and `AdBreakFinishedEvent`.
|
|
76
|
-
*/
|
|
77
|
-
interface AdItem {
|
|
78
|
-
/**
|
|
79
|
-
* The playback position at which the ad break is scheduled to start. Default value is "pre".
|
|
80
|
-
*
|
|
81
|
-
* Possible values are:
|
|
82
|
-
* • "pre": pre-roll ad (for VoD and Live streaming)
|
|
83
|
-
* • "post": post-roll ad (for VoD streaming only)
|
|
84
|
-
* • fractional seconds: "10", "12.5" (mid-roll ad, for VoD and Live streaming)
|
|
85
|
-
* • percentage of the entire video duration: "25%", "50%" (mid-roll ad, for VoD streaming only)
|
|
86
|
-
* • timecode hh:mm:ss.mmm: "00:10:30.000", "01:00:00.000" (mid-roll ad, for VoD streaming only)
|
|
87
|
-
*/
|
|
88
|
-
position?: string;
|
|
89
|
-
/**
|
|
90
|
-
* The `AdSource`s that make up this `AdItem`. The first ad source in this array is used as the main ad.
|
|
91
|
-
* Subsequent ad sources act as a fallback, meaning that if the main ad source does not provide a
|
|
92
|
-
* valid response, the subsequent ad sources will be utilized one after another.
|
|
93
|
-
*
|
|
94
|
-
* The fallback ad sources need to have the same `AdSourceType` as the main ad source.
|
|
95
|
-
*/
|
|
96
|
-
sources: AdSource[];
|
|
97
|
-
/**
|
|
98
|
-
* The amount of seconds the ad manifest is loaded in advance
|
|
99
|
-
* compared to when the ad break is scheduled for playback.
|
|
100
|
-
*
|
|
101
|
-
* Default value is 0.0
|
|
102
|
-
*
|
|
103
|
-
* @platform Android
|
|
104
|
-
*/
|
|
105
|
-
preloadOffset?: number;
|
|
106
|
-
}
|
|
107
|
-
/**
|
|
108
|
-
* Contains configuration values regarding the ads which should be played back by the player.
|
|
109
|
-
*/
|
|
110
|
-
interface AdvertisingConfig {
|
|
111
|
-
/**
|
|
112
|
-
* The ad items that are scheduled when a new playback session is started via `Player.load()`.
|
|
113
|
-
*/
|
|
114
|
-
schedule: AdItem[];
|
|
115
|
-
}
|
|
116
|
-
/**
|
|
117
|
-
* Contains the base configuration options for an ad.
|
|
118
|
-
*/
|
|
119
|
-
interface AdConfig {
|
|
120
|
-
/**
|
|
121
|
-
* Specifies how many seconds of the main video content should be replaced by ad break(s).
|
|
122
|
-
*/
|
|
123
|
-
replaceContentDuration: number;
|
|
124
|
-
}
|
|
125
|
-
/**
|
|
126
|
-
* Holds various additional ad data.
|
|
127
|
-
*/
|
|
128
|
-
interface AdData {
|
|
129
|
-
/**
|
|
130
|
-
* The average bitrate of the progressive media file as defined in the VAST response.
|
|
131
|
-
*/
|
|
132
|
-
bitrate?: number;
|
|
133
|
-
/**
|
|
134
|
-
* The maximum bitrate of the streaming media file as defined in the VAST response.
|
|
135
|
-
*/
|
|
136
|
-
maxBitrate?: number;
|
|
137
|
-
/**
|
|
138
|
-
* The MIME type of the media file or creative as defined in the VAST response.
|
|
139
|
-
*/
|
|
140
|
-
mimeType?: string;
|
|
141
|
-
/**
|
|
142
|
-
* The minimum bitrate of the streaming media file as defined in the VAST response.
|
|
143
|
-
*/
|
|
144
|
-
minBitrate?: number;
|
|
145
|
-
}
|
|
146
|
-
/**
|
|
147
|
-
* Defines basic properties available for every ad type.
|
|
148
|
-
*/
|
|
149
|
-
interface Ad {
|
|
150
|
-
/**
|
|
151
|
-
* The url the user should be redirected to when clicking the ad.
|
|
152
|
-
*/
|
|
153
|
-
clickThroughUrl?: string;
|
|
154
|
-
/**
|
|
155
|
-
* Holds various additional `AdData`.
|
|
156
|
-
*/
|
|
157
|
-
data?: AdData;
|
|
158
|
-
/**
|
|
159
|
-
* The height of the ad.
|
|
160
|
-
*/
|
|
161
|
-
height: number;
|
|
162
|
-
/**
|
|
163
|
-
* Identifier for the ad. This might be autogenerated.
|
|
164
|
-
*/
|
|
165
|
-
id?: string;
|
|
166
|
-
/**
|
|
167
|
-
* Determines whether an ad is linear, i.e. playback of main content needs to be paused for the ad.
|
|
168
|
-
*/
|
|
169
|
-
isLinear: boolean;
|
|
170
|
-
/**
|
|
171
|
-
* The corresponding media file url for the ad.
|
|
172
|
-
*/
|
|
173
|
-
mediaFileUrl?: string;
|
|
174
|
-
/**
|
|
175
|
-
* The width of the ad.
|
|
176
|
-
*/
|
|
177
|
-
width: number;
|
|
178
|
-
}
|
|
179
|
-
/**
|
|
180
|
-
* Contains information about an ad break.
|
|
181
|
-
*/
|
|
182
|
-
interface AdBreak {
|
|
183
|
-
/**
|
|
184
|
-
* The ads scheduled for this `AdBreak`.
|
|
185
|
-
*/
|
|
186
|
-
ads: Ad[];
|
|
187
|
-
/**
|
|
188
|
-
* The id of the corresponding `AdBreakConfig`. This will be auto-generated.
|
|
189
|
-
*/
|
|
190
|
-
id: string;
|
|
191
|
-
/**
|
|
192
|
-
* The time in seconds in the media timeline the `AdBreak` is scheduled for.
|
|
193
|
-
*/
|
|
194
|
-
scheduleTime: number;
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
/**
|
|
198
|
-
* Object used to configure the build-in analytics collector.
|
|
199
|
-
*/
|
|
200
|
-
interface AnalyticsConfig {
|
|
201
|
-
/**
|
|
202
|
-
* The analytics license key
|
|
203
|
-
*/
|
|
204
|
-
licenseKey: string;
|
|
205
|
-
/**
|
|
206
|
-
* Flag to enable Ad tracking (default: false).
|
|
207
|
-
*/
|
|
208
|
-
adTrackingDisabled?: boolean;
|
|
209
|
-
/**
|
|
210
|
-
* Flag to use randomised userId not depending on device specific values (default: false).
|
|
211
|
-
*/
|
|
212
|
-
randomizeUserId?: boolean;
|
|
213
|
-
/**
|
|
214
|
-
* Default metadata to be sent with events.
|
|
215
|
-
* Fields of the `SourceMetadata` are prioritized over the default metadata.
|
|
216
|
-
*/
|
|
217
|
-
defaultMetadata?: DefaultMetadata;
|
|
218
|
-
}
|
|
219
|
-
/**
|
|
220
|
-
* DefaultMetadata that can be used to enrich the analytics data.
|
|
221
|
-
* DefaultMetadata is not bound to a specific source and can be used to set fields for the lifecycle of the collector.
|
|
222
|
-
* If fields are specified in `SourceMetadata` and `DefaultMetadata`, `SourceMetadata` takes precedence.
|
|
223
|
-
*/
|
|
224
|
-
interface DefaultMetadata extends CustomDataConfig {
|
|
225
|
-
/**
|
|
226
|
-
* CDN Provide that the video playback session is using.
|
|
227
|
-
*/
|
|
228
|
-
cdnProvider?: string;
|
|
229
|
-
/**
|
|
230
|
-
* User ID of the customer.
|
|
231
|
-
*/
|
|
232
|
-
customUserId?: string;
|
|
233
|
-
}
|
|
234
|
-
/**
|
|
235
|
-
* `SourceMetadata` that can be used to enrich the analytics data.
|
|
236
|
-
*/
|
|
237
|
-
interface SourceMetadata extends CustomDataConfig {
|
|
238
|
-
/**
|
|
239
|
-
* ID of the video in the CMS system
|
|
240
|
-
*/
|
|
241
|
-
videoId?: String;
|
|
242
|
-
/**
|
|
243
|
-
* Human readable title of the video asset currently playing
|
|
244
|
-
*/
|
|
245
|
-
title?: String;
|
|
246
|
-
/**
|
|
247
|
-
* Breadcrumb path to show where in the app the user is
|
|
248
|
-
*/
|
|
249
|
-
path?: String;
|
|
250
|
-
/**
|
|
251
|
-
* Flag to see if stream is live before stream metadata is available
|
|
252
|
-
*/
|
|
253
|
-
isLive?: boolean;
|
|
254
|
-
/**
|
|
255
|
-
* CDN Provider that the video playback session is using
|
|
256
|
-
*/
|
|
257
|
-
cdnProvider?: String;
|
|
258
|
-
}
|
|
259
|
-
/**
|
|
260
|
-
* Free-form data that can be used to enrich the analytics data
|
|
261
|
-
* If customData is specified in `SourceMetadata` and `DefaultMetadata`
|
|
262
|
-
* data is merged on a field basis with `SourceMetadata` taking precedence.
|
|
263
|
-
*/
|
|
264
|
-
interface CustomDataConfig {
|
|
265
|
-
/**
|
|
266
|
-
* Optional free-form custom data
|
|
267
|
-
*/
|
|
268
|
-
customData1?: string;
|
|
269
|
-
/**
|
|
270
|
-
* Optional free-form custom data
|
|
271
|
-
*/
|
|
272
|
-
customData2?: string;
|
|
273
|
-
/**
|
|
274
|
-
* Optional free-form custom data
|
|
275
|
-
*/
|
|
276
|
-
customData3?: string;
|
|
277
|
-
/**
|
|
278
|
-
* Optional free-form custom data
|
|
279
|
-
*/
|
|
280
|
-
customData4?: string;
|
|
281
|
-
/**
|
|
282
|
-
* Optional free-form custom data
|
|
283
|
-
*/
|
|
284
|
-
customData5?: string;
|
|
285
|
-
/**
|
|
286
|
-
* Optional free-form custom data
|
|
287
|
-
*/
|
|
288
|
-
customData6?: string;
|
|
289
|
-
/**
|
|
290
|
-
* Optional free-form custom data
|
|
291
|
-
*/
|
|
292
|
-
customData7?: string;
|
|
293
|
-
/**
|
|
294
|
-
* Optional free-form custom data
|
|
295
|
-
*/
|
|
296
|
-
customData8?: string;
|
|
297
|
-
/**
|
|
298
|
-
* Optional free-form custom data
|
|
299
|
-
*/
|
|
300
|
-
customData9?: string;
|
|
301
|
-
/**
|
|
302
|
-
* Optional free-form custom data
|
|
303
|
-
*/
|
|
304
|
-
customData10?: string;
|
|
305
|
-
/**
|
|
306
|
-
* Optional free-form custom data
|
|
307
|
-
*/
|
|
308
|
-
customData11?: string;
|
|
309
|
-
/**
|
|
310
|
-
* Optional free-form custom data
|
|
311
|
-
*/
|
|
312
|
-
customData12?: string;
|
|
313
|
-
/**
|
|
314
|
-
* Optional free-form custom data
|
|
315
|
-
*/
|
|
316
|
-
customData13?: string;
|
|
317
|
-
/**
|
|
318
|
-
* Optional free-form custom data
|
|
319
|
-
*/
|
|
320
|
-
customData14?: string;
|
|
321
|
-
/**
|
|
322
|
-
* Optional free-form custom data
|
|
323
|
-
*/
|
|
324
|
-
customData15?: string;
|
|
325
|
-
/**
|
|
326
|
-
* Optional free-form custom data
|
|
327
|
-
*/
|
|
328
|
-
customData16?: string;
|
|
329
|
-
/**
|
|
330
|
-
* Optional free-form custom data
|
|
331
|
-
*/
|
|
332
|
-
customData17?: string;
|
|
333
|
-
/**
|
|
334
|
-
* Optional free-form custom data
|
|
335
|
-
*/
|
|
336
|
-
customData18?: string;
|
|
337
|
-
/**
|
|
338
|
-
* Optional free-form custom data
|
|
339
|
-
*/
|
|
340
|
-
customData19?: string;
|
|
341
|
-
/**
|
|
342
|
-
* Optional free-form custom data
|
|
343
|
-
*/
|
|
344
|
-
customData20?: string;
|
|
345
|
-
/**
|
|
346
|
-
* Optional free-form custom data
|
|
347
|
-
*/
|
|
348
|
-
customData21?: string;
|
|
349
|
-
/**
|
|
350
|
-
* Optional free-form custom data
|
|
351
|
-
*/
|
|
352
|
-
customData22?: string;
|
|
353
|
-
/**
|
|
354
|
-
* Optional free-form custom data
|
|
355
|
-
*/
|
|
356
|
-
customData23?: string;
|
|
357
|
-
/**
|
|
358
|
-
* Optional free-form custom data
|
|
359
|
-
*/
|
|
360
|
-
customData24?: string;
|
|
361
|
-
/**
|
|
362
|
-
* Optional free-form custom data
|
|
363
|
-
*/
|
|
364
|
-
customData25?: string;
|
|
365
|
-
/**
|
|
366
|
-
* Optional free-form custom data
|
|
367
|
-
*/
|
|
368
|
-
customData26?: string;
|
|
369
|
-
/**
|
|
370
|
-
* Optional free-form custom data
|
|
371
|
-
*/
|
|
372
|
-
customData27?: string;
|
|
373
|
-
/**
|
|
374
|
-
* Optional free-form custom data
|
|
375
|
-
*/
|
|
376
|
-
customData28?: string;
|
|
377
|
-
/**
|
|
378
|
-
* Optional free-form custom data
|
|
379
|
-
*/
|
|
380
|
-
customData29?: string;
|
|
381
|
-
/**
|
|
382
|
-
* Optional free-form custom data
|
|
383
|
-
*/
|
|
384
|
-
customData30?: string;
|
|
385
|
-
/**
|
|
386
|
-
* Experiment name needed for A/B testing.
|
|
387
|
-
*/
|
|
388
|
-
experimentName?: string;
|
|
389
|
-
}
|
|
390
|
-
|
|
391
|
-
/**
|
|
392
|
-
* Provides the means to control the analytics collected by a `Player`.
|
|
393
|
-
* Use the `Player.analytics` property to access a `Player`'s `AnalyticsApi`.
|
|
394
|
-
*/
|
|
395
|
-
declare class AnalyticsApi {
|
|
396
|
-
/**
|
|
397
|
-
* The native player id that this analytics api is attached to.
|
|
398
|
-
*/
|
|
399
|
-
playerId: string;
|
|
400
|
-
constructor(playerId: string);
|
|
401
|
-
/**
|
|
402
|
-
* Sends a sample with the provided custom data.
|
|
403
|
-
* Does not change the configured custom data of the collector or source.
|
|
404
|
-
*/
|
|
405
|
-
sendCustomDataEvent: (customData: CustomDataConfig) => void;
|
|
406
|
-
/**
|
|
407
|
-
* Gets the current user id used by the bundled analytics instance.
|
|
408
|
-
*
|
|
409
|
-
* @returns The current user id.
|
|
410
|
-
*/
|
|
411
|
-
getUserId: () => Promise<string>;
|
|
412
|
-
}
|
|
413
|
-
|
|
414
|
-
/**
|
|
415
|
-
* An audio session category defines a set of audio behaviors.
|
|
416
|
-
* Choose a category that most accurately describes the audio behavior you require.
|
|
417
|
-
*
|
|
418
|
-
* Note the `playback` category is required in order to properly enable picture in picture support.
|
|
419
|
-
*
|
|
420
|
-
* - `ambient`: The category for an app in which sound playback is nonprimary — that is, your app also works with the sound turned off.
|
|
421
|
-
* - `multiRoute`: The category for routing distinct streams of audio data to different output devices at the same time.
|
|
422
|
-
* - `playAndRecord`: The category for recording (input) and playback (output) of audio, such as for a Voice over Internet Protocol (VoIP) app.
|
|
423
|
-
* - `playback`: The category for playing recorded music or other sounds that are central to the successful use of your app.
|
|
424
|
-
* - `record`: The category for recording audio while also silencing playback audio.
|
|
425
|
-
* - `soloAmbient`: The default audio session category.
|
|
426
|
-
*
|
|
427
|
-
* @platform iOS
|
|
428
|
-
* @see https://developer.apple.com/documentation/avfaudio/avaudiosession/category
|
|
429
|
-
*/
|
|
430
|
-
type AudioSessionCategory = 'ambient' | 'multiRoute' | 'playAndRecord' | 'playback' | 'record' | 'soloAmbient';
|
|
431
|
-
/**
|
|
432
|
-
* An object that communicates to the system how you intend to use audio in your app.
|
|
433
|
-
*
|
|
434
|
-
* @platform iOS
|
|
435
|
-
* @see https://developer.apple.com/documentation/avfaudio/avaudiosession
|
|
436
|
-
*/
|
|
437
|
-
declare const AudioSession: {
|
|
438
|
-
/**
|
|
439
|
-
* Sets the audio session's category.
|
|
440
|
-
*
|
|
441
|
-
* @platform iOS
|
|
442
|
-
* @see https://developer.apple.com/documentation/avfaudio/avaudiosession/1616583-setcategory
|
|
443
|
-
*/
|
|
444
|
-
setCategory: (category: AudioSessionCategory) => Promise<void>;
|
|
445
|
-
};
|
|
446
|
-
|
|
447
|
-
/**
|
|
448
|
-
* The `MediaTrackRole` interface represents the role of a media track in a media stream.
|
|
449
|
-
*/
|
|
450
|
-
interface MediaTrackRole {
|
|
451
|
-
/**
|
|
452
|
-
* The unique identifier for this role instance.
|
|
453
|
-
* - On Android: Corresponds to the native [`MediaTrackRole.id`](https://cdn.bitmovin.com/player/android/3/docs/player-core/com.bitmovin.player.api.media/-media-track-role/id.html).
|
|
454
|
-
* May be undefined.
|
|
455
|
-
* - On iOS and tvOS: `undefined`, as HLS characteristics do not have inherent IDs in this context.
|
|
456
|
-
*/
|
|
457
|
-
id?: string;
|
|
458
|
-
/**
|
|
459
|
-
* The URI identifying the scheme used for the role definition.
|
|
460
|
-
* - On Android: Corresponds to the native [`MediaTrackRole.schemeIdUri`](https://cdn.bitmovin.com/player/android/3/docs/player-core/com.bitmovin.player.api.media/-media-track-role/scheme-id-uri.html)
|
|
461
|
-
* (e.g., "urn:mpeg:dash:role:2011").
|
|
462
|
-
* - On iOS and tvOS: predefined URN `urn:hls:characteristic` representing HLS characteristics.
|
|
463
|
-
*/
|
|
464
|
-
schemeIdUri: string;
|
|
465
|
-
/**
|
|
466
|
-
* The value of the role within the specified scheme.
|
|
467
|
-
* - On Android: Corresponds to the native [`MediaTrackRole.value`](https://cdn.bitmovin.com/player/android/3/docs/player-core/com.bitmovin.player.api.media/-media-track-role/value.html)
|
|
468
|
-
* (e.g., "main", "caption", "description").
|
|
469
|
-
* - On iOS and tvOS: The raw HLS characteristic string (e.g., "public.accessibility.describes-music-and-sound",
|
|
470
|
-
* "public.accessibility.transcribes-spoken-dialog").
|
|
471
|
-
*/
|
|
472
|
-
value?: string;
|
|
473
|
-
}
|
|
474
|
-
|
|
475
|
-
/**
|
|
476
|
-
* Supported subtitle/caption file formats.
|
|
477
|
-
* @platform Android, iOS, tvOS
|
|
478
|
-
*/
|
|
479
|
-
declare enum SubtitleFormat {
|
|
480
|
-
/**
|
|
481
|
-
* Closed Captioning (CEA) subtitle format.
|
|
482
|
-
* @platform Android, iOS, tvOS
|
|
483
|
-
*/
|
|
484
|
-
CEA = "cea",
|
|
485
|
-
/**
|
|
486
|
-
* Timed Text Markup Language (TTML) subtitle format.
|
|
487
|
-
* @platform Android, iOS, tvOS
|
|
488
|
-
*/
|
|
489
|
-
TTML = "ttml",
|
|
490
|
-
/**
|
|
491
|
-
* Web Video Text Tracks Format (WebVTT) subtitle format.
|
|
492
|
-
* @platform Android, iOS, tvOS
|
|
493
|
-
*/
|
|
494
|
-
VTT = "vtt",
|
|
495
|
-
/**
|
|
496
|
-
* SubRip (SRT) subtitle format.
|
|
497
|
-
* @platform Android, iOS, tvOS
|
|
498
|
-
*/
|
|
499
|
-
SRT = "srt"
|
|
500
|
-
}
|
|
501
|
-
|
|
502
|
-
/**
|
|
503
|
-
* Describes a subtitle track.
|
|
504
|
-
* @platform Android, iOS, tvOS
|
|
505
|
-
*/
|
|
506
|
-
interface SubtitleTrack {
|
|
507
|
-
/**
|
|
508
|
-
* The URL to the timed file, e.g. WebVTT file.
|
|
509
|
-
*/
|
|
510
|
-
url?: string;
|
|
511
|
-
/**
|
|
512
|
-
* The label for this track.
|
|
513
|
-
*/
|
|
514
|
-
label?: string;
|
|
515
|
-
/**
|
|
516
|
-
* The unique identifier for this track. If no value is provided, a random UUIDv4 will be generated for it.
|
|
517
|
-
*/
|
|
518
|
-
identifier?: string;
|
|
519
|
-
/**
|
|
520
|
-
* Specifies the file format to be used by this track.
|
|
521
|
-
*/
|
|
522
|
-
format?: SubtitleFormat;
|
|
523
|
-
/**
|
|
524
|
-
* If set to true, this track would be considered as default. Default is `false`.
|
|
525
|
-
*/
|
|
526
|
-
isDefault?: boolean;
|
|
527
|
-
/**
|
|
528
|
-
* Tells if a subtitle track is forced. If set to `true` it means that the player should automatically
|
|
529
|
-
* select and switch this subtitle according to the selected audio language. Forced subtitles do
|
|
530
|
-
* not appear in `Player.getAvailableSubtitles`.
|
|
531
|
-
*
|
|
532
|
-
* Default is `false`.
|
|
533
|
-
*/
|
|
534
|
-
isForced?: boolean;
|
|
535
|
-
/**
|
|
536
|
-
* The IETF BCP 47 language tag associated with this track, e.g. `pt`, `en`, `es` etc.
|
|
537
|
-
*/
|
|
538
|
-
language?: string;
|
|
539
|
-
/**
|
|
540
|
-
* An array of {@link MediaTrackRole} objects, each describing a specific role or characteristic of the subtitle track.
|
|
541
|
-
* This property provides a unified way to understand track purposes (e.g., for accessibility) across platforms.
|
|
542
|
-
*/
|
|
543
|
-
roles?: MediaTrackRole[];
|
|
544
|
-
}
|
|
545
|
-
/**
|
|
546
|
-
* A subtitle track that can be added to `SourceConfig.subtitleTracks`.
|
|
547
|
-
*/
|
|
548
|
-
interface SideLoadedSubtitleTrack extends SubtitleTrack {
|
|
549
|
-
url: string;
|
|
550
|
-
label: string;
|
|
551
|
-
language: string;
|
|
552
|
-
format: SubtitleFormat;
|
|
553
|
-
}
|
|
554
|
-
|
|
555
|
-
/**
|
|
556
|
-
* Quality definition of a video representation.
|
|
557
|
-
*/
|
|
558
|
-
interface VideoQuality {
|
|
559
|
-
/**
|
|
560
|
-
* The id of the media quality.
|
|
561
|
-
*/
|
|
562
|
-
id: string;
|
|
563
|
-
/**
|
|
564
|
-
* The label of the media quality that should be exposed to the user.
|
|
565
|
-
*/
|
|
566
|
-
label?: string;
|
|
567
|
-
/**
|
|
568
|
-
* The bitrate of the media quality.
|
|
569
|
-
*/
|
|
570
|
-
bitrate?: number;
|
|
571
|
-
/**
|
|
572
|
-
* The codec of the media quality.
|
|
573
|
-
*/
|
|
574
|
-
codec?: string;
|
|
575
|
-
/**
|
|
576
|
-
* The frame rate of the video quality. If the frame rate is not known or not applicable a value of -1 will be returned.
|
|
577
|
-
*/
|
|
578
|
-
frameRate?: number;
|
|
579
|
-
/**
|
|
580
|
-
* The height of the video quality.
|
|
581
|
-
*/
|
|
582
|
-
height?: number;
|
|
583
|
-
/**
|
|
584
|
-
* The width of the video quality.
|
|
585
|
-
*/
|
|
586
|
-
width?: number;
|
|
587
|
-
}
|
|
588
|
-
/**
|
|
589
|
-
* Quality definition of an audio representation.
|
|
590
|
-
*
|
|
591
|
-
* @platform Android
|
|
592
|
-
*/
|
|
593
|
-
interface AudioQuality {
|
|
594
|
-
/**
|
|
595
|
-
* The id of the media quality.
|
|
596
|
-
*/
|
|
597
|
-
id: string;
|
|
598
|
-
/**
|
|
599
|
-
* The label of the media quality that should be exposed to the user.
|
|
600
|
-
*/
|
|
601
|
-
label?: string;
|
|
602
|
-
/**
|
|
603
|
-
* The bitrate in bits per second. This is the peak bitrate if known, or else the average bitrate
|
|
604
|
-
* if known, or else -1.
|
|
605
|
-
*/
|
|
606
|
-
bitrate?: number;
|
|
607
|
-
/**
|
|
608
|
-
* The average bitrate in bits per second, or -1 if unknown or not applicable. The
|
|
609
|
-
* way in which this field is populated depends on the type of media to which the format
|
|
610
|
-
* corresponds:
|
|
611
|
-
*
|
|
612
|
-
* - DASH representations: Always -1.
|
|
613
|
-
* - HLS variants: The `AVERAGE-BANDWIDTH` attribute defined on the corresponding
|
|
614
|
-
* `EXT-X-STREAM-INF` tag in the multivariant playlist, or -1 if not present.
|
|
615
|
-
* - SmoothStreaming track elements: The `Bitrate` attribute defined on the
|
|
616
|
-
* corresponding `TrackElement` in the manifest, or -1 if not present.
|
|
617
|
-
* - Progressive container formats: Often -1, but may be populated with
|
|
618
|
-
* the average bitrate of the container if known.
|
|
619
|
-
*/
|
|
620
|
-
averageBitrate?: number;
|
|
621
|
-
/**
|
|
622
|
-
* The peak bitrate in bits per second, or -1 if unknown or not applicable. The way
|
|
623
|
-
* in which this field is populated depends on the type of media to which the format corresponds:
|
|
624
|
-
*
|
|
625
|
-
* - DASH representations: The `@bandwidth` attribute of the corresponding
|
|
626
|
-
* `Representation` element in the manifest.
|
|
627
|
-
* - HLS variants: The `BANDWIDTH` attribute defined on the corresponding
|
|
628
|
-
* `EXT-X-STREAM-INF` tag.
|
|
629
|
-
* - SmoothStreaming track elements: Always -1.
|
|
630
|
-
* - Progressive container formats: Often -1, but may be populated with
|
|
631
|
-
* the peak bitrate of the container if known.
|
|
632
|
-
*/
|
|
633
|
-
peakBitrate?: number;
|
|
634
|
-
/**
|
|
635
|
-
* The codec of the media quality.
|
|
636
|
-
*/
|
|
637
|
-
codec?: string;
|
|
638
|
-
}
|
|
639
|
-
|
|
640
|
-
/**
|
|
641
|
-
* Represents an audio track for a video.
|
|
642
|
-
*/
|
|
643
|
-
interface AudioTrack {
|
|
644
|
-
/**
|
|
645
|
-
* The URL to the timed file, e.g. WebVTT file.
|
|
646
|
-
*/
|
|
647
|
-
url?: string;
|
|
648
|
-
/**
|
|
649
|
-
* The label for this track.
|
|
650
|
-
*/
|
|
651
|
-
label?: string;
|
|
652
|
-
/**
|
|
653
|
-
* The unique identifier for this track. If no value is provided, a random UUIDv4 will be generated for it.
|
|
654
|
-
*/
|
|
655
|
-
identifier?: string;
|
|
656
|
-
/**
|
|
657
|
-
* If set to true, this track would be considered as default. Default is `false`.
|
|
658
|
-
*/
|
|
659
|
-
isDefault?: boolean;
|
|
660
|
-
/**
|
|
661
|
-
* The IETF BCP 47 language tag associated with this track, e.g. `pt`, `en`, `es` etc.
|
|
662
|
-
*/
|
|
663
|
-
language?: string;
|
|
664
|
-
/**
|
|
665
|
-
* An array of {@link MediaTrackRole} objects, each describing a specific role or characteristic of the audio track.
|
|
666
|
-
* This property provides a unified way to understand track purposes (e.g., for accessibility) across platforms.
|
|
667
|
-
*/
|
|
668
|
-
roles?: MediaTrackRole[];
|
|
669
|
-
/**
|
|
670
|
-
* A list of AudioQuality associated with this AudioTrack.
|
|
671
|
-
*
|
|
672
|
-
* @platform Android
|
|
673
|
-
*/
|
|
674
|
-
qualities?: AudioQuality[];
|
|
675
|
-
}
|
|
676
|
-
|
|
677
|
-
interface NativeInstanceConfig {
|
|
678
|
-
/**
|
|
679
|
-
* Optionally user-defined string `id` for the native instance.
|
|
680
|
-
* Used to access a certain native instance from any point in the source code then call
|
|
681
|
-
* methods/properties on it.
|
|
682
|
-
*
|
|
683
|
-
* When left empty, a random `UUIDv4` is generated for it.
|
|
684
|
-
* @example
|
|
685
|
-
* Accessing or creating the `Player` with `nativeId` equal to `my-player`:
|
|
686
|
-
* ```
|
|
687
|
-
* const player = new Player({ nativeId: 'my-player' })
|
|
688
|
-
* player.play(); // call methods and properties...
|
|
689
|
-
* ```
|
|
690
|
-
*/
|
|
691
|
-
nativeId?: string;
|
|
692
|
-
}
|
|
693
|
-
declare abstract class NativeInstance<Config extends NativeInstanceConfig> {
|
|
694
|
-
/**
|
|
695
|
-
* Optionally user-defined string `id` for the native instance, or UUIDv4.
|
|
696
|
-
*/
|
|
697
|
-
readonly nativeId: string;
|
|
698
|
-
/**
|
|
699
|
-
* The configuration object used to initialize this instance.
|
|
700
|
-
*/
|
|
701
|
-
readonly config?: Config;
|
|
702
|
-
/**
|
|
703
|
-
* Generate UUID in case the user-defined `nativeId` is empty.
|
|
704
|
-
*/
|
|
705
|
-
constructor(config?: Config);
|
|
706
|
-
/**
|
|
707
|
-
* Flag indicating whether the native resources of this object have been created internally
|
|
708
|
-
* .i.e `initialize` has been called.
|
|
709
|
-
*/
|
|
710
|
-
abstract isInitialized: boolean;
|
|
711
|
-
/**
|
|
712
|
-
* Create the native object/resources that will be managed by this instance.
|
|
713
|
-
*/
|
|
714
|
-
abstract initialize(): void;
|
|
715
|
-
/**
|
|
716
|
-
* Flag indicating whether the native resources of this object have been disposed .i.e
|
|
717
|
-
* `destroy` has been called.
|
|
718
|
-
*/
|
|
719
|
-
abstract isDestroyed: boolean;
|
|
720
|
-
/**
|
|
721
|
-
* Dispose the native object/resources created by this instance during `initialize`.
|
|
722
|
-
*/
|
|
723
|
-
abstract destroy(): void;
|
|
724
|
-
}
|
|
725
|
-
|
|
726
|
-
/**
|
|
727
|
-
* Represents a FairPlay Streaming DRM config.
|
|
728
|
-
*/
|
|
729
|
-
interface FairplayConfig {
|
|
730
|
-
/**
|
|
731
|
-
* The DRM license acquisition URL.
|
|
732
|
-
*/
|
|
733
|
-
licenseUrl: string;
|
|
734
|
-
/**
|
|
735
|
-
* The URL to the FairPlay Streaming certificate of the license server.
|
|
736
|
-
*/
|
|
737
|
-
certificateUrl?: string;
|
|
738
|
-
/**
|
|
739
|
-
* A dictionary to specify custom HTTP headers for the license request.
|
|
740
|
-
*/
|
|
741
|
-
licenseRequestHeaders?: Record<string, string>;
|
|
742
|
-
/**
|
|
743
|
-
* A dictionary to specify custom HTTP headers for the certificate request.
|
|
744
|
-
*/
|
|
745
|
-
certificateRequestHeaders?: Record<string, string>;
|
|
746
|
-
/**
|
|
747
|
-
* A block to prepare the loaded certificate before building SPC data and passing it into the
|
|
748
|
-
* system. This is needed if the server responds with anything else than the certificate, e.g. if
|
|
749
|
-
* the certificate is wrapped into a JSON object. The server response for the certificate request
|
|
750
|
-
* is passed as parameter “as is”.
|
|
751
|
-
*
|
|
752
|
-
* Note that both the passed `certificate` data and this block return value should be a Base64
|
|
753
|
-
* string. So use whatever solution suits you best to handle Base64 in React Native.
|
|
754
|
-
*
|
|
755
|
-
* @param certificate - Base64 encoded certificate data.
|
|
756
|
-
* @returns The processed Base64 encoded certificate.
|
|
757
|
-
*/
|
|
758
|
-
prepareCertificate?: (certificate: string) => string;
|
|
759
|
-
/**
|
|
760
|
-
* A block to prepare the data which is sent as the body of the POST license request.
|
|
761
|
-
* As many DRM providers expect different, vendor-specific messages, this can be done using
|
|
762
|
-
* this user-defined block.
|
|
763
|
-
*
|
|
764
|
-
* Note that both the passed `message` data and this block return value should be a Base64 string.
|
|
765
|
-
* So use whatever solution suits you best to handle Base64 in React Native.
|
|
766
|
-
*
|
|
767
|
-
* @param message - Base64 encoded message data.
|
|
768
|
-
* @param assetId - Stream asset ID.
|
|
769
|
-
* @returns The processed Base64 encoded message.
|
|
770
|
-
*/
|
|
771
|
-
prepareMessage?: (message: string, assetId: string) => string;
|
|
772
|
-
/**
|
|
773
|
-
* A block to prepare the data which is sent as the body of the POST request for syncing the DRM
|
|
774
|
-
* license information.
|
|
775
|
-
*
|
|
776
|
-
* Note that both the passed `syncMessage` data and this block return value should be a Base64
|
|
777
|
-
* string. So use whatever solution suits you best to handle Base64 in React Native.
|
|
778
|
-
*
|
|
779
|
-
* @param message - Base64 encoded message data.
|
|
780
|
-
* @param assetId - Asset ID.
|
|
781
|
-
* @returns The processed Base64 encoded sync message.
|
|
782
|
-
*/
|
|
783
|
-
prepareSyncMessage?: (syncMessage: string, assetId: string) => string;
|
|
784
|
-
/**
|
|
785
|
-
* A block to prepare the loaded CKC Data before passing it to the system. This is needed if the
|
|
786
|
-
* server responds with anything else than the license, e.g. if the license is wrapped into a JSON
|
|
787
|
-
* object.
|
|
788
|
-
*
|
|
789
|
-
* Note that both the passed `license` data and this block return value should be a Base64 string.
|
|
790
|
-
* So use whatever solution suits you best to handle Base64 in React Native.
|
|
791
|
-
*
|
|
792
|
-
* @param license - Base64 encoded license data.
|
|
793
|
-
* @returns The processed Base64 encoded license.
|
|
794
|
-
*/
|
|
795
|
-
prepareLicense?: (license: string) => string;
|
|
796
|
-
/**
|
|
797
|
-
* A block to prepare the URI (without the skd://) from the HLS manifest before passing it to the
|
|
798
|
-
* system.
|
|
799
|
-
*
|
|
800
|
-
* @param licenseServerUrl - License server URL string.
|
|
801
|
-
* @returns The processed license server URL string.
|
|
802
|
-
*/
|
|
803
|
-
prepareLicenseServerUrl?: (licenseServerUrl: string) => string;
|
|
804
|
-
/**
|
|
805
|
-
* A block to prepare the `contentId`, which is sent to the FairPlay Streaming license server as
|
|
806
|
-
* request body, and which is used to build the SPC data. As many DRM providers expect different,
|
|
807
|
-
* vendor-specific messages, this can be done using this user-defined block. The parameter is the
|
|
808
|
-
* skd:// URI extracted from the HLS manifest (m3u8) and the return value should be the contentID
|
|
809
|
-
* as string.
|
|
810
|
-
*
|
|
811
|
-
* @param contentId - Extracted content id string.
|
|
812
|
-
* @returns The processed contentId.
|
|
813
|
-
*/
|
|
814
|
-
prepareContentId?: (contentId: string) => string;
|
|
815
|
-
}
|
|
816
|
-
|
|
817
|
-
/**
|
|
818
|
-
* Represents a Widevine Streaming DRM config.
|
|
819
|
-
* @platform Android, iOS (only for casting).
|
|
820
|
-
*/
|
|
821
|
-
interface WidevineConfig {
|
|
822
|
-
/**
|
|
823
|
-
* The DRM license acquisition URL.
|
|
824
|
-
*/
|
|
825
|
-
licenseUrl: string;
|
|
826
|
-
/**
|
|
827
|
-
* A map containing the HTTP request headers, or null.
|
|
828
|
-
*/
|
|
829
|
-
httpHeaders?: Record<string, string>;
|
|
830
|
-
/**
|
|
831
|
-
* A block to prepare the data which is sent as the body of the POST license request.
|
|
832
|
-
* As many DRM providers expect different, vendor-specific messages, this can be done using
|
|
833
|
-
* this user-defined block.
|
|
834
|
-
*
|
|
835
|
-
* Note that both the passed `message` data and this block return value should be a Base64 string.
|
|
836
|
-
* So use whatever solution suits you best to handle Base64 in React Native.
|
|
837
|
-
*
|
|
838
|
-
* @platform Android
|
|
839
|
-
*
|
|
840
|
-
* @param message - Base64 encoded message data.
|
|
841
|
-
* @returns The processed Base64 encoded message.
|
|
842
|
-
*/
|
|
843
|
-
prepareMessage?: (message: string) => string;
|
|
844
|
-
/**
|
|
845
|
-
* A block to prepare the loaded CKC Data before passing it to the system. This is needed if the
|
|
846
|
-
* server responds with anything else than the license, e.g. if the license is wrapped into a JSON
|
|
847
|
-
* object.
|
|
848
|
-
*
|
|
849
|
-
* Note that both the passed `license` data and this block return value should be a Base64 string.
|
|
850
|
-
* So use whatever solution suits you best to handle Base64 in React Native.
|
|
851
|
-
*
|
|
852
|
-
* @platform Android
|
|
853
|
-
*
|
|
854
|
-
* @param license - Base64 encoded license data.
|
|
855
|
-
* @returns The processed Base64 encoded license.
|
|
856
|
-
*/
|
|
857
|
-
prepareLicense?: (license: string) => string;
|
|
858
|
-
/**
|
|
859
|
-
* Set widevine's preferred security level.
|
|
860
|
-
*
|
|
861
|
-
* @platform Android
|
|
862
|
-
*/
|
|
863
|
-
preferredSecurityLevel?: string;
|
|
864
|
-
/**
|
|
865
|
-
* Indicates if the DRM sessions should be kept alive after a source is unloaded.
|
|
866
|
-
* This allows DRM sessions to be reused over several different source items with the same DRM configuration as well
|
|
867
|
-
* as the same DRM scheme information.
|
|
868
|
-
* Default: `false`
|
|
869
|
-
*
|
|
870
|
-
* @platform Android
|
|
871
|
-
*/
|
|
872
|
-
shouldKeepDrmSessionsAlive?: boolean;
|
|
873
|
-
}
|
|
874
|
-
|
|
875
|
-
/**
|
|
876
|
-
* Represents the general Streaming DRM config.
|
|
877
|
-
*/
|
|
878
|
-
interface DrmConfig extends NativeInstanceConfig {
|
|
879
|
-
/**
|
|
880
|
-
* FairPlay specific configuration.
|
|
881
|
-
*
|
|
882
|
-
* @platform iOS
|
|
883
|
-
*/
|
|
884
|
-
fairplay?: FairplayConfig;
|
|
885
|
-
/**
|
|
886
|
-
* Widevine specific configuration.
|
|
887
|
-
*
|
|
888
|
-
* @platform Android, iOS (only for casting).
|
|
889
|
-
*/
|
|
890
|
-
widevine?: WidevineConfig;
|
|
891
|
-
}
|
|
892
|
-
/**
|
|
893
|
-
* Represents a native DRM configuration object.
|
|
894
|
-
* @internal
|
|
895
|
-
*/
|
|
896
|
-
declare class Drm extends NativeInstance<DrmConfig> {
|
|
897
|
-
/**
|
|
898
|
-
* Whether this object's native instance has been created.
|
|
899
|
-
*/
|
|
900
|
-
isInitialized: boolean;
|
|
901
|
-
/**
|
|
902
|
-
* Whether this object's native instance has been disposed.
|
|
903
|
-
*/
|
|
904
|
-
isDestroyed: boolean;
|
|
905
|
-
/**
|
|
906
|
-
* Allocates the DRM config instance and its resources natively.
|
|
907
|
-
*/
|
|
908
|
-
initialize: () => void;
|
|
909
|
-
/**
|
|
910
|
-
* Destroys the native DRM config and releases all of its allocated resources.
|
|
911
|
-
*/
|
|
912
|
-
destroy: () => void;
|
|
913
|
-
/**
|
|
914
|
-
* iOS only.
|
|
915
|
-
*
|
|
916
|
-
* Applies the user-defined `prepareCertificate` function to native's `certificate` data and store
|
|
917
|
-
* the result back in `DrmModule`.
|
|
918
|
-
*
|
|
919
|
-
* Called from native code when `FairplayConfig.prepareCertificate` is dispatched.
|
|
920
|
-
*
|
|
921
|
-
* @param certificate - Base64 encoded certificate data.
|
|
922
|
-
*/
|
|
923
|
-
onPrepareCertificate: (certificate: string) => void;
|
|
924
|
-
/**
|
|
925
|
-
* Applies the user-defined `prepareMessage` function to native's `message` data and store
|
|
926
|
-
* the result back in `DrmModule`.
|
|
927
|
-
*
|
|
928
|
-
* Called from native code when `prepareMessage` is dispatched.
|
|
929
|
-
*
|
|
930
|
-
* @param message - Base64 encoded message data.
|
|
931
|
-
* @param assetId - Optional asset ID. Only sent by iOS.
|
|
932
|
-
*/
|
|
933
|
-
onPrepareMessage: (message: string, assetId?: string) => void;
|
|
934
|
-
/**
|
|
935
|
-
* iOS only.
|
|
936
|
-
*
|
|
937
|
-
* Applies the user-defined `prepareSyncMessage` function to native's `syncMessage` data and
|
|
938
|
-
* store the result back in `DrmModule`.
|
|
939
|
-
*
|
|
940
|
-
* Called from native code when `FairplayConfig.prepareSyncMessage` is dispatched.
|
|
941
|
-
*
|
|
942
|
-
* @param syncMessage - Base64 encoded sync SPC message data.
|
|
943
|
-
*/
|
|
944
|
-
onPrepareSyncMessage: (syncMessage: string, assetId: string) => void;
|
|
945
|
-
/**
|
|
946
|
-
* Applies the user-defined `prepareLicense` function to native's `license` data and store
|
|
947
|
-
* the result back in `DrmModule`.
|
|
948
|
-
*
|
|
949
|
-
* Called from native code when `prepareLicense` is dispatched.
|
|
950
|
-
*
|
|
951
|
-
* @param license - Base64 encoded license data.
|
|
952
|
-
*/
|
|
953
|
-
onPrepareLicense: (license: string) => void;
|
|
954
|
-
/**
|
|
955
|
-
* iOS only.
|
|
956
|
-
*
|
|
957
|
-
* Applies the user-defined `prepareLicenseServerUrl` function to native's `licenseServerUrl` data
|
|
958
|
-
* and store the result back in `DrmModule`.
|
|
959
|
-
*
|
|
960
|
-
* Called from native code when `FairplayConfig.prepareLicenseServerUrl` is dispatched.
|
|
961
|
-
*
|
|
962
|
-
* @param licenseServerUrl - The license server URL string.
|
|
963
|
-
*/
|
|
964
|
-
onPrepareLicenseServerUrl: (licenseServerUrl: string) => void;
|
|
965
|
-
/**
|
|
966
|
-
* iOS only.
|
|
967
|
-
*
|
|
968
|
-
* Applies the user-defined `prepareContentId` function to native's `contentId` string
|
|
969
|
-
* and store the result back in `DrmModule`.
|
|
970
|
-
*
|
|
971
|
-
* Called from native code when `FairplayConfig.prepareContentId` is dispatched.
|
|
972
|
-
*
|
|
973
|
-
* @param contentId - The extracted contentId string.
|
|
974
|
-
*/
|
|
975
|
-
onPrepareContentId: (contentId: string) => void;
|
|
976
|
-
}
|
|
977
|
-
|
|
978
|
-
/**
|
|
979
|
-
* Represents a VTT thumbnail.
|
|
980
|
-
*/
|
|
981
|
-
interface Thumbnail {
|
|
982
|
-
/**
|
|
983
|
-
* The start time of the thumbnail.
|
|
984
|
-
*/
|
|
985
|
-
start: number;
|
|
986
|
-
/**
|
|
987
|
-
* The end time of the thumbnail.
|
|
988
|
-
*/
|
|
989
|
-
end: number;
|
|
990
|
-
/**
|
|
991
|
-
* The raw cue data.
|
|
992
|
-
*/
|
|
993
|
-
text: string;
|
|
994
|
-
/**
|
|
995
|
-
* The URL of the spritesheet
|
|
996
|
-
*/
|
|
997
|
-
url: string;
|
|
998
|
-
/**
|
|
999
|
-
* The horizontal offset of the thumbnail in its spritesheet
|
|
1000
|
-
*/
|
|
1001
|
-
x: number;
|
|
1002
|
-
/**
|
|
1003
|
-
* The vertical offset of the thumbnail in its spritesheet
|
|
1004
|
-
*/
|
|
1005
|
-
y: number;
|
|
1006
|
-
/**
|
|
1007
|
-
* The width of the thumbnail
|
|
1008
|
-
*/
|
|
1009
|
-
width: number;
|
|
1010
|
-
/**
|
|
1011
|
-
* The height of the thumbnail
|
|
1012
|
-
*/
|
|
1013
|
-
height: number;
|
|
1014
|
-
}
|
|
1015
|
-
|
|
1016
|
-
/**
|
|
1017
|
-
* Types of media that can be handled by the player.
|
|
1018
|
-
*/
|
|
1019
|
-
declare enum SourceType {
|
|
1020
|
-
/**
|
|
1021
|
-
* Indicates a missing source type.
|
|
1022
|
-
*/
|
|
1023
|
-
NONE = "none",
|
|
1024
|
-
/**
|
|
1025
|
-
* Indicates media type HLS.
|
|
1026
|
-
*/
|
|
1027
|
-
HLS = "hls",
|
|
1028
|
-
/**
|
|
1029
|
-
* Indicates media type DASH.
|
|
1030
|
-
*/
|
|
1031
|
-
DASH = "dash",
|
|
1032
|
-
/**
|
|
1033
|
-
* Indicates media type Progressive MP4.
|
|
1034
|
-
*/
|
|
1035
|
-
PROGRESSIVE = "progressive"
|
|
1036
|
-
}
|
|
1037
|
-
/**
|
|
1038
|
-
* The different loading states a {@link Source} instance can be in.
|
|
1039
|
-
*/
|
|
1040
|
-
declare enum LoadingState {
|
|
1041
|
-
/**
|
|
1042
|
-
* The source is unloaded.
|
|
1043
|
-
*/
|
|
1044
|
-
UNLOADED = 0,
|
|
1045
|
-
/**
|
|
1046
|
-
* The source is currently loading.
|
|
1047
|
-
*/
|
|
1048
|
-
LOADING = 1,
|
|
1049
|
-
/**
|
|
1050
|
-
* The source is loaded.
|
|
1051
|
-
*/
|
|
1052
|
-
LOADED = 2
|
|
1053
|
-
}
|
|
1054
|
-
/**
|
|
1055
|
-
* Types of SourceOptions.
|
|
1056
|
-
*/
|
|
1057
|
-
interface SourceOptions {
|
|
1058
|
-
/**
|
|
1059
|
-
* The position where the stream should be started.
|
|
1060
|
-
* Number can be positive or negative depending on the used `TimelineReferencePoint`.
|
|
1061
|
-
* Invalid numbers will be corrected according to the stream boundaries.
|
|
1062
|
-
* For VOD this is applied at the time the stream is loaded, for LIVE when playback starts.
|
|
1063
|
-
*/
|
|
1064
|
-
startOffset?: number;
|
|
1065
|
-
/**
|
|
1066
|
-
* Sets the Timeline reference point to calculate the startOffset from.
|
|
1067
|
-
* Default for live: `TimelineReferencePoint.END`.
|
|
1068
|
-
* Default for VOD: `TimelineReferencePoint.START`.
|
|
1069
|
-
*/
|
|
1070
|
-
startOffsetTimelineReference?: TimelineReferencePoint;
|
|
1071
|
-
}
|
|
1072
|
-
/**
|
|
1073
|
-
Timeline reference point to calculate SourceOptions.startOffset from.
|
|
1074
|
-
Default for live: TimelineReferencePoint.EBD Default for VOD: TimelineReferencePoint.START.
|
|
1075
|
-
*/
|
|
1076
|
-
declare enum TimelineReferencePoint {
|
|
1077
|
-
/**
|
|
1078
|
-
* Relative offset will be calculated from the beginning of the stream or DVR window.
|
|
1079
|
-
*/
|
|
1080
|
-
START = "start",
|
|
1081
|
-
/**
|
|
1082
|
-
* Relative offset will be calculated from the end of the stream or the live edge in case of a live stream with DVR window.
|
|
1083
|
-
*/
|
|
1084
|
-
END = "end"
|
|
1085
|
-
}
|
|
1086
|
-
/**
|
|
1087
|
-
* Represents a source configuration that be loaded into a player instance.
|
|
1088
|
-
*/
|
|
1089
|
-
interface SourceConfig extends NativeInstanceConfig {
|
|
1090
|
-
/**
|
|
1091
|
-
* The url for this source configuration.
|
|
1092
|
-
*/
|
|
1093
|
-
url: string;
|
|
1094
|
-
/**
|
|
1095
|
-
* The `SourceType` for this configuration.
|
|
1096
|
-
*/
|
|
1097
|
-
type?: SourceType;
|
|
1098
|
-
/**
|
|
1099
|
-
* The title of the video source.
|
|
1100
|
-
*/
|
|
1101
|
-
title?: string;
|
|
1102
|
-
/**
|
|
1103
|
-
* The description of the video source.
|
|
1104
|
-
*/
|
|
1105
|
-
description?: string;
|
|
1106
|
-
/**
|
|
1107
|
-
* The URL to a preview image displayed until the video starts.
|
|
1108
|
-
*/
|
|
1109
|
-
poster?: string;
|
|
1110
|
-
/**
|
|
1111
|
-
* Indicates whether to show the poster image during playback.
|
|
1112
|
-
* Useful, for example, for audio-only streams.
|
|
1113
|
-
*/
|
|
1114
|
-
isPosterPersistent?: boolean;
|
|
1115
|
-
/**
|
|
1116
|
-
* The DRM config for the source.
|
|
1117
|
-
*/
|
|
1118
|
-
drmConfig?: DrmConfig;
|
|
1119
|
-
/**
|
|
1120
|
-
* External subtitle tracks to be added into the player.
|
|
1121
|
-
*/
|
|
1122
|
-
subtitleTracks?: SideLoadedSubtitleTrack[];
|
|
1123
|
-
/**
|
|
1124
|
-
* External thumbnails to be added into the player.
|
|
1125
|
-
*/
|
|
1126
|
-
thumbnailTrack?: string;
|
|
1127
|
-
/**
|
|
1128
|
-
* The optional custom metadata. Also sent to the cast receiver when loading the Source.
|
|
1129
|
-
*/
|
|
1130
|
-
metadata?: Record<string, string>;
|
|
1131
|
-
/**
|
|
1132
|
-
* The `SourceOptions` for this configuration.
|
|
1133
|
-
*/
|
|
1134
|
-
options?: SourceOptions;
|
|
1135
|
-
/**
|
|
1136
|
-
* The `SourceMetadata` for the {@link Source} to setup custom analytics tracking
|
|
1137
|
-
*/
|
|
1138
|
-
analyticsSourceMetadata?: SourceMetadata;
|
|
1139
|
-
}
|
|
1140
|
-
/**
|
|
1141
|
-
* The remote control config for a source.
|
|
1142
|
-
* @platform iOS
|
|
1143
|
-
*/
|
|
1144
|
-
interface SourceRemoteControlConfig {
|
|
1145
|
-
/**
|
|
1146
|
-
* The `SourceConfig` for casting.
|
|
1147
|
-
* Enables to play different content when casting.
|
|
1148
|
-
* This can be useful when the remote playback device supports different streaming formats,
|
|
1149
|
-
* DRM systems, etc. than the local device.
|
|
1150
|
-
* If not set, the local source config will be used for casting.
|
|
1151
|
-
*/
|
|
1152
|
-
castSourceConfig?: SourceConfig | null;
|
|
1153
|
-
}
|
|
1154
|
-
/**
|
|
1155
|
-
* Represents audio and video content that can be loaded into a player.
|
|
1156
|
-
*/
|
|
1157
|
-
declare class Source extends NativeInstance<SourceConfig> {
|
|
1158
|
-
/**
|
|
1159
|
-
* The native DRM config reference of this source.
|
|
1160
|
-
*/
|
|
1161
|
-
private drm?;
|
|
1162
|
-
/**
|
|
1163
|
-
* The remote control config for this source.
|
|
1164
|
-
* This is only supported on iOS.
|
|
1165
|
-
*
|
|
1166
|
-
* @platform iOS
|
|
1167
|
-
*/
|
|
1168
|
-
remoteControl: SourceRemoteControlConfig | null;
|
|
1169
|
-
/**
|
|
1170
|
-
* Whether the native {@link Source} object has been created.
|
|
1171
|
-
*/
|
|
1172
|
-
isInitialized: boolean;
|
|
1173
|
-
/**
|
|
1174
|
-
* Whether the native {@link Source} object has been disposed.
|
|
1175
|
-
*/
|
|
1176
|
-
isDestroyed: boolean;
|
|
1177
|
-
/**
|
|
1178
|
-
* Allocates the native {@link Source} instance and its resources natively.
|
|
1179
|
-
*/
|
|
1180
|
-
initialize: () => void;
|
|
1181
|
-
/**
|
|
1182
|
-
* Destroys the native {@link Source} and releases all of its allocated resources.
|
|
1183
|
-
*/
|
|
1184
|
-
destroy: () => void;
|
|
1185
|
-
/**
|
|
1186
|
-
* The duration of the source in seconds if it’s a VoD or `INFINITY` if it’s a live stream.
|
|
1187
|
-
* Default value is `0` if the duration is not available or not known.
|
|
1188
|
-
*/
|
|
1189
|
-
duration: () => Promise<number>;
|
|
1190
|
-
/**
|
|
1191
|
-
* Whether the source is currently active in a player (i.e. playing back or paused).
|
|
1192
|
-
* Only one source can be active in the same player instance at any time.
|
|
1193
|
-
*/
|
|
1194
|
-
isActive: () => Promise<boolean>;
|
|
1195
|
-
/**
|
|
1196
|
-
* Whether the source is currently attached to a player instance.
|
|
1197
|
-
*/
|
|
1198
|
-
isAttachedToPlayer: () => Promise<boolean>;
|
|
1199
|
-
/**
|
|
1200
|
-
* Metadata for the currently loaded source.
|
|
1201
|
-
*/
|
|
1202
|
-
metadata: () => Promise<Record<string, any> | null>;
|
|
1203
|
-
/**
|
|
1204
|
-
* Set metadata for the currently loaded source.
|
|
1205
|
-
* Setting the metadata to `null` clears the metadata object in native source.
|
|
1206
|
-
*
|
|
1207
|
-
* @param metadata metadata to be set.
|
|
1208
|
-
*/
|
|
1209
|
-
setMetadata: (metadata: Record<string, any> | null) => void;
|
|
1210
|
-
/**
|
|
1211
|
-
* The current `LoadingState` of the source.
|
|
1212
|
-
*/
|
|
1213
|
-
loadingState: () => Promise<LoadingState>;
|
|
1214
|
-
/**
|
|
1215
|
-
* @returns a `Thumbnail` for the specified playback time if available.
|
|
1216
|
-
* Supported thumbnail formats are:
|
|
1217
|
-
* - `WebVtt` configured via {@link SourceConfig.thumbnailTrack}, on all supported platforms
|
|
1218
|
-
* - HLS `Image Media Playlist` in the multivariant playlist, Android-only
|
|
1219
|
-
* - DASH `Image Adaptation Set` as specified in DASH-IF IOP, Android-only
|
|
1220
|
-
* If a `WebVtt` thumbnail track is provided, any potential in-manifest thumbnails are ignored on Android.
|
|
1221
|
-
*
|
|
1222
|
-
* @param time - The time in seconds for which to retrieve the thumbnail.
|
|
1223
|
-
*/
|
|
1224
|
-
getThumbnail: (time: number) => Promise<Thumbnail | null>;
|
|
1225
|
-
}
|
|
1226
|
-
|
|
1227
|
-
/**
|
|
1228
|
-
* Available HTTP request types.
|
|
1229
|
-
*/
|
|
1230
|
-
declare enum HttpRequestType {
|
|
1231
|
-
ManifestDash = "manifest/dash",
|
|
1232
|
-
ManifestHlsMaster = "manifest/hls/master",
|
|
1233
|
-
ManifestHlsVariant = "manifest/hls/variant",
|
|
1234
|
-
ManifestSmooth = "manifest/smooth",
|
|
1235
|
-
MediaProgressive = "media/progressive",
|
|
1236
|
-
MediaAudio = "media/audio",
|
|
1237
|
-
MediaVideo = "media/video",
|
|
1238
|
-
MediaSubtitles = "media/subtitles",
|
|
1239
|
-
MediaThumbnails = "media/thumbnails",
|
|
1240
|
-
DrmLicenseFairplay = "drm/license/fairplay",
|
|
1241
|
-
DrmCertificateFairplay = "drm/certificate/fairplay",
|
|
1242
|
-
DrmLicenseWidevine = "drm/license/widevine",
|
|
1243
|
-
KeyHlsAes = "key/hls/aes",
|
|
1244
|
-
Unknown = "unknown"
|
|
1245
|
-
}
|
|
1246
|
-
/**
|
|
1247
|
-
* Base64-encoded string representing the HTTP request body.
|
|
1248
|
-
*/
|
|
1249
|
-
type HttpRequestBody = string;
|
|
1250
|
-
/** Represents an HTTP request. */
|
|
1251
|
-
interface HttpRequest {
|
|
1252
|
-
/** The {@link HttpRequestBody} to send to the server. */
|
|
1253
|
-
body?: HttpRequestBody;
|
|
1254
|
-
/**
|
|
1255
|
-
* The HTTP Headers of the request.
|
|
1256
|
-
* Entries are expected to have the HTTP header as the key and its string content as the value.
|
|
1257
|
-
*/
|
|
1258
|
-
headers: Record<string, string>;
|
|
1259
|
-
/** The HTTP method of the request. */
|
|
1260
|
-
method: string;
|
|
1261
|
-
/** The URL of the request. */
|
|
1262
|
-
url: string;
|
|
1263
|
-
}
|
|
1264
|
-
/**
|
|
1265
|
-
* Base64-encoded string representing the HTTP response body.
|
|
1266
|
-
*/
|
|
1267
|
-
type HttpResponseBody = string;
|
|
1268
|
-
/** Represents an HTTP response. */
|
|
1269
|
-
interface HttpResponse {
|
|
1270
|
-
/** The {@link HttpRequestBody} of the response. */
|
|
1271
|
-
body?: HttpResponseBody;
|
|
1272
|
-
/**
|
|
1273
|
-
* The HTTP Headers of the response.
|
|
1274
|
-
* Entries are expected to have the HTTP header as the key and its string content as the value.
|
|
1275
|
-
*/
|
|
1276
|
-
headers: Record<string, string>;
|
|
1277
|
-
/** The corresponding request object of the response. */
|
|
1278
|
-
request: HttpRequest;
|
|
1279
|
-
/** The HTTP status code of the response. */
|
|
1280
|
-
status: number;
|
|
1281
|
-
/** The URL of the response. May differ from {@link HttpRequest.url} when redirects have happened. */
|
|
1282
|
-
url: string;
|
|
1283
|
-
}
|
|
1284
|
-
/**
|
|
1285
|
-
* The network API gives the ability to influence network requests.
|
|
1286
|
-
* It enables preprocessing requests and preprocessing responses.
|
|
1287
|
-
*/
|
|
1288
|
-
interface NetworkConfig extends NativeInstanceConfig {
|
|
1289
|
-
/**
|
|
1290
|
-
* Called before an HTTP request is made.
|
|
1291
|
-
* Can be used to change request parameters.
|
|
1292
|
-
*
|
|
1293
|
-
* @param type Type of the request to be made.
|
|
1294
|
-
* @param request The HTTP request to process.
|
|
1295
|
-
* @returns A Promise that resolves to an `HttpRequest` object.
|
|
1296
|
-
* - If the promise resolves, the player will use the processed request.
|
|
1297
|
-
* - If the promise rejects, the player will fall back to using the original request.
|
|
1298
|
-
*
|
|
1299
|
-
* @examples
|
|
1300
|
-
* ```
|
|
1301
|
-
* const requestCallback = (type: HttpRequestType, request: HttpRequest) => {
|
|
1302
|
-
* // Access current properties
|
|
1303
|
-
*
|
|
1304
|
-
* console.log(JSON.stringify(type));
|
|
1305
|
-
* console.log(JSON.stringify(request));
|
|
1306
|
-
*
|
|
1307
|
-
* // Modify the request
|
|
1308
|
-
*
|
|
1309
|
-
* request.headers['New-Header'] = 'val';
|
|
1310
|
-
* request.method = 'GET';
|
|
1311
|
-
*
|
|
1312
|
-
* // Return the processed request via a Promise
|
|
1313
|
-
*
|
|
1314
|
-
* const processed: HttpRequest = {
|
|
1315
|
-
* body: request.body,
|
|
1316
|
-
* headers: request.headers,
|
|
1317
|
-
* method: request.method,
|
|
1318
|
-
* url: request.url,
|
|
1319
|
-
* };
|
|
1320
|
-
* return Promise.resolve(processed);
|
|
1321
|
-
* };
|
|
1322
|
-
*
|
|
1323
|
-
* const player = usePlayer({
|
|
1324
|
-
* networkConfig: {
|
|
1325
|
-
* preprocessHttpRequest: requestCallback,
|
|
1326
|
-
* },
|
|
1327
|
-
* });
|
|
1328
|
-
* ```
|
|
1329
|
-
*/
|
|
1330
|
-
preprocessHttpRequest?: (type: HttpRequestType, request: HttpRequest) => Promise<HttpRequest>;
|
|
1331
|
-
/**
|
|
1332
|
-
* Called before an HTTP response is accessed by the player.
|
|
1333
|
-
* Can be used to access or change the response.
|
|
1334
|
-
*
|
|
1335
|
-
* @param type Type of the corresponding request object of the response.
|
|
1336
|
-
* @param response The HTTP response to process.
|
|
1337
|
-
* @returns A Promise that resolves to an `HttpResponse` object.
|
|
1338
|
-
* - If the promise resolves, the player will use the processed response.
|
|
1339
|
-
* - If the promise rejects, the player will fall back to using the original response.
|
|
1340
|
-
*
|
|
1341
|
-
* @example
|
|
1342
|
-
* ```
|
|
1343
|
-
* const responseCallback = (type: HttpRequestType, response: HttpResponse) => {
|
|
1344
|
-
* // Access response properties
|
|
1345
|
-
*
|
|
1346
|
-
* console.log(JSON.stringify(type));
|
|
1347
|
-
* console.log(JSON.stringify(response));
|
|
1348
|
-
*
|
|
1349
|
-
* // Modify the response
|
|
1350
|
-
*
|
|
1351
|
-
* response.headers['New-Header'] = 'val';
|
|
1352
|
-
* response.url = response.request.url; // remove eventual redirect changes
|
|
1353
|
-
*
|
|
1354
|
-
* // Return the processed response via a Promise
|
|
1355
|
-
*
|
|
1356
|
-
* const processed: HttpResponse = {
|
|
1357
|
-
* body: response.body,
|
|
1358
|
-
* headers: response.headers,
|
|
1359
|
-
* request: response.request,
|
|
1360
|
-
* status: response.status,
|
|
1361
|
-
* url: response.url,
|
|
1362
|
-
* };
|
|
1363
|
-
* return Promise.resolve(processed);
|
|
1364
|
-
* };
|
|
1365
|
-
*
|
|
1366
|
-
* // Properly attach the callback to the config
|
|
1367
|
-
* const player = usePlayer({
|
|
1368
|
-
* networkConfig: {
|
|
1369
|
-
* preprocessHttpResponse: responseCallback,
|
|
1370
|
-
* },
|
|
1371
|
-
* });
|
|
1372
|
-
* ```
|
|
1373
|
-
*/
|
|
1374
|
-
preprocessHttpResponse?: (type: HttpRequestType, response: HttpResponse) => Promise<HttpResponse>;
|
|
1375
|
-
}
|
|
1376
|
-
|
|
1377
|
-
/**
|
|
1378
|
-
* Base event type for all events.
|
|
1379
|
-
*/
|
|
1380
|
-
interface Event {
|
|
1381
|
-
/**
|
|
1382
|
-
* This event name as it is on the native side.
|
|
1383
|
-
*/
|
|
1384
|
-
name: string;
|
|
1385
|
-
/**
|
|
1386
|
-
* The UNIX timestamp in which this event happened.
|
|
1387
|
-
*/
|
|
1388
|
-
timestamp: number;
|
|
1389
|
-
}
|
|
1390
|
-
/**
|
|
1391
|
-
* Base event type for error and warning events.
|
|
1392
|
-
*/
|
|
1393
|
-
interface ErrorEvent extends Event {
|
|
1394
|
-
/**
|
|
1395
|
-
* Error/Warning's code number.
|
|
1396
|
-
*/
|
|
1397
|
-
code?: number;
|
|
1398
|
-
/**
|
|
1399
|
-
* Error/Warning's localized message.
|
|
1400
|
-
*/
|
|
1401
|
-
message: string;
|
|
1402
|
-
/**
|
|
1403
|
-
* Underlying data emitted with the error or warning.
|
|
1404
|
-
*/
|
|
1405
|
-
data?: Record<string, any>;
|
|
1406
|
-
}
|
|
1407
|
-
/**
|
|
1408
|
-
* Emitted when a source is loaded into the player.
|
|
1409
|
-
* Seeking and time shifting are allowed as soon as this event is seen.
|
|
1410
|
-
*/
|
|
1411
|
-
interface PlayerActiveEvent extends Event {
|
|
1412
|
-
}
|
|
1413
|
-
/**
|
|
1414
|
-
* Emitted when a player error occurred.
|
|
1415
|
-
*/
|
|
1416
|
-
interface PlayerErrorEvent extends ErrorEvent {
|
|
1417
|
-
}
|
|
1418
|
-
/**
|
|
1419
|
-
* Emitted when a player warning occurred.
|
|
1420
|
-
*/
|
|
1421
|
-
interface PlayerWarningEvent extends ErrorEvent {
|
|
1422
|
-
}
|
|
1423
|
-
/**
|
|
1424
|
-
* Emitted when the player is destroyed.
|
|
1425
|
-
*/
|
|
1426
|
-
interface DestroyEvent extends Event {
|
|
1427
|
-
}
|
|
1428
|
-
/**
|
|
1429
|
-
* Emitted when the player is muted.
|
|
1430
|
-
*/
|
|
1431
|
-
interface MutedEvent extends Event {
|
|
1432
|
-
}
|
|
1433
|
-
/**
|
|
1434
|
-
* Emitted when the player is unmuted.
|
|
1435
|
-
*/
|
|
1436
|
-
interface UnmutedEvent extends Event {
|
|
1437
|
-
}
|
|
1438
|
-
/**
|
|
1439
|
-
* Emitted when the player is ready for immediate playback, because initial audio/video
|
|
1440
|
-
* has been downloaded.
|
|
1441
|
-
*/
|
|
1442
|
-
interface ReadyEvent extends Event {
|
|
1443
|
-
}
|
|
1444
|
-
/**
|
|
1445
|
-
* Emitted when the player is paused.
|
|
1446
|
-
*/
|
|
1447
|
-
interface PausedEvent extends Event {
|
|
1448
|
-
/**
|
|
1449
|
-
* The player's playback time from when this event happened.
|
|
1450
|
-
*/
|
|
1451
|
-
time: number;
|
|
1452
|
-
}
|
|
1453
|
-
/**
|
|
1454
|
-
* Emitted when the player received an intention to start/resume playback.
|
|
1455
|
-
*/
|
|
1456
|
-
interface PlayEvent extends Event {
|
|
1457
|
-
/**
|
|
1458
|
-
* The player's playback time from when this event happened.
|
|
1459
|
-
*/
|
|
1460
|
-
time: number;
|
|
1461
|
-
}
|
|
1462
|
-
/**
|
|
1463
|
-
* Emitted when playback has started.
|
|
1464
|
-
*/
|
|
1465
|
-
interface PlayingEvent extends Event {
|
|
1466
|
-
/**
|
|
1467
|
-
* The player's playback time from when this event happened.
|
|
1468
|
-
*/
|
|
1469
|
-
time: number;
|
|
1470
|
-
}
|
|
1471
|
-
/**
|
|
1472
|
-
* Emitted when the playback of the current media has finished.
|
|
1473
|
-
*/
|
|
1474
|
-
interface PlaybackFinishedEvent extends Event {
|
|
1475
|
-
}
|
|
1476
|
-
/**
|
|
1477
|
-
* Source object representation the way it appears on event's payloads such as `SeekEvent`, for example.
|
|
1478
|
-
*
|
|
1479
|
-
* This interface only type hints what should be the shape of a {@link Source} object inside an event's
|
|
1480
|
-
* payload during runtime so it has no direct relation with the `Source` class present in `src/source.ts`.
|
|
1481
|
-
*
|
|
1482
|
-
* Do not mistake it for a `NativeInstance` type.
|
|
1483
|
-
*/
|
|
1484
|
-
interface EventSource {
|
|
1485
|
-
/**
|
|
1486
|
-
* Event's source duration in seconds.
|
|
1487
|
-
*/
|
|
1488
|
-
duration: number;
|
|
1489
|
-
/**
|
|
1490
|
-
* Whether this event's source is currently active in a player.
|
|
1491
|
-
*/
|
|
1492
|
-
isActive: boolean;
|
|
1493
|
-
/**
|
|
1494
|
-
* Whether this event's source is currently attached to a player instance.
|
|
1495
|
-
*/
|
|
1496
|
-
isAttachedToPlayer: boolean;
|
|
1497
|
-
/**
|
|
1498
|
-
* Metadata for this event's source.
|
|
1499
|
-
*/
|
|
1500
|
-
metadata?: Record<string, any>;
|
|
1501
|
-
/**
|
|
1502
|
-
* The current {@link LoadingState} of the source.
|
|
1503
|
-
*/
|
|
1504
|
-
loadingState: LoadingState;
|
|
1505
|
-
}
|
|
1506
|
-
/**
|
|
1507
|
-
* Represents a seeking position.
|
|
1508
|
-
*/
|
|
1509
|
-
interface SeekPosition {
|
|
1510
|
-
/**
|
|
1511
|
-
* The relevant {@link Source}.
|
|
1512
|
-
*/
|
|
1513
|
-
source: EventSource;
|
|
1514
|
-
/**
|
|
1515
|
-
* The position within the {@link Source} in seconds.
|
|
1516
|
-
*/
|
|
1517
|
-
time: number;
|
|
1518
|
-
}
|
|
1519
|
-
/**
|
|
1520
|
-
* Emitted when the player is about to seek to a new position.
|
|
1521
|
-
* This event only applies to VoD streams.
|
|
1522
|
-
* When looking for an equivalent for live streams, the {@link TimeShiftEvent} is relevant.
|
|
1523
|
-
*/
|
|
1524
|
-
interface SeekEvent extends Event {
|
|
1525
|
-
/**
|
|
1526
|
-
* Origin source metadata.
|
|
1527
|
-
*/
|
|
1528
|
-
from: SeekPosition;
|
|
1529
|
-
/**
|
|
1530
|
-
* Target source metadata.
|
|
1531
|
-
*/
|
|
1532
|
-
to: SeekPosition;
|
|
1533
|
-
}
|
|
1534
|
-
/**
|
|
1535
|
-
* Emitted when seeking has finished and data to continue playback is available.
|
|
1536
|
-
* This event only applies to VoD streams.
|
|
1537
|
-
* When looking for an equivalent for live streams, the {@link TimeShiftedEvent} is relevant.
|
|
1538
|
-
*/
|
|
1539
|
-
interface SeekedEvent extends Event {
|
|
1540
|
-
}
|
|
1541
|
-
/**
|
|
1542
|
-
* Emitted when the player starts time shifting.
|
|
1543
|
-
* This event only applies to live streams.
|
|
1544
|
-
* When looking for an equivalent for VoD streams, the {@link SeekEvent} is relevant.
|
|
1545
|
-
*/
|
|
1546
|
-
interface TimeShiftEvent extends Event {
|
|
1547
|
-
/**
|
|
1548
|
-
* The position from which we start the time shift
|
|
1549
|
-
*/
|
|
1550
|
-
position: number;
|
|
1551
|
-
/**
|
|
1552
|
-
* The position to which we want to jump for the time shift
|
|
1553
|
-
*/
|
|
1554
|
-
targetPosition: number;
|
|
1555
|
-
}
|
|
1556
|
-
/**
|
|
1557
|
-
* Emitted when time shifting has finished and data is available to continue playback.
|
|
1558
|
-
* This event only applies to live streams.
|
|
1559
|
-
* When looking for an equivalent for VoD streams, the {@link SeekedEvent} is relevant.
|
|
1560
|
-
*/
|
|
1561
|
-
interface TimeShiftedEvent extends Event {
|
|
1562
|
-
}
|
|
1563
|
-
/**
|
|
1564
|
-
* Emitted when the player begins to stall and to buffer due to an empty buffer.
|
|
1565
|
-
*/
|
|
1566
|
-
interface StallStartedEvent extends Event {
|
|
1567
|
-
}
|
|
1568
|
-
/**
|
|
1569
|
-
* Emitted when the player ends stalling, due to enough data in the buffer.
|
|
1570
|
-
*/
|
|
1571
|
-
interface StallEndedEvent extends Event {
|
|
1572
|
-
}
|
|
1573
|
-
/**
|
|
1574
|
-
* Emitted when the current playback time has changed.
|
|
1575
|
-
*/
|
|
1576
|
-
interface TimeChangedEvent extends Event {
|
|
1577
|
-
/**
|
|
1578
|
-
* The player's playback time from when this event happened.
|
|
1579
|
-
*/
|
|
1580
|
-
currentTime: number;
|
|
1581
|
-
}
|
|
1582
|
-
/**
|
|
1583
|
-
* Emitted when a new source loading has started.
|
|
1584
|
-
*/
|
|
1585
|
-
interface SourceLoadEvent extends Event {
|
|
1586
|
-
/**
|
|
1587
|
-
* Source that is about to load.
|
|
1588
|
-
*/
|
|
1589
|
-
source: EventSource;
|
|
1590
|
-
}
|
|
1591
|
-
/**
|
|
1592
|
-
* Emitted when a new source is loaded.
|
|
1593
|
-
* This does not mean that the source is immediately ready for playback.
|
|
1594
|
-
* {@link ReadyEvent} indicates the player is ready for immediate playback.
|
|
1595
|
-
*/
|
|
1596
|
-
interface SourceLoadedEvent extends Event {
|
|
1597
|
-
/**
|
|
1598
|
-
* Source that was loaded into player.
|
|
1599
|
-
*/
|
|
1600
|
-
source: EventSource;
|
|
1601
|
-
}
|
|
1602
|
-
/**
|
|
1603
|
-
* Emitted when the current source has been unloaded.
|
|
1604
|
-
*/
|
|
1605
|
-
interface SourceUnloadedEvent extends Event {
|
|
1606
|
-
/**
|
|
1607
|
-
* Source that was unloaded from player.
|
|
1608
|
-
*/
|
|
1609
|
-
source: EventSource;
|
|
1610
|
-
}
|
|
1611
|
-
/**
|
|
1612
|
-
* Emitted when a source error occurred.
|
|
1613
|
-
*/
|
|
1614
|
-
interface SourceErrorEvent extends ErrorEvent {
|
|
1615
|
-
}
|
|
1616
|
-
/**
|
|
1617
|
-
* Emitted when a source warning occurred.
|
|
1618
|
-
*/
|
|
1619
|
-
interface SourceWarningEvent extends ErrorEvent {
|
|
1620
|
-
}
|
|
1621
|
-
/**
|
|
1622
|
-
* Emitted when a new audio track is added to the player.
|
|
1623
|
-
*/
|
|
1624
|
-
interface AudioAddedEvent extends Event {
|
|
1625
|
-
/**
|
|
1626
|
-
* Audio track that has been added.
|
|
1627
|
-
*/
|
|
1628
|
-
audioTrack: AudioTrack;
|
|
1629
|
-
}
|
|
1630
|
-
/**
|
|
1631
|
-
* Emitted when the player's selected audio track has changed.
|
|
1632
|
-
*/
|
|
1633
|
-
interface AudioChangedEvent extends Event {
|
|
1634
|
-
/**
|
|
1635
|
-
* Audio track that was previously selected.
|
|
1636
|
-
*/
|
|
1637
|
-
oldAudioTrack: AudioTrack;
|
|
1638
|
-
/**
|
|
1639
|
-
* Audio track that is selected now.
|
|
1640
|
-
*/
|
|
1641
|
-
newAudioTrack: AudioTrack;
|
|
1642
|
-
}
|
|
1643
|
-
/**
|
|
1644
|
-
* Emitted when an audio track is removed from the player.
|
|
1645
|
-
*/
|
|
1646
|
-
interface AudioRemovedEvent extends Event {
|
|
1647
|
-
/**
|
|
1648
|
-
* Audio track that has been removed.
|
|
1649
|
-
*/
|
|
1650
|
-
audioTrack: AudioTrack;
|
|
1651
|
-
}
|
|
1652
|
-
/**
|
|
1653
|
-
* Emitted when a new subtitle track is added to the player.
|
|
1654
|
-
*/
|
|
1655
|
-
interface SubtitleAddedEvent extends Event {
|
|
1656
|
-
/**
|
|
1657
|
-
* Subtitle track that has been added.
|
|
1658
|
-
*/
|
|
1659
|
-
subtitleTrack: SubtitleTrack;
|
|
1660
|
-
}
|
|
1661
|
-
/**
|
|
1662
|
-
* Emitted when a subtitle track is removed from the player.
|
|
1663
|
-
*/
|
|
1664
|
-
interface SubtitleRemovedEvent extends Event {
|
|
1665
|
-
/**
|
|
1666
|
-
* Subtitle track that has been removed.
|
|
1667
|
-
*/
|
|
1668
|
-
subtitleTrack: SubtitleTrack;
|
|
1669
|
-
}
|
|
1670
|
-
/**
|
|
1671
|
-
* Emitted when the player's selected subtitle track has changed.
|
|
1672
|
-
*/
|
|
1673
|
-
interface SubtitleChangedEvent extends Event {
|
|
1674
|
-
/**
|
|
1675
|
-
* Subtitle track that was previously selected.
|
|
1676
|
-
*/
|
|
1677
|
-
oldSubtitleTrack: SubtitleTrack;
|
|
1678
|
-
/**
|
|
1679
|
-
* Subtitle track that is selected now.
|
|
1680
|
-
*/
|
|
1681
|
-
newSubtitleTrack: SubtitleTrack;
|
|
1682
|
-
}
|
|
1683
|
-
/**
|
|
1684
|
-
* Emitted when the player enters Picture in Picture mode.
|
|
1685
|
-
*
|
|
1686
|
-
* @platform iOS, Android
|
|
1687
|
-
*/
|
|
1688
|
-
interface PictureInPictureEnterEvent extends Event {
|
|
1689
|
-
}
|
|
1690
|
-
/**
|
|
1691
|
-
* Emitted when the player exits Picture in Picture mode.
|
|
1692
|
-
*
|
|
1693
|
-
* @platform iOS, Android
|
|
1694
|
-
*/
|
|
1695
|
-
interface PictureInPictureExitEvent extends Event {
|
|
1696
|
-
}
|
|
1697
|
-
/**
|
|
1698
|
-
* Emitted when the player has finished entering Picture in Picture mode on iOS.
|
|
1699
|
-
*
|
|
1700
|
-
* @platform iOS
|
|
1701
|
-
*/
|
|
1702
|
-
interface PictureInPictureEnteredEvent extends Event {
|
|
1703
|
-
}
|
|
1704
|
-
/**
|
|
1705
|
-
* Emitted when the player has finished exiting Picture in Picture mode on iOS.
|
|
1706
|
-
*
|
|
1707
|
-
* @platform iOS
|
|
1708
|
-
*/
|
|
1709
|
-
interface PictureInPictureExitedEvent extends Event {
|
|
1710
|
-
}
|
|
1711
|
-
/**
|
|
1712
|
-
* Emitted when the fullscreen functionality has been enabled.
|
|
1713
|
-
*
|
|
1714
|
-
* @platform iOS, Android
|
|
1715
|
-
*/
|
|
1716
|
-
interface FullscreenEnabledEvent extends Event {
|
|
1717
|
-
}
|
|
1718
|
-
/**
|
|
1719
|
-
* Emitted when the fullscreen functionality has been disabled.
|
|
1720
|
-
*
|
|
1721
|
-
* @platform iOS, Android
|
|
1722
|
-
*/
|
|
1723
|
-
interface FullscreenDisabledEvent extends Event {
|
|
1724
|
-
}
|
|
1725
|
-
/**
|
|
1726
|
-
* Emitted when the player enters fullscreen mode.
|
|
1727
|
-
*
|
|
1728
|
-
* @platform iOS, Android
|
|
1729
|
-
*/
|
|
1730
|
-
interface FullscreenEnterEvent extends Event {
|
|
1731
|
-
}
|
|
1732
|
-
/**
|
|
1733
|
-
* Emitted when the player exits fullscreen mode.
|
|
1734
|
-
*
|
|
1735
|
-
* @platform iOS, Android
|
|
1736
|
-
*/
|
|
1737
|
-
interface FullscreenExitEvent extends Event {
|
|
1738
|
-
}
|
|
1739
|
-
/**
|
|
1740
|
-
* Emitted when the availability of the Picture in Picture mode changed on Android.
|
|
1741
|
-
*
|
|
1742
|
-
* @platform Android
|
|
1743
|
-
*/
|
|
1744
|
-
interface PictureInPictureAvailabilityChangedEvent extends Event {
|
|
1745
|
-
/**
|
|
1746
|
-
* Whether Picture in Picture is available.
|
|
1747
|
-
*/
|
|
1748
|
-
isPictureInPictureAvailable: boolean;
|
|
1749
|
-
}
|
|
1750
|
-
/**
|
|
1751
|
-
* Emitted when an ad break has started.
|
|
1752
|
-
*/
|
|
1753
|
-
interface AdBreakStartedEvent extends Event {
|
|
1754
|
-
/**
|
|
1755
|
-
* The {@link AdBreak} that has started.
|
|
1756
|
-
*/
|
|
1757
|
-
adBreak?: AdBreak;
|
|
1758
|
-
}
|
|
1759
|
-
/**
|
|
1760
|
-
* Emitted when an ad break has finished.
|
|
1761
|
-
*/
|
|
1762
|
-
interface AdBreakFinishedEvent extends Event {
|
|
1763
|
-
/**
|
|
1764
|
-
* The {@link AdBreak} that has finished.
|
|
1765
|
-
*/
|
|
1766
|
-
adBreak?: AdBreak;
|
|
1767
|
-
}
|
|
1768
|
-
/**
|
|
1769
|
-
* Emitted when the playback of an ad has started.
|
|
1770
|
-
*/
|
|
1771
|
-
interface AdStartedEvent extends Event {
|
|
1772
|
-
/**
|
|
1773
|
-
* The {@link Ad} this event is related to.
|
|
1774
|
-
*/
|
|
1775
|
-
ad?: Ad;
|
|
1776
|
-
/**
|
|
1777
|
-
* The target URL to open once the user clicks on the ad.
|
|
1778
|
-
*/
|
|
1779
|
-
clickThroughUrl?: string;
|
|
1780
|
-
/**
|
|
1781
|
-
* The {@link AdSourceType} of the started ad.
|
|
1782
|
-
*/
|
|
1783
|
-
clientType?: AdSourceType;
|
|
1784
|
-
/**
|
|
1785
|
-
* The duration of the ad in seconds.
|
|
1786
|
-
*/
|
|
1787
|
-
duration: number;
|
|
1788
|
-
/**
|
|
1789
|
-
* The index of the ad in the queue.
|
|
1790
|
-
*/
|
|
1791
|
-
indexInQueue: number;
|
|
1792
|
-
/**
|
|
1793
|
-
* The position of the corresponding ad.
|
|
1794
|
-
*/
|
|
1795
|
-
position?: string;
|
|
1796
|
-
/**
|
|
1797
|
-
* The skip offset of the ad in seconds.
|
|
1798
|
-
*/
|
|
1799
|
-
skipOffset: number;
|
|
1800
|
-
/**
|
|
1801
|
-
* The main content time at which the ad is played.
|
|
1802
|
-
*/
|
|
1803
|
-
timeOffset: number;
|
|
1804
|
-
}
|
|
1805
|
-
/**
|
|
1806
|
-
* Emitted when an ad has finished playback.
|
|
1807
|
-
*/
|
|
1808
|
-
interface AdFinishedEvent extends Event {
|
|
1809
|
-
/**
|
|
1810
|
-
* The {@link Ad} that finished playback.
|
|
1811
|
-
*/
|
|
1812
|
-
ad?: Ad;
|
|
1813
|
-
}
|
|
1814
|
-
/**
|
|
1815
|
-
* Emitted when an error with the ad playback occurs.
|
|
1816
|
-
*/
|
|
1817
|
-
interface AdErrorEvent extends ErrorEvent {
|
|
1818
|
-
/**
|
|
1819
|
-
* The {@link AdConfig} for which the ad error occurred.
|
|
1820
|
-
*/
|
|
1821
|
-
adConfig?: AdConfig;
|
|
1822
|
-
/**
|
|
1823
|
-
* The {@link AdItem} for which the ad error occurred.
|
|
1824
|
-
*/
|
|
1825
|
-
adItem?: AdItem;
|
|
1826
|
-
}
|
|
1827
|
-
/**
|
|
1828
|
-
* Emitted when an ad was clicked.
|
|
1829
|
-
*/
|
|
1830
|
-
interface AdClickedEvent extends Event {
|
|
1831
|
-
/**
|
|
1832
|
-
* The click through url of the ad.
|
|
1833
|
-
*/
|
|
1834
|
-
clickThroughUrl?: string;
|
|
1835
|
-
}
|
|
1836
|
-
/**
|
|
1837
|
-
* Emitted when an ad was skipped.
|
|
1838
|
-
*/
|
|
1839
|
-
interface AdSkippedEvent extends Event {
|
|
1840
|
-
/**
|
|
1841
|
-
* The ad that was skipped.
|
|
1842
|
-
*/
|
|
1843
|
-
ad?: Ad;
|
|
1844
|
-
}
|
|
1845
|
-
/**
|
|
1846
|
-
* Emitted when the playback of an ad has progressed over a quartile boundary.
|
|
1847
|
-
*/
|
|
1848
|
-
interface AdQuartileEvent extends Event {
|
|
1849
|
-
/**
|
|
1850
|
-
* The {@link AdQuartile} boundary that playback has progressed over.
|
|
1851
|
-
*/
|
|
1852
|
-
quartile: AdQuartile;
|
|
1853
|
-
}
|
|
1854
|
-
/**
|
|
1855
|
-
* Emitted when an ad manifest was successfully downloaded, parsed and added into the ad break schedule.
|
|
1856
|
-
*/
|
|
1857
|
-
interface AdScheduledEvent extends Event {
|
|
1858
|
-
/**
|
|
1859
|
-
* The total number of scheduled ads.
|
|
1860
|
-
*/
|
|
1861
|
-
numberOfAds: number;
|
|
1862
|
-
}
|
|
1863
|
-
/**
|
|
1864
|
-
* Emitted when the download of an ad manifest is started.
|
|
1865
|
-
*/
|
|
1866
|
-
interface AdManifestLoadEvent extends Event {
|
|
1867
|
-
/**
|
|
1868
|
-
* The {@link AdBreak} this event is related to.
|
|
1869
|
-
*/
|
|
1870
|
-
adBreak?: AdBreak;
|
|
1871
|
-
/**
|
|
1872
|
-
* The {@link AdConfig} of the loaded ad manifest.
|
|
1873
|
-
*/
|
|
1874
|
-
adConfig?: AdConfig;
|
|
1875
|
-
}
|
|
1876
|
-
/**
|
|
1877
|
-
* Emitted when an ad manifest was successfully loaded.
|
|
1878
|
-
*/
|
|
1879
|
-
interface AdManifestLoadedEvent extends Event {
|
|
1880
|
-
/**
|
|
1881
|
-
* The {@link AdBreak} this event is related to.
|
|
1882
|
-
*/
|
|
1883
|
-
adBreak?: AdBreak;
|
|
1884
|
-
/**
|
|
1885
|
-
* The {@link AdConfig} of the loaded ad manifest.
|
|
1886
|
-
*/
|
|
1887
|
-
adConfig?: AdConfig;
|
|
1888
|
-
/**
|
|
1889
|
-
* How long it took for the ad tag to be downloaded in milliseconds.
|
|
1890
|
-
*/
|
|
1891
|
-
downloadTime: number;
|
|
1892
|
-
}
|
|
1893
|
-
/**
|
|
1894
|
-
* Emitted when current video download quality has changed.
|
|
1895
|
-
*/
|
|
1896
|
-
interface VideoDownloadQualityChangedEvent extends Event {
|
|
1897
|
-
/**
|
|
1898
|
-
* The new quality
|
|
1899
|
-
*/
|
|
1900
|
-
newVideoQuality: VideoQuality;
|
|
1901
|
-
/**
|
|
1902
|
-
* The previous quality
|
|
1903
|
-
*/
|
|
1904
|
-
oldVideoQuality: VideoQuality;
|
|
1905
|
-
}
|
|
1906
|
-
/**
|
|
1907
|
-
* Emitted when the current video playback quality has changed.
|
|
1908
|
-
*/
|
|
1909
|
-
interface VideoPlaybackQualityChangedEvent extends Event {
|
|
1910
|
-
/**
|
|
1911
|
-
* The new quality
|
|
1912
|
-
*/
|
|
1913
|
-
newVideoQuality: VideoQuality;
|
|
1914
|
-
/**
|
|
1915
|
-
* The previous quality
|
|
1916
|
-
*/
|
|
1917
|
-
oldVideoQuality: VideoQuality;
|
|
1918
|
-
}
|
|
1919
|
-
/**
|
|
1920
|
-
* Emitted when casting to a cast-compatible device is available.
|
|
1921
|
-
*/
|
|
1922
|
-
interface CastAvailableEvent extends Event {
|
|
1923
|
-
}
|
|
1924
|
-
/**
|
|
1925
|
-
* Emitted when the playback on a cast-compatible device was paused.
|
|
1926
|
-
*
|
|
1927
|
-
* On Android {@link PausedEvent} is also emitted while casting.
|
|
1928
|
-
*/
|
|
1929
|
-
interface CastPausedEvent extends Event {
|
|
1930
|
-
}
|
|
1931
|
-
/**
|
|
1932
|
-
* Emitted when the playback on a cast-compatible device has finished.
|
|
1933
|
-
*
|
|
1934
|
-
* On Android {@link PlaybackFinishedEvent} is also emitted while casting.
|
|
1935
|
-
*/
|
|
1936
|
-
interface CastPlaybackFinishedEvent extends Event {
|
|
1937
|
-
}
|
|
1938
|
-
/**
|
|
1939
|
-
* Emitted when playback on a cast-compatible device has started.
|
|
1940
|
-
*
|
|
1941
|
-
* On Android {@link PlayingEvent} is also emitted while casting.
|
|
1942
|
-
*/
|
|
1943
|
-
interface CastPlayingEvent extends Event {
|
|
1944
|
-
}
|
|
1945
|
-
/**
|
|
1946
|
-
* Emitted when the cast app is launched successfully.
|
|
1947
|
-
*/
|
|
1948
|
-
interface CastStartedEvent extends Event {
|
|
1949
|
-
/**
|
|
1950
|
-
* The name of the cast device on which the app was launched.
|
|
1951
|
-
*/
|
|
1952
|
-
deviceName: string | null;
|
|
1953
|
-
}
|
|
1954
|
-
/**
|
|
1955
|
-
* Emitted when casting is initiated, but the user still needs to choose which device should be used.
|
|
1956
|
-
*/
|
|
1957
|
-
interface CastStartEvent extends Event {
|
|
1958
|
-
}
|
|
1959
|
-
/**
|
|
1960
|
-
* Emitted when casting to a cast-compatible device is stopped.
|
|
1961
|
-
*/
|
|
1962
|
-
interface CastStoppedEvent extends Event {
|
|
1963
|
-
}
|
|
1964
|
-
/**
|
|
1965
|
-
* Emitted when the time update from the currently used cast-compatible device is received.
|
|
1966
|
-
*/
|
|
1967
|
-
interface CastTimeUpdatedEvent extends Event {
|
|
1968
|
-
}
|
|
1969
|
-
/**
|
|
1970
|
-
* Contains information for the {@link CastWaitingForDeviceEvent}.
|
|
1971
|
-
*/
|
|
1972
|
-
interface CastPayload {
|
|
1973
|
-
/**
|
|
1974
|
-
* The current time in seconds.
|
|
1975
|
-
*/
|
|
1976
|
-
currentTime: number;
|
|
1977
|
-
/**
|
|
1978
|
-
* The name of the chosen cast device.
|
|
1979
|
-
*/
|
|
1980
|
-
deviceName: string | null;
|
|
1981
|
-
/**
|
|
1982
|
-
* The type of the payload (always `"cast"`).
|
|
1983
|
-
*/
|
|
1984
|
-
type: string;
|
|
1985
|
-
}
|
|
1986
|
-
/**
|
|
1987
|
-
* Emitted when a cast-compatible device has been chosen and the player is waiting for the device to get ready for
|
|
1988
|
-
* playback.
|
|
1989
|
-
*/
|
|
1990
|
-
interface CastWaitingForDeviceEvent extends Event {
|
|
1991
|
-
/**
|
|
1992
|
-
* The {@link CastPayload} object for the event
|
|
1993
|
-
*/
|
|
1994
|
-
castPayload: CastPayload;
|
|
1995
|
-
}
|
|
1996
|
-
/**
|
|
1997
|
-
* Emitted when a download was finished.
|
|
1998
|
-
*/
|
|
1999
|
-
interface DownloadFinishedEvent extends Event {
|
|
2000
|
-
/**
|
|
2001
|
-
* The time needed to finish the request, in seconds.
|
|
2002
|
-
*/
|
|
2003
|
-
downloadTime: number;
|
|
2004
|
-
/**
|
|
2005
|
-
* Which type of request this was.
|
|
2006
|
-
*/
|
|
2007
|
-
requestType: HttpRequestType;
|
|
2008
|
-
/**
|
|
2009
|
-
* The HTTP status code of the request.
|
|
2010
|
-
* If opening the connection failed, a value of `0` is returned.
|
|
2011
|
-
*/
|
|
2012
|
-
httpStatus: number;
|
|
2013
|
-
/**
|
|
2014
|
-
* If the download was successful.
|
|
2015
|
-
*/
|
|
2016
|
-
isSuccess: boolean;
|
|
2017
|
-
/**
|
|
2018
|
-
* The last redirect location, or `null` if no redirect happened.
|
|
2019
|
-
*/
|
|
2020
|
-
lastRedirectLocation?: String;
|
|
2021
|
-
/**
|
|
2022
|
-
* The size of the downloaded data, in bytes.
|
|
2023
|
-
*/
|
|
2024
|
-
size: number;
|
|
2025
|
-
/**
|
|
2026
|
-
* The URL of the request.
|
|
2027
|
-
*/
|
|
2028
|
-
url: String;
|
|
2029
|
-
}
|
|
2030
|
-
/**
|
|
2031
|
-
* Emitted when the player transitions from one playback speed to another.
|
|
2032
|
-
* @platform iOS, tvOS
|
|
2033
|
-
*/
|
|
2034
|
-
interface PlaybackSpeedChangedEvent extends Event {
|
|
2035
|
-
/**
|
|
2036
|
-
* The playback speed before the change happened.
|
|
2037
|
-
*/
|
|
2038
|
-
from: number;
|
|
2039
|
-
/**
|
|
2040
|
-
* The playback speed after the change happened.
|
|
2041
|
-
*/
|
|
2042
|
-
to: number;
|
|
2043
|
-
}
|
|
2044
|
-
/**
|
|
2045
|
-
* Emitted when a subtitle entry transitions into the active status.
|
|
2046
|
-
*/
|
|
2047
|
-
interface CueEnterEvent extends Event {
|
|
2048
|
-
/**
|
|
2049
|
-
* The playback time in seconds when the subtitle should be rendered.
|
|
2050
|
-
*/
|
|
2051
|
-
start: number;
|
|
2052
|
-
/**
|
|
2053
|
-
* The playback time in seconds when the subtitle should be hidden.
|
|
2054
|
-
*/
|
|
2055
|
-
end: number;
|
|
2056
|
-
/**
|
|
2057
|
-
* The textual content of this subtitle.
|
|
2058
|
-
*/
|
|
2059
|
-
text?: string;
|
|
2060
|
-
/**
|
|
2061
|
-
* Data URI for image data of this subtitle.
|
|
2062
|
-
*/
|
|
2063
|
-
image?: string;
|
|
2064
|
-
}
|
|
2065
|
-
/**
|
|
2066
|
-
* Emitted when an active subtitle entry transitions into the inactive status.
|
|
2067
|
-
*/
|
|
2068
|
-
interface CueExitEvent extends Event {
|
|
2069
|
-
/**
|
|
2070
|
-
* The playback time in seconds when the subtitle should be rendered.
|
|
2071
|
-
*/
|
|
2072
|
-
start: number;
|
|
2073
|
-
/**
|
|
2074
|
-
* The playback time in seconds when the subtitle should be hidden.
|
|
2075
|
-
*/
|
|
2076
|
-
end: number;
|
|
2077
|
-
/**
|
|
2078
|
-
* The textual content of this subtitle.
|
|
2079
|
-
*/
|
|
2080
|
-
text?: string;
|
|
2081
|
-
/**
|
|
2082
|
-
* Data URI for image data of this subtitle.
|
|
2083
|
-
*/
|
|
2084
|
-
image?: string;
|
|
2085
|
-
}
|
|
2086
|
-
|
|
2087
|
-
/**
|
|
2088
|
-
* Type that defines all event props supported by `PlayerView` and `NativePlayerView`.
|
|
2089
|
-
* Used to generate the specific events interface for each component.
|
|
2090
|
-
*/
|
|
2091
|
-
interface EventProps {
|
|
2092
|
-
/**
|
|
2093
|
-
* Event emitted when an ad break has finished.
|
|
2094
|
-
*/
|
|
2095
|
-
onAdBreakFinished: AdBreakFinishedEvent;
|
|
2096
|
-
/**
|
|
2097
|
-
* Event emitted when an ad break has started.
|
|
2098
|
-
*/
|
|
2099
|
-
onAdBreakStarted: AdBreakStartedEvent;
|
|
2100
|
-
/**
|
|
2101
|
-
* Event emitted when an ad has been clicked.
|
|
2102
|
-
*/
|
|
2103
|
-
onAdClicked: AdClickedEvent;
|
|
2104
|
-
/**
|
|
2105
|
-
* Event emitted when an ad error has occurred.
|
|
2106
|
-
*/
|
|
2107
|
-
onAdError: AdErrorEvent;
|
|
2108
|
-
/**
|
|
2109
|
-
* Event emitted when an ad has finished.
|
|
2110
|
-
*/
|
|
2111
|
-
onAdFinished: AdFinishedEvent;
|
|
2112
|
-
/**
|
|
2113
|
-
* Event emitted when an ad manifest starts loading.
|
|
2114
|
-
*/
|
|
2115
|
-
onAdManifestLoad: AdManifestLoadEvent;
|
|
2116
|
-
/**
|
|
2117
|
-
* Event emitted when an ad manifest has been loaded.
|
|
2118
|
-
*/
|
|
2119
|
-
onAdManifestLoaded: AdManifestLoadedEvent;
|
|
2120
|
-
/**
|
|
2121
|
-
* Event emitted when an ad quartile has been reached.
|
|
2122
|
-
*/
|
|
2123
|
-
onAdQuartile: AdQuartileEvent;
|
|
2124
|
-
/**
|
|
2125
|
-
* Event emitted when an ad has been scheduled.
|
|
2126
|
-
*/
|
|
2127
|
-
onAdScheduled: AdScheduledEvent;
|
|
2128
|
-
/**
|
|
2129
|
-
* Event emitted when an ad has been skipped.
|
|
2130
|
-
*/
|
|
2131
|
-
onAdSkipped: AdSkippedEvent;
|
|
2132
|
-
/**
|
|
2133
|
-
* Event emitted when an ad has started.
|
|
2134
|
-
*/
|
|
2135
|
-
onAdStarted: AdStartedEvent;
|
|
2136
|
-
/**
|
|
2137
|
-
* Event emitted when casting to a cast-compatible device is available.
|
|
2138
|
-
*
|
|
2139
|
-
* @platform iOS, Android
|
|
2140
|
-
*/
|
|
2141
|
-
onCastAvailable: CastAvailableEvent;
|
|
2142
|
-
/**
|
|
2143
|
-
* Event emitted when the playback on a cast-compatible device was paused.
|
|
2144
|
-
*
|
|
2145
|
-
* @platform iOS, Android
|
|
2146
|
-
*/
|
|
2147
|
-
onCastPaused: CastPausedEvent;
|
|
2148
|
-
/**
|
|
2149
|
-
* Event emitted when the playback on a cast-compatible device has finished.
|
|
2150
|
-
*
|
|
2151
|
-
* @platform iOS, Android
|
|
2152
|
-
*/
|
|
2153
|
-
onCastPlaybackFinished: CastPlaybackFinishedEvent;
|
|
2154
|
-
/**
|
|
2155
|
-
* Event emitted when playback on a cast-compatible device has started.
|
|
2156
|
-
*
|
|
2157
|
-
* @platform iOS, Android
|
|
2158
|
-
*/
|
|
2159
|
-
onCastPlaying: CastPlayingEvent;
|
|
2160
|
-
/**
|
|
2161
|
-
* Event emitted when the cast app is launched successfully.
|
|
2162
|
-
*
|
|
2163
|
-
* @platform iOS, Android
|
|
2164
|
-
*/
|
|
2165
|
-
onCastStarted: CastStartedEvent;
|
|
2166
|
-
/**
|
|
2167
|
-
* Event emitted when casting is initiated, but the user still needs to choose which device should be used.
|
|
2168
|
-
*
|
|
2169
|
-
* @platform iOS, Android
|
|
2170
|
-
*/
|
|
2171
|
-
onCastStart: CastStartEvent;
|
|
2172
|
-
/**
|
|
2173
|
-
* Event emitted when casting to a cast-compatible device is stopped.
|
|
2174
|
-
*
|
|
2175
|
-
* @platform iOS, Android
|
|
2176
|
-
*/
|
|
2177
|
-
onCastStopped: CastStoppedEvent;
|
|
2178
|
-
/**
|
|
2179
|
-
* Event emitted when the time update from the currently used cast-compatible device is received.
|
|
2180
|
-
*
|
|
2181
|
-
* @platform iOS, Android
|
|
2182
|
-
*/
|
|
2183
|
-
onCastTimeUpdated: CastTimeUpdatedEvent;
|
|
2184
|
-
/**
|
|
2185
|
-
* Event emitted when a cast-compatible device has been chosen and the player is waiting for the device to get ready for
|
|
2186
|
-
* playback.
|
|
2187
|
-
*
|
|
2188
|
-
* @platform iOS, Android
|
|
2189
|
-
*/
|
|
2190
|
-
onCastWaitingForDevice: CastWaitingForDeviceEvent;
|
|
2191
|
-
/**
|
|
2192
|
-
* Event emitted when a subtitle entry transitions into the active status.
|
|
2193
|
-
*/
|
|
2194
|
-
onCueEnter: CueEnterEvent;
|
|
2195
|
-
/**
|
|
2196
|
-
* Event emitted when an active subtitle entry transitions into the inactive status.
|
|
2197
|
-
*/
|
|
2198
|
-
onCueExit: CueExitEvent;
|
|
2199
|
-
/**
|
|
2200
|
-
* Event emitted when the player is destroyed.
|
|
2201
|
-
*/
|
|
2202
|
-
onDestroy: DestroyEvent;
|
|
2203
|
-
/**
|
|
2204
|
-
* Emitted when a download was finished.
|
|
2205
|
-
*/
|
|
2206
|
-
onDownloadFinished: DownloadFinishedEvent;
|
|
2207
|
-
/**
|
|
2208
|
-
* All events emitted by the player.
|
|
2209
|
-
*/
|
|
2210
|
-
onEvent: Event;
|
|
2211
|
-
/**
|
|
2212
|
-
* Event emitted when fullscreen mode has been enabled.
|
|
2213
|
-
*
|
|
2214
|
-
* @platform iOS, Android
|
|
2215
|
-
*/
|
|
2216
|
-
onFullscreenEnabled: FullscreenEnabledEvent;
|
|
2217
|
-
/**
|
|
2218
|
-
* Event emitted when fullscreen mode has been disabled.
|
|
2219
|
-
*
|
|
2220
|
-
* @platform iOS, Android
|
|
2221
|
-
*/
|
|
2222
|
-
onFullscreenDisabled: FullscreenDisabledEvent;
|
|
2223
|
-
/**
|
|
2224
|
-
* Event emitted when fullscreen mode has been entered.
|
|
2225
|
-
*
|
|
2226
|
-
* @platform iOS, Android
|
|
2227
|
-
*/
|
|
2228
|
-
onFullscreenEnter: FullscreenEnterEvent;
|
|
2229
|
-
/**
|
|
2230
|
-
* Event emitted when fullscreen mode has been exited.
|
|
2231
|
-
*
|
|
2232
|
-
* @platform iOS, Android
|
|
2233
|
-
*/
|
|
2234
|
-
onFullscreenExit: FullscreenExitEvent;
|
|
2235
|
-
/**
|
|
2236
|
-
* Event emitted when the player has been muted.
|
|
2237
|
-
*/
|
|
2238
|
-
onMuted: MutedEvent;
|
|
2239
|
-
/**
|
|
2240
|
-
* Event emitted when the player has been paused.
|
|
2241
|
-
*/
|
|
2242
|
-
onPaused: PausedEvent;
|
|
2243
|
-
/**
|
|
2244
|
-
* Event mitted when the availability of the Picture in Picture mode changed.
|
|
2245
|
-
*/
|
|
2246
|
-
onPictureInPictureAvailabilityChanged: PictureInPictureAvailabilityChangedEvent;
|
|
2247
|
-
/**
|
|
2248
|
-
* Event emitted when the player enters Picture in Picture mode.
|
|
2249
|
-
*/
|
|
2250
|
-
onPictureInPictureEnter: PictureInPictureEnterEvent;
|
|
2251
|
-
/**
|
|
2252
|
-
* Event emitted when the player entered Picture in Picture mode.
|
|
2253
|
-
*
|
|
2254
|
-
* @platform iOS
|
|
2255
|
-
*/
|
|
2256
|
-
onPictureInPictureEntered: PictureInPictureEnteredEvent;
|
|
2257
|
-
/**
|
|
2258
|
-
* Event emitted when the player exits Picture in Picture mode.
|
|
2259
|
-
*/
|
|
2260
|
-
onPictureInPictureExit: PictureInPictureExitEvent;
|
|
2261
|
-
/**
|
|
2262
|
-
* Event emitted when the player exited Picture in Picture mode.
|
|
2263
|
-
*
|
|
2264
|
-
* @platform iOS
|
|
2265
|
-
*/
|
|
2266
|
-
onPictureInPictureExited: PictureInPictureExitedEvent;
|
|
2267
|
-
/**
|
|
2268
|
-
* Event emitted when the player received an intention to start/resume playback.
|
|
2269
|
-
*/
|
|
2270
|
-
onPlay: PlayEvent;
|
|
2271
|
-
/**
|
|
2272
|
-
* Event emitted when the playback of the current media has finished.
|
|
2273
|
-
*/
|
|
2274
|
-
onPlaybackFinished: PlaybackFinishedEvent;
|
|
2275
|
-
/**
|
|
2276
|
-
* Emitted when the player transitions from one playback speed to another.
|
|
2277
|
-
* @platform iOS, tvOS
|
|
2278
|
-
*/
|
|
2279
|
-
onPlaybackSpeedChanged: PlaybackSpeedChangedEvent;
|
|
2280
|
-
/**
|
|
2281
|
-
* Event emitted when a source is loaded into the player.
|
|
2282
|
-
* Seeking and time shifting are allowed as soon as this event is seen.
|
|
2283
|
-
*/
|
|
2284
|
-
onPlayerActive: PlayerActiveEvent;
|
|
2285
|
-
/**
|
|
2286
|
-
* Event Emitted when a player error occurred.
|
|
2287
|
-
*/
|
|
2288
|
-
onPlayerError: PlayerErrorEvent;
|
|
2289
|
-
/**
|
|
2290
|
-
* Event emitted when a player warning occurred.
|
|
2291
|
-
*/
|
|
2292
|
-
onPlayerWarning: PlayerWarningEvent;
|
|
2293
|
-
/**
|
|
2294
|
-
* Emitted when playback has started.
|
|
2295
|
-
*/
|
|
2296
|
-
onPlaying: PlayingEvent;
|
|
2297
|
-
/**
|
|
2298
|
-
* Emitted when the player is ready for immediate playback, because initial audio/video
|
|
2299
|
-
* has been downloaded.
|
|
2300
|
-
*/
|
|
2301
|
-
onReady: ReadyEvent;
|
|
2302
|
-
/**
|
|
2303
|
-
* Event emitted when the player is about to seek to a new position.
|
|
2304
|
-
* Only applies to VoD streams.
|
|
2305
|
-
*/
|
|
2306
|
-
onSeek: SeekEvent;
|
|
2307
|
-
/**
|
|
2308
|
-
* Event emitted when seeking has finished and data to continue playback is available.
|
|
2309
|
-
* Only applies to VoD streams.
|
|
2310
|
-
*/
|
|
2311
|
-
onSeeked: SeekedEvent;
|
|
2312
|
-
/**
|
|
2313
|
-
* Event mitted when the player starts time shifting.
|
|
2314
|
-
* Only applies to live streams.
|
|
2315
|
-
*/
|
|
2316
|
-
onTimeShift: TimeShiftEvent;
|
|
2317
|
-
/**
|
|
2318
|
-
* Event emitted when time shifting has finished and data is available to continue playback.
|
|
2319
|
-
* Only applies to live streams.
|
|
2320
|
-
*/
|
|
2321
|
-
onTimeShifted: TimeShiftedEvent;
|
|
2322
|
-
/**
|
|
2323
|
-
* Event emitted when the player begins to stall and to buffer due to an empty buffer.
|
|
2324
|
-
*/
|
|
2325
|
-
onStallStarted: StallStartedEvent;
|
|
2326
|
-
/**
|
|
2327
|
-
* Event emitted when the player ends stalling, due to enough data in the buffer.
|
|
2328
|
-
*/
|
|
2329
|
-
onStallEnded: StallEndedEvent;
|
|
2330
|
-
/**
|
|
2331
|
-
* Event emitted when a source error occurred.
|
|
2332
|
-
*/
|
|
2333
|
-
onSourceError: SourceErrorEvent;
|
|
2334
|
-
/**
|
|
2335
|
-
* Event emitted when a new source loading has started.
|
|
2336
|
-
*/
|
|
2337
|
-
onSourceLoad: SourceLoadEvent;
|
|
2338
|
-
/**
|
|
2339
|
-
* Event emitted when a new source is loaded.
|
|
2340
|
-
* This does not mean that the source is immediately ready for playback.
|
|
2341
|
-
* `ReadyEvent` indicates the player is ready for immediate playback.
|
|
2342
|
-
*/
|
|
2343
|
-
onSourceLoaded: SourceLoadedEvent;
|
|
2344
|
-
/**
|
|
2345
|
-
* Event emitted when the current source has been unloaded.
|
|
2346
|
-
*/
|
|
2347
|
-
onSourceUnloaded: SourceUnloadedEvent;
|
|
2348
|
-
/**
|
|
2349
|
-
* Event emitted when a source warning occurred.
|
|
2350
|
-
*/
|
|
2351
|
-
onSourceWarning: SourceWarningEvent;
|
|
2352
|
-
/**
|
|
2353
|
-
* Event emitted when a new audio track is added to the player.
|
|
2354
|
-
*/
|
|
2355
|
-
onAudioAdded: AudioAddedEvent;
|
|
2356
|
-
/**
|
|
2357
|
-
* Event emitted when the player's selected audio track has changed.
|
|
2358
|
-
*/
|
|
2359
|
-
onAudioChanged: AudioChangedEvent;
|
|
2360
|
-
/**
|
|
2361
|
-
* Event emitted when an audio track is removed from the player.
|
|
2362
|
-
*/
|
|
2363
|
-
onAudioRemoved: AudioRemovedEvent;
|
|
2364
|
-
/**
|
|
2365
|
-
* Event emitted when a new subtitle track is added to the player.
|
|
2366
|
-
*/
|
|
2367
|
-
onSubtitleAdded: SubtitleAddedEvent;
|
|
2368
|
-
/**
|
|
2369
|
-
* Event emitted when the player's selected subtitle track has changed.
|
|
2370
|
-
*/
|
|
2371
|
-
onSubtitleChanged: SubtitleChangedEvent;
|
|
2372
|
-
/**
|
|
2373
|
-
* Event emitted when a subtitle track is removed from the player.
|
|
2374
|
-
*/
|
|
2375
|
-
onSubtitleRemoved: SubtitleRemovedEvent;
|
|
2376
|
-
/**
|
|
2377
|
-
* Event emitted when the current playback time has changed.
|
|
2378
|
-
*/
|
|
2379
|
-
onTimeChanged: TimeChangedEvent;
|
|
2380
|
-
/**
|
|
2381
|
-
* Emitted when the player is unmuted.
|
|
2382
|
-
*/
|
|
2383
|
-
onUnmuted: UnmutedEvent;
|
|
2384
|
-
/**
|
|
2385
|
-
* Emitted when current video download quality has changed.
|
|
2386
|
-
*/
|
|
2387
|
-
onVideoDownloadQualityChanged: VideoDownloadQualityChangedEvent;
|
|
2388
|
-
/**
|
|
2389
|
-
* Emitted when the current video playback quality has changed.
|
|
2390
|
-
*/
|
|
2391
|
-
onVideoPlaybackQualityChanged: VideoPlaybackQualityChangedEvent;
|
|
2392
|
-
}
|
|
2393
|
-
/**
|
|
2394
|
-
* Event props for `PlayerView`.
|
|
2395
|
-
*
|
|
2396
|
-
* Note the events of `PlayerView` are simply a proxy over
|
|
2397
|
-
* the events from `NativePlayerView` just removing RN's bubbling data.
|
|
2398
|
-
*/
|
|
2399
|
-
type PlayerViewEvents = {
|
|
2400
|
-
[Prop in keyof EventProps]?: (event: EventProps[Prop]) => void;
|
|
2401
|
-
};
|
|
2402
|
-
|
|
2403
|
-
/**
|
|
2404
|
-
* Contains the state an OfflineContentManager can have.
|
|
2405
|
-
* @platform Android, iOS
|
|
2406
|
-
*/
|
|
2407
|
-
declare enum OfflineState {
|
|
2408
|
-
/**
|
|
2409
|
-
* The offline content is downloaded and ready for offline playback.
|
|
2410
|
-
*/
|
|
2411
|
-
Downloaded = "Downloaded",
|
|
2412
|
-
/**
|
|
2413
|
-
* The offline content is currently downloading.
|
|
2414
|
-
*/
|
|
2415
|
-
Downloading = "Downloading",
|
|
2416
|
-
/**
|
|
2417
|
-
* The download of the offline content is suspended, and is only partly downloaded yet.
|
|
2418
|
-
*/
|
|
2419
|
-
Suspended = "Suspended",
|
|
2420
|
-
/**
|
|
2421
|
-
* The offline content is not downloaded. However, some data may be still cached.
|
|
2422
|
-
*/
|
|
2423
|
-
NotDownloaded = "NotDownloaded"
|
|
2424
|
-
}
|
|
2425
|
-
|
|
2426
|
-
/**
|
|
2427
|
-
* Represents the configuration to start a download.
|
|
2428
|
-
* @platform Android, iOS
|
|
2429
|
-
*/
|
|
2430
|
-
interface OfflineDownloadRequest {
|
|
2431
|
-
/**
|
|
2432
|
-
* Minimum video bitrate to download. The nearest higher available bitrate will be selected.
|
|
2433
|
-
*/
|
|
2434
|
-
minimumBitrate?: number;
|
|
2435
|
-
/**
|
|
2436
|
-
* Audio tracks with IDs to download.
|
|
2437
|
-
*/
|
|
2438
|
-
audioOptionIds?: string[];
|
|
2439
|
-
/**
|
|
2440
|
-
* Text tracks with IDs to download.
|
|
2441
|
-
*/
|
|
2442
|
-
textOptionIds?: string[];
|
|
2443
|
-
}
|
|
2444
|
-
|
|
2445
|
-
/**
|
|
2446
|
-
* Object used to configure a new `OfflineContentManager` instance.
|
|
2447
|
-
* @platform Android, iOS
|
|
2448
|
-
*/
|
|
2449
|
-
interface OfflineContentConfig extends NativeInstanceConfig {
|
|
2450
|
-
/**
|
|
2451
|
-
* An identifier for this source that is unique within the location and must never change.
|
|
2452
|
-
* The root folder will contain a folder based on this id.
|
|
2453
|
-
*/
|
|
2454
|
-
identifier: string;
|
|
2455
|
-
/**
|
|
2456
|
-
* The `SourceConfig` used to download the offline resources.
|
|
2457
|
-
*/
|
|
2458
|
-
sourceConfig: SourceConfig;
|
|
2459
|
-
}
|
|
2460
|
-
|
|
2461
|
-
/**
|
|
2462
|
-
* Object used configure how the native offline managers create and get offline source configurations
|
|
2463
|
-
* @platform Android, iOS
|
|
2464
|
-
*/
|
|
2465
|
-
interface OfflineSourceOptions {
|
|
2466
|
-
/**
|
|
2467
|
-
* Whether or not the player should restrict playback only to audio, video and subtitle tracks which are stored offline on the device. This has to be set to true if the device has no network access.
|
|
2468
|
-
* @platform iOS
|
|
2469
|
-
*/
|
|
2470
|
-
restrictedToAssetCache?: boolean;
|
|
2471
|
-
}
|
|
2472
|
-
|
|
2473
|
-
/**
|
|
2474
|
-
* Superclass of entries which can be selected to download for offline playback
|
|
2475
|
-
* @platform Android, iOS
|
|
2476
|
-
*/
|
|
2477
|
-
interface OfflineContentOptionEntry {
|
|
2478
|
-
/**
|
|
2479
|
-
* The ID of the option.
|
|
2480
|
-
*/
|
|
2481
|
-
id: string;
|
|
2482
|
-
/**
|
|
2483
|
-
* The language of the option.
|
|
2484
|
-
*/
|
|
2485
|
-
language?: string;
|
|
2486
|
-
}
|
|
2487
|
-
/**
|
|
2488
|
-
* Represents the downloadable options provided via the `onOptionsAvailable` callback on `OfflineContentManagerListener`
|
|
2489
|
-
* @platform Android, iOS
|
|
2490
|
-
*/
|
|
2491
|
-
interface OfflineContentOptions {
|
|
2492
|
-
/**
|
|
2493
|
-
* Represents the audio options available for download
|
|
2494
|
-
*/
|
|
2495
|
-
audioOptions: OfflineContentOptionEntry[];
|
|
2496
|
-
/**
|
|
2497
|
-
* Represents the text options available for download
|
|
2498
|
-
*/
|
|
2499
|
-
textOptions: OfflineContentOptionEntry[];
|
|
2500
|
-
}
|
|
2501
|
-
|
|
2502
|
-
/**
|
|
2503
|
-
* Enum to hold the `eventType` on the `BitmovinNativeOfflineEventData`
|
|
2504
|
-
* @platform Android, iOS
|
|
2505
|
-
*/
|
|
2506
|
-
declare enum OfflineEventType {
|
|
2507
|
-
onCompleted = "onCompleted",
|
|
2508
|
-
onError = "onError",
|
|
2509
|
-
onProgress = "onProgress",
|
|
2510
|
-
onOptionsAvailable = "onOptionsAvailable",
|
|
2511
|
-
onDrmLicenseUpdated = "onDrmLicenseUpdated",
|
|
2512
|
-
onDrmLicenseExpired = "onDrmLicenseExpired",
|
|
2513
|
-
onSuspended = "onSuspended",
|
|
2514
|
-
onResumed = "onResumed",
|
|
2515
|
-
onCanceled = "onCanceled"
|
|
2516
|
-
}
|
|
2517
|
-
/**
|
|
2518
|
-
* The base interface for all offline events.
|
|
2519
|
-
* @platform Android, iOS
|
|
2520
|
-
*/
|
|
2521
|
-
interface OfflineEvent<T extends OfflineEventType> {
|
|
2522
|
-
/**
|
|
2523
|
-
* The native id associated with the `OfflineContentManager` emitting this event
|
|
2524
|
-
*/
|
|
2525
|
-
nativeId: string;
|
|
2526
|
-
/**
|
|
2527
|
-
* The supplied id representing the source associated with the `OfflineContentManager` emitting this event.
|
|
2528
|
-
*/
|
|
2529
|
-
identifier: string;
|
|
2530
|
-
/**
|
|
2531
|
-
* The `OfflineEventType` that correlates to which native `OfflineContentManagerListener` method was called.
|
|
2532
|
-
*/
|
|
2533
|
-
eventType: T;
|
|
2534
|
-
/**
|
|
2535
|
-
* The current offline download state
|
|
2536
|
-
*/
|
|
2537
|
-
state: OfflineState;
|
|
2538
|
-
}
|
|
2539
|
-
/**
|
|
2540
|
-
* Emitted when the download process has completed.
|
|
2541
|
-
* @platform Android, iOS
|
|
2542
|
-
*/
|
|
2543
|
-
interface OnCompletedEvent extends OfflineEvent<OfflineEventType.onCompleted> {
|
|
2544
|
-
/**
|
|
2545
|
-
* The options that are available to download
|
|
2546
|
-
*/
|
|
2547
|
-
options?: OfflineContentOptions;
|
|
2548
|
-
}
|
|
2549
|
-
/**
|
|
2550
|
-
* Emitted when an error has occurred.
|
|
2551
|
-
* @platform Android, iOS
|
|
2552
|
-
*/
|
|
2553
|
-
interface OnErrorEvent extends OfflineEvent<OfflineEventType.onError> {
|
|
2554
|
-
/**
|
|
2555
|
-
* The error code of the process error
|
|
2556
|
-
*/
|
|
2557
|
-
code?: number;
|
|
2558
|
-
/**
|
|
2559
|
-
* The error message of the process error
|
|
2560
|
-
*/
|
|
2561
|
-
message?: string;
|
|
2562
|
-
}
|
|
2563
|
-
/**
|
|
2564
|
-
* Emitted when there is a progress change for the process call.
|
|
2565
|
-
* @platform Android, iOS
|
|
2566
|
-
*/
|
|
2567
|
-
interface OnProgressEvent extends OfflineEvent<OfflineEventType.onProgress> {
|
|
2568
|
-
/**
|
|
2569
|
-
* The progress for the current process
|
|
2570
|
-
*/
|
|
2571
|
-
progress: number;
|
|
2572
|
-
}
|
|
2573
|
-
/**
|
|
2574
|
-
* Emitted when the `OfflineContentOptions` is available after a `OfflineContentManager.getOptions` call.
|
|
2575
|
-
* @platform Android, iOS
|
|
2576
|
-
*/
|
|
2577
|
-
interface OnOptionsAvailableEvent extends OfflineEvent<OfflineEventType.onOptionsAvailable> {
|
|
2578
|
-
/**
|
|
2579
|
-
* The options that are available to download
|
|
2580
|
-
*/
|
|
2581
|
-
options?: OfflineContentOptions;
|
|
2582
|
-
}
|
|
2583
|
-
/**
|
|
2584
|
-
* Emitted when the DRM license was updated.
|
|
2585
|
-
* @platform Android, iOS
|
|
2586
|
-
*/
|
|
2587
|
-
interface OnDrmLicenseUpdatedEvent extends OfflineEvent<OfflineEventType.onDrmLicenseUpdated> {
|
|
2588
|
-
}
|
|
2589
|
-
/**
|
|
2590
|
-
* Emitted when the DRM license has expired.
|
|
2591
|
-
* @platform iOS
|
|
2592
|
-
*/
|
|
2593
|
-
interface OnDrmLicenseExpiredEvent extends OfflineEvent<OfflineEventType.onDrmLicenseExpired> {
|
|
2594
|
-
}
|
|
2595
|
-
/**
|
|
2596
|
-
* Emitted when all active actions have been suspended.
|
|
2597
|
-
* @platform Android, iOS
|
|
2598
|
-
*/
|
|
2599
|
-
interface OnSuspendedEvent extends OfflineEvent<OfflineEventType.onSuspended> {
|
|
2600
|
-
}
|
|
2601
|
-
/**
|
|
2602
|
-
* Emitted when all actions have been resumed.
|
|
2603
|
-
* @platform Android, iOS
|
|
2604
|
-
*/
|
|
2605
|
-
interface OnResumedEvent extends OfflineEvent<OfflineEventType.onResumed> {
|
|
2606
|
-
}
|
|
2607
|
-
/**
|
|
2608
|
-
* Emitted when the download of the media content was canceled by the user and all partially downloaded content has been deleted from disk.
|
|
2609
|
-
* @platform Android, iOS
|
|
2610
|
-
*/
|
|
2611
|
-
interface OnCanceledEvent extends OfflineEvent<OfflineEventType.onCanceled> {
|
|
2612
|
-
}
|
|
2613
|
-
/**
|
|
2614
|
-
* The type aggregation for all possible native offline events received from the `DeviceEventEmitter`
|
|
2615
|
-
* @platform Android, iOS
|
|
2616
|
-
*/
|
|
2617
|
-
type BitmovinNativeOfflineEventData = OnCompletedEvent | OnOptionsAvailableEvent | OnProgressEvent | OnErrorEvent | OnDrmLicenseUpdatedEvent | OnDrmLicenseExpiredEvent | OnSuspendedEvent | OnResumedEvent | OnCanceledEvent;
|
|
2618
|
-
/**
|
|
2619
|
-
* The listener that can be passed to the `OfflineContentManager` to receive callbacks for different events.
|
|
2620
|
-
* @platform Android, iOS
|
|
2621
|
-
*/
|
|
2622
|
-
interface OfflineContentManagerListener {
|
|
2623
|
-
/**
|
|
2624
|
-
* Emitted when the download process has completed.
|
|
2625
|
-
*
|
|
2626
|
-
* @param e The `OnCompletedEvent` that was emitted
|
|
2627
|
-
*/
|
|
2628
|
-
onCompleted?: (e: OnCompletedEvent) => void;
|
|
2629
|
-
/**
|
|
2630
|
-
* Emitted when an error has occurred.
|
|
2631
|
-
*
|
|
2632
|
-
* @param e The `OnErrorEvent` that was emitted
|
|
2633
|
-
*/
|
|
2634
|
-
onError?: (e: OnErrorEvent) => void;
|
|
2635
|
-
/**
|
|
2636
|
-
* Emitted when there is a progress change for the process call.
|
|
2637
|
-
*
|
|
2638
|
-
* @param e The `OnProgressEvent` that was emitted
|
|
2639
|
-
*/
|
|
2640
|
-
onProgress?: (e: OnProgressEvent) => void;
|
|
2641
|
-
/**
|
|
2642
|
-
* Emitted when the `OfflineContentOptions` is available after a `OfflineContentManager.getOptions` call.
|
|
2643
|
-
*
|
|
2644
|
-
* @param e The `OnOptionsAvailableEvent` that was emitted
|
|
2645
|
-
*/
|
|
2646
|
-
onOptionsAvailable?: (e: OnOptionsAvailableEvent) => void;
|
|
2647
|
-
/**
|
|
2648
|
-
* Emitted when the DRM license was updated.
|
|
2649
|
-
*
|
|
2650
|
-
* @param e The `OnDrmLicenseUpdatedEvent` that was emitted
|
|
2651
|
-
*/
|
|
2652
|
-
onDrmLicenseUpdated?: (e: OnDrmLicenseUpdatedEvent) => void;
|
|
2653
|
-
/**
|
|
2654
|
-
* Emitted when the DRM license has expired.
|
|
2655
|
-
*
|
|
2656
|
-
* @param e The `OnDrmLicenseExpiredEvent` that was emitted
|
|
2657
|
-
*/
|
|
2658
|
-
onDrmLicenseExpired?: (e: OnDrmLicenseExpiredEvent) => void;
|
|
2659
|
-
/**
|
|
2660
|
-
* Emitted when all active actions have been suspended.
|
|
2661
|
-
*
|
|
2662
|
-
* @param e The `OnSuspendedEvent` that was emitted
|
|
2663
|
-
*/
|
|
2664
|
-
onSuspended?: (e: OnSuspendedEvent) => void;
|
|
2665
|
-
/**
|
|
2666
|
-
* Emitted when all actions have been resumed.
|
|
2667
|
-
*
|
|
2668
|
-
* @param e The `OnResumedEvent` that was emitted
|
|
2669
|
-
*/
|
|
2670
|
-
onResumed?: (e: OnResumedEvent) => void;
|
|
2671
|
-
/**
|
|
2672
|
-
* Emitted when the download of the media content was canceled by the user and all partially downloaded content has been deleted from disk.
|
|
2673
|
-
*
|
|
2674
|
-
* @param e The `OnCanceledEvent` that was emitted
|
|
2675
|
-
*/
|
|
2676
|
-
onCanceled?: (e: OnCanceledEvent) => void;
|
|
2677
|
-
}
|
|
2678
|
-
|
|
2679
|
-
/**
|
|
2680
|
-
* Provides the means to download and store sources locally that can be played back with a Player
|
|
2681
|
-
* without an active network connection. An OfflineContentManager instance can be created via
|
|
2682
|
-
* the constructor and will be idle until initialized.
|
|
2683
|
-
*
|
|
2684
|
-
* @platform Android, iOS
|
|
2685
|
-
*/
|
|
2686
|
-
declare class OfflineContentManager extends NativeInstance<OfflineContentConfig> {
|
|
2687
|
-
isInitialized: boolean;
|
|
2688
|
-
isDestroyed: boolean;
|
|
2689
|
-
private eventSubscription?;
|
|
2690
|
-
private listeners;
|
|
2691
|
-
private drm?;
|
|
2692
|
-
constructor(config: OfflineContentConfig);
|
|
2693
|
-
/**
|
|
2694
|
-
* Allocates the native `OfflineManager` instance and its resources natively.
|
|
2695
|
-
* Registers the `DeviceEventEmitter` listener to receive data from the native `OfflineContentManagerListener` callbacks
|
|
2696
|
-
*/
|
|
2697
|
-
initialize: () => Promise<void>;
|
|
2698
|
-
/**
|
|
2699
|
-
* Adds a listener to the receive data from the native `OfflineContentManagerListener` callbacks
|
|
2700
|
-
* Returns a function that removes this listener from the `OfflineContentManager` that registered it.
|
|
2701
|
-
*/
|
|
2702
|
-
addListener: (listener: OfflineContentManagerListener) => (() => void);
|
|
2703
|
-
/**
|
|
2704
|
-
* Destroys the native `OfflineManager` and releases all of its allocated resources.
|
|
2705
|
-
*/
|
|
2706
|
-
destroy: () => Promise<void>;
|
|
2707
|
-
/**
|
|
2708
|
-
* Gets the current state of the `OfflineContentManager`
|
|
2709
|
-
*/
|
|
2710
|
-
state: () => Promise<OfflineState>;
|
|
2711
|
-
/**
|
|
2712
|
-
* Loads the current `OfflineContentOptions`.
|
|
2713
|
-
* When the options are loaded the data will be passed to the `OfflineContentManagerListener.onOptionsAvailable`.
|
|
2714
|
-
*/
|
|
2715
|
-
getOptions: () => Promise<void>;
|
|
2716
|
-
/**
|
|
2717
|
-
* Enqueues downloads according to the `OfflineDownloadRequest`.
|
|
2718
|
-
* The promise will reject in the event of null or invalid request parameters.
|
|
2719
|
-
* The promise will reject when calling this method when download has already started or is completed.
|
|
2720
|
-
* The promise will resolve when the download has been queued. The download will is not finished when the promise resolves.
|
|
2721
|
-
*/
|
|
2722
|
-
download: (request: OfflineDownloadRequest) => Promise<void>;
|
|
2723
|
-
/**
|
|
2724
|
-
* Resumes all suspended actions.
|
|
2725
|
-
*/
|
|
2726
|
-
resume: () => Promise<void>;
|
|
2727
|
-
/**
|
|
2728
|
-
* Suspends all active actions.
|
|
2729
|
-
*/
|
|
2730
|
-
suspend: () => Promise<void>;
|
|
2731
|
-
/**
|
|
2732
|
-
* Cancels and deletes the active download.
|
|
2733
|
-
*/
|
|
2734
|
-
cancelDownload: () => Promise<void>;
|
|
2735
|
-
/**
|
|
2736
|
-
* Resolves how many bytes of storage are used by the offline content.
|
|
2737
|
-
*/
|
|
2738
|
-
usedStorage: () => Promise<number>;
|
|
2739
|
-
/**
|
|
2740
|
-
* Deletes everything related to the related content ID.
|
|
2741
|
-
*/
|
|
2742
|
-
deleteAll: () => Promise<void>;
|
|
2743
|
-
/**
|
|
2744
|
-
* Downloads the offline license.
|
|
2745
|
-
* When finished successfully, data will be passed to the `OfflineContentManagerListener.onDrmLicenseUpdated`.
|
|
2746
|
-
* Errors are transmitted to the `OfflineContentManagerListener.onError`.
|
|
2747
|
-
*/
|
|
2748
|
-
downloadLicense: () => Promise<void>;
|
|
2749
|
-
/**
|
|
2750
|
-
* Releases the currently held offline license.
|
|
2751
|
-
* When finished successfully data will be passed to the `OfflineContentManagerListener.onDrmLicenseUpdated`.
|
|
2752
|
-
* Errors are transmitted to the `OfflineContentManagerListener.onError`.
|
|
2753
|
-
*
|
|
2754
|
-
* @platform Android
|
|
2755
|
-
*/
|
|
2756
|
-
releaseLicense: () => Promise<void>;
|
|
2757
|
-
/**
|
|
2758
|
-
* Renews the already downloaded DRM license.
|
|
2759
|
-
* When finished successfully data will be passed to the `OfflineContentManagerListener.onDrmLicenseUpdated`.
|
|
2760
|
-
* Errors are transmitted to the `OfflineContentManagerListener.onError`.
|
|
2761
|
-
*/
|
|
2762
|
-
renewOfflineLicense: () => Promise<void>;
|
|
2763
|
-
}
|
|
2764
|
-
|
|
2765
|
-
/**
|
|
2766
|
-
* Contains config values which can be used to alter the visual presentation and behaviour of the player UI.
|
|
2767
|
-
*/
|
|
2768
|
-
interface StyleConfig {
|
|
2769
|
-
/**
|
|
2770
|
-
* Sets if the UI should be enabled or not. Default value is `true`.
|
|
2771
|
-
* @example
|
|
2772
|
-
* ```
|
|
2773
|
-
* const player = new Player({
|
|
2774
|
-
* styleConfig: {
|
|
2775
|
-
* isUiEnabled: false,
|
|
2776
|
-
* },
|
|
2777
|
-
* });
|
|
2778
|
-
* ```
|
|
2779
|
-
*/
|
|
2780
|
-
isUiEnabled?: boolean;
|
|
2781
|
-
/**
|
|
2782
|
-
* Sets which user interface type should be used.
|
|
2783
|
-
* Default value is `UserInterfaceType.bitmovin` on `iOS` and `UserInterfaceType.system` on `tvOS`.
|
|
2784
|
-
* This setting only applies if `StyleConfig.isUiEnabled` is set to true.
|
|
2785
|
-
* @example
|
|
2786
|
-
* ```
|
|
2787
|
-
* const player = new Player({
|
|
2788
|
-
* styleConfig: {
|
|
2789
|
-
* userInterfaceType: UserInterfaceType.System,
|
|
2790
|
-
* },
|
|
2791
|
-
* });
|
|
2792
|
-
* ```
|
|
2793
|
-
* @platform iOS, tvOS
|
|
2794
|
-
*/
|
|
2795
|
-
userInterfaceType?: UserInterfaceType;
|
|
2796
|
-
/**
|
|
2797
|
-
* Sets the CSS file that will be used for the UI. The default CSS file will be completely replaced by the CSS file set with this property.
|
|
2798
|
-
* @example
|
|
2799
|
-
* ```
|
|
2800
|
-
* const player = new Player({
|
|
2801
|
-
* styleConfig: {
|
|
2802
|
-
* playerUiCss: 'https://domain.tld/path/to/bitmovinplayer-ui.css',
|
|
2803
|
-
* },
|
|
2804
|
-
* });
|
|
2805
|
-
* ```
|
|
2806
|
-
* @platform iOS, Android
|
|
2807
|
-
*/
|
|
2808
|
-
playerUiCss?: string;
|
|
2809
|
-
/**
|
|
2810
|
-
* Sets a CSS file which contains supplemental styles for the player UI. These styles will be added to the default CSS file or the CSS file set with `StyleConfig.playerUiCss`.
|
|
2811
|
-
* @example
|
|
2812
|
-
* ```
|
|
2813
|
-
* const player = new Player({
|
|
2814
|
-
* styleConfig: {
|
|
2815
|
-
* supplementalPlayerUiCss: 'https://domain.tld/path/to/bitmovinplayer-supplemental-ui.css',
|
|
2816
|
-
* },
|
|
2817
|
-
* });
|
|
2818
|
-
* ```
|
|
2819
|
-
* @platform iOS, Android
|
|
2820
|
-
*/
|
|
2821
|
-
supplementalPlayerUiCss?: string;
|
|
2822
|
-
/**
|
|
2823
|
-
* Sets the JS file that will be used for the UI. The default JS file will be completely replaced by the JS file set with this property.
|
|
2824
|
-
* @example
|
|
2825
|
-
* ```
|
|
2826
|
-
* const player = new Player({
|
|
2827
|
-
* styleConfig: {
|
|
2828
|
-
* playerUiJs: 'https://domain.tld/path/to/bitmovinplayer-ui.js',
|
|
2829
|
-
* },
|
|
2830
|
-
* });
|
|
2831
|
-
* ```
|
|
2832
|
-
* @platform iOS, Android
|
|
2833
|
-
*/
|
|
2834
|
-
playerUiJs?: string;
|
|
2835
|
-
/**
|
|
2836
|
-
* Determines how the video content is scaled or stretched within the parent container’s bounds. Possible values are defined in `ScalingMode`.
|
|
2837
|
-
* Default value is `ScalingMode.fit`.
|
|
2838
|
-
* @example
|
|
2839
|
-
* ```
|
|
2840
|
-
* const player = new Player({
|
|
2841
|
-
* styleConfig: {
|
|
2842
|
-
* scalingMode: ScalingMode.Zoom,
|
|
2843
|
-
* },
|
|
2844
|
-
* });
|
|
2845
|
-
* ```
|
|
2846
|
-
*/
|
|
2847
|
-
scalingMode?: ScalingMode;
|
|
2848
|
-
}
|
|
2849
|
-
/**
|
|
2850
|
-
* Specifies how the video content is scaled or stretched.
|
|
2851
|
-
*/
|
|
2852
|
-
declare enum ScalingMode {
|
|
2853
|
-
/**
|
|
2854
|
-
* Specifies that the player should preserve the video’s aspect ratio and fit the video within the container's bounds.
|
|
2855
|
-
*/
|
|
2856
|
-
Fit = "Fit",
|
|
2857
|
-
/**
|
|
2858
|
-
* Specifies that the video should be stretched to fill the container’s bounds. The aspect ratio may not be preserved.
|
|
2859
|
-
*/
|
|
2860
|
-
Stretch = "Stretch",
|
|
2861
|
-
/**
|
|
2862
|
-
* Specifies that the player should preserve the video’s aspect ratio and fill the container’s bounds.
|
|
2863
|
-
*/
|
|
2864
|
-
Zoom = "Zoom"
|
|
2865
|
-
}
|
|
2866
|
-
/**
|
|
2867
|
-
* Indicates which type of UI should be used.
|
|
2868
|
-
*/
|
|
2869
|
-
declare enum UserInterfaceType {
|
|
2870
|
-
/**
|
|
2871
|
-
* Indicates that Bitmovin's customizable UI should be used.
|
|
2872
|
-
*/
|
|
2873
|
-
Bitmovin = "Bitmovin",
|
|
2874
|
-
/**
|
|
2875
|
-
* Indicates that the system UI should be used.
|
|
2876
|
-
* @platform iOS, tvOS
|
|
2877
|
-
*/
|
|
2878
|
-
System = "System",
|
|
2879
|
-
/**
|
|
2880
|
-
* Indicates that only subtitles should be displayed along with the video content.
|
|
2881
|
-
*/
|
|
2882
|
-
Subtitle = "Subtitle"
|
|
2883
|
-
}
|
|
2884
|
-
|
|
2885
|
-
/**
|
|
2886
|
-
* When switching the video quality, the video decoder's configuration might change
|
|
2887
|
-
* as the player can't always know if the codec supports such configuration change, it destroys and recreates it.
|
|
2888
|
-
* This behaviour can cause brief black screens when switching between video qualities as codec recreation can be slow.
|
|
2889
|
-
*
|
|
2890
|
-
* If a codec is know to support a given configuration change without issues,
|
|
2891
|
-
* the configuration can be added to the `TweaksConfig.forceReuseVideoCodecReasons`
|
|
2892
|
-
* to always reuse the video codec and avoid the black screen.
|
|
2893
|
-
*/
|
|
2894
|
-
declare enum ForceReuseVideoCodecReason {
|
|
2895
|
-
/**
|
|
2896
|
-
* The new video quality color information is not compatible.
|
|
2897
|
-
*/
|
|
2898
|
-
ColorInfoMismatch = "ColorInfoMismatch",
|
|
2899
|
-
/**
|
|
2900
|
-
* The new video quality exceed the decoder's configured maximum sample size.
|
|
2901
|
-
*/
|
|
2902
|
-
MaxInputSizeExceeded = "MaxInputSizeExceeded",
|
|
2903
|
-
/**
|
|
2904
|
-
* The new video quality exceed the decoder's configured maximum resolution.
|
|
2905
|
-
*/
|
|
2906
|
-
MaxResolutionExceeded = "MaxResolutionExceeded"
|
|
2907
|
-
}
|
|
2908
|
-
/**
|
|
2909
|
-
* This configuration is used as an incubator for experimental features. Tweaks are not officially
|
|
2910
|
-
* supported and are not guaranteed to be stable, i.e. their naming, functionality and API can
|
|
2911
|
-
* change at any time within the tweaks or when being promoted to an official feature and moved
|
|
2912
|
-
* into its final configuration namespace.
|
|
2913
|
-
*/
|
|
2914
|
-
interface TweaksConfig {
|
|
2915
|
-
/**
|
|
2916
|
-
* The frequency in seconds `onTimeChanged` is called with `TimeChangedEvent`s.
|
|
2917
|
-
*
|
|
2918
|
-
* Default value in iOS is `1.0`.
|
|
2919
|
-
* Default value in Android is `0.2`.
|
|
2920
|
-
*
|
|
2921
|
-
* @platform iOS, Android
|
|
2922
|
-
*/
|
|
2923
|
-
timeChangedInterval?: number;
|
|
2924
|
-
/**
|
|
2925
|
-
* If enabled, HLS playlists will be parsed and additional features and events are enabled. This includes:
|
|
2926
|
-
*
|
|
2927
|
-
* - MetadataEvents carrying segment-specific metadata for custom HLS tags, like `#EXT-X-SCTE35`
|
|
2928
|
-
* - MetadataParsedEvents carrying segment-specific metadata for custom HLS tags, like `#EXT-X-SCTE35`
|
|
2929
|
-
* - DrmDataParsedEvents when a `#EXT-X-KEY` is found
|
|
2930
|
-
* - `Player.availableVideoQualities` includes additional information
|
|
2931
|
-
* - Automatic retries when HLS playlist requests failed with non-2xx HTTP status code
|
|
2932
|
-
*
|
|
2933
|
-
* Default is false.
|
|
2934
|
-
*
|
|
2935
|
-
* @platform iOS
|
|
2936
|
-
*/
|
|
2937
|
-
isNativeHlsParsingEnabled?: boolean;
|
|
2938
|
-
/**
|
|
2939
|
-
* If enabled, playlists will be downloaded by the Bitmovin Player SDK instead of AVFoundation.
|
|
2940
|
-
* This enables additional features and events, like:
|
|
2941
|
-
*
|
|
2942
|
-
* - DownloadFinishedEvents for playlist downloads.
|
|
2943
|
-
* - SourceWarningEvents when no `#EXT-X-PLAYLIST-TYPE` is found If set to false, enabling
|
|
2944
|
-
* nativeHlsParsingEnabled won’t have any effect.
|
|
2945
|
-
*
|
|
2946
|
-
* Default is true.
|
|
2947
|
-
*
|
|
2948
|
-
* @platform iOS
|
|
2949
|
-
*/
|
|
2950
|
-
isCustomHlsLoadingEnabled?: boolean;
|
|
2951
|
-
/**
|
|
2952
|
-
* The threshold which will be applied when seeking to the end in seconds. This value will be used
|
|
2953
|
-
* to calculate the maximum seekable time when calling `player.seek(time:)` or `player.playlist.seek(source:time:)`,
|
|
2954
|
-
* so the maximum value will be duration - seekToEndThreshold.
|
|
2955
|
-
*
|
|
2956
|
-
* This is useful if the duration of the segments does not match the duration specified in the
|
|
2957
|
-
* manifest. In this case, if we try to seek to the end, AVPlayer could get stuck and might stall
|
|
2958
|
-
* forever Therefore increasing this value could help.
|
|
2959
|
-
*
|
|
2960
|
-
* Default is 0.5.
|
|
2961
|
-
*
|
|
2962
|
-
* @platform iOS
|
|
2963
|
-
*/
|
|
2964
|
-
seekToEndThreshold?: number;
|
|
2965
|
-
/**
|
|
2966
|
-
* Specifies the player behaviour when `Player.play` is called. Default is 'relaxed'.
|
|
2967
|
-
*
|
|
2968
|
-
* - '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.
|
|
2969
|
-
* - '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.
|
|
2970
|
-
*
|
|
2971
|
-
* @platform iOS
|
|
2972
|
-
*/
|
|
2973
|
-
playbackStartBehaviour?: 'relaxed' | 'aggressive';
|
|
2974
|
-
/**
|
|
2975
|
-
* Specifies the player behaviour when stalling should be exited. Default is 'relaxed'.
|
|
2976
|
-
*
|
|
2977
|
-
* - '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.
|
|
2978
|
-
* - 'aggressive': The player will try to unstall as soon as some media data became available and will start playback of this media immediately.
|
|
2979
|
-
*
|
|
2980
|
-
* @platform iOS
|
|
2981
|
-
*/
|
|
2982
|
-
unstallingBehaviour?: 'relaxed' | 'aggressive';
|
|
2983
|
-
/**
|
|
2984
|
-
* 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.
|
|
2985
|
-
* Default is 2000.
|
|
2986
|
-
*
|
|
2987
|
-
* @platform Android
|
|
2988
|
-
*/
|
|
2989
|
-
bandwidthEstimateWeightLimit?: number;
|
|
2990
|
-
/**
|
|
2991
|
-
* 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.
|
|
2992
|
-
*
|
|
2993
|
-
* @platform Android
|
|
2994
|
-
*/
|
|
2995
|
-
devicesThatRequireSurfaceWorkaround?: {
|
|
2996
|
-
/**
|
|
2997
|
-
* A device name as reported by Build.DEVICE.
|
|
2998
|
-
*
|
|
2999
|
-
* @see Build.DEVICE: https://developer.android.com/reference/kotlin/android/os/Build.html#DEVICE--
|
|
3000
|
-
*/
|
|
3001
|
-
deviceNames?: string[];
|
|
3002
|
-
/**
|
|
3003
|
-
* A model name as reported by Build.MODEL.
|
|
3004
|
-
*
|
|
3005
|
-
* @see Build.MODEL: https://developer.android.com/reference/kotlin/android/os/Build.html#MODEL--
|
|
3006
|
-
*/
|
|
3007
|
-
modelNames?: string[];
|
|
3008
|
-
};
|
|
3009
|
-
/**
|
|
3010
|
-
* Specifies if the language property on DASH Representations, HLS Renditions and SmoothStreaming QualityLevels is normalized.
|
|
3011
|
-
* If enabled, language properties are normalized to IETF BCP 47 language tags. Default is true.
|
|
3012
|
-
*
|
|
3013
|
-
* Examples:
|
|
3014
|
-
* - "ENG" is normalized to "en"
|
|
3015
|
-
* - "en_us" is normalized to "en-us"
|
|
3016
|
-
* - "en-US-x-lvariant-POSIX" is normalized to "en-us-posix"
|
|
3017
|
-
*
|
|
3018
|
-
* @platform Android
|
|
3019
|
-
*/
|
|
3020
|
-
languagePropertyNormalization?: boolean;
|
|
3021
|
-
/**
|
|
3022
|
-
* The interval in which dynamic DASH windows are updated locally. I.e. The rate by which the
|
|
3023
|
-
* playback window is moved forward on the timeline.
|
|
3024
|
-
*
|
|
3025
|
-
* @platform Android
|
|
3026
|
-
*/
|
|
3027
|
-
localDynamicDashWindowUpdateInterval?: number;
|
|
3028
|
-
/**
|
|
3029
|
-
* Specifies whether a DRM session should be used for clear tracks of type video and audio. Using
|
|
3030
|
-
* DRM sessions for clear content avoids the recreation of decoders when transitioning between clear
|
|
3031
|
-
* and encrypted sections of content. Default is false.
|
|
3032
|
-
*
|
|
3033
|
-
* @platform Android
|
|
3034
|
-
*/
|
|
3035
|
-
useDrmSessionForClearPeriods?: boolean;
|
|
3036
|
-
/**
|
|
3037
|
-
* Specifies whether a DRM session should be used for clear tracks of type video and audio in a clear
|
|
3038
|
-
* source that follows after a DRM protected source. In addition, a DRM session will be used for clear
|
|
3039
|
-
* periods in a DRM protected source. Using DRM sessions for clear content avoids the recreation of
|
|
3040
|
-
* decoders when transitioning between clear and encrypted sections of content. Default is false.
|
|
3041
|
-
*
|
|
3042
|
-
* @platform Android
|
|
3043
|
-
*/
|
|
3044
|
-
useDrmSessionForClearSources?: boolean;
|
|
3045
|
-
/**
|
|
3046
|
-
* Specifies if the player should always fall back to an extractor matching the file type, if no
|
|
3047
|
-
* matching extractor was found. If the fallback is applied, this will ignore potential incompatibilities
|
|
3048
|
-
* with streams and thus can result in unstable or failing playback.
|
|
3049
|
-
*
|
|
3050
|
-
* @platform Android
|
|
3051
|
-
*/
|
|
3052
|
-
useFiletypeExtractorFallbackForHls?: boolean;
|
|
3053
|
-
/**
|
|
3054
|
-
* Determines whether `AVKit` should update Now Playing information automatically when using System UI.
|
|
3055
|
-
*
|
|
3056
|
-
* - If set to `false`, the automatic updates of Now Playing Info sent by `AVKit` are disabled.
|
|
3057
|
-
* This prevents interference with manual updates you may want to perform.
|
|
3058
|
-
* - If set to `true`, the default behaviour is maintained, allowing `AVKit` to handle Now Playing updates.
|
|
3059
|
-
*
|
|
3060
|
-
* Default is `true`.
|
|
3061
|
-
*
|
|
3062
|
-
* @deprecated To enable the Now Playing information use {@link MediaControlConfig.isEnabled}
|
|
3063
|
-
* @platform iOS
|
|
3064
|
-
*/
|
|
3065
|
-
updatesNowPlayingInfoCenter?: boolean;
|
|
3066
|
-
/**
|
|
3067
|
-
* When switching between video formats (eg: adapting between video qualities)
|
|
3068
|
-
* the codec might be recreated due to several reasons.
|
|
3069
|
-
* This behaviour can cause brief black screens when switching between video qualities as codec recreation can be
|
|
3070
|
-
* slow.
|
|
3071
|
-
*
|
|
3072
|
-
* If a device is know to support video format changes and keep the current decoder without issues,
|
|
3073
|
-
* this set can be filled with multiple `ForceReuseVideoCodecReason` and avoid the black screen.
|
|
3074
|
-
*
|
|
3075
|
-
* Default is `null` i.e not set
|
|
3076
|
-
*
|
|
3077
|
-
* @platform Android
|
|
3078
|
-
*/
|
|
3079
|
-
forceReuseVideoCodecReasons?: Array<ForceReuseVideoCodecReason>;
|
|
3080
|
-
}
|
|
3081
|
-
|
|
3082
|
-
/**
|
|
3083
|
-
* Configures remote playback behavior.
|
|
3084
|
-
*/
|
|
3085
|
-
interface RemoteControlConfig {
|
|
3086
|
-
/**
|
|
3087
|
-
* A URL to a CSS file the receiver app loads to style the receiver app.
|
|
3088
|
-
* Default value is `null`, indicating that the default CSS of the receiver app will be used.
|
|
3089
|
-
*/
|
|
3090
|
-
receiverStylesheetUrl?: string | null;
|
|
3091
|
-
/**
|
|
3092
|
-
* A Map containing custom configuration values that are sent to the remote control receiver.
|
|
3093
|
-
* Default value is an empty map.
|
|
3094
|
-
*/
|
|
3095
|
-
customReceiverConfig?: Record<string, string>;
|
|
3096
|
-
/**
|
|
3097
|
-
* Whether casting is enabled.
|
|
3098
|
-
* Default value is `true`.
|
|
3099
|
-
*
|
|
3100
|
-
* Has no effect if the `BitmovinCastManager` is not initialized before the `Player` is created with this configuration.
|
|
3101
|
-
*/
|
|
3102
|
-
isCastEnabled?: boolean;
|
|
3103
|
-
/**
|
|
3104
|
-
* Indicates whether cookies and credentials will be sent along manifest requests on the cast receiver
|
|
3105
|
-
* Default value is `false`.
|
|
3106
|
-
*/
|
|
3107
|
-
sendManifestRequestsWithCredentials?: boolean;
|
|
3108
|
-
/**
|
|
3109
|
-
* Indicates whether cookies and credentials will be sent along segment requests on the cast receiver
|
|
3110
|
-
* Default value is `false`.
|
|
3111
|
-
*/
|
|
3112
|
-
sendSegmentRequestsWithCredentials?: boolean;
|
|
3113
|
-
/**
|
|
3114
|
-
* Indicates whether cookies and credentials will be sent along DRM licence requests on the cast receiver
|
|
3115
|
-
* Default value is `false`.
|
|
3116
|
-
*/
|
|
3117
|
-
sendDrmLicenseRequestsWithCredentials?: boolean;
|
|
3118
|
-
}
|
|
3119
|
-
|
|
3120
|
-
/**
|
|
3121
|
-
* Configures buffer target levels for different MediaTypes.
|
|
3122
|
-
*/
|
|
3123
|
-
interface BufferMediaTypeConfig {
|
|
3124
|
-
/**
|
|
3125
|
-
* The amount of data in seconds the player tries to buffer in advance.
|
|
3126
|
-
*
|
|
3127
|
-
* iOS and tvOS, only: If set to `0`, the player will choose an appropriate forward buffer duration suitable
|
|
3128
|
-
* for most use-cases.
|
|
3129
|
-
*
|
|
3130
|
-
* Default value is `0` on iOS and tvOS, `50` on Android
|
|
3131
|
-
*/
|
|
3132
|
-
forwardDuration?: number;
|
|
3133
|
-
}
|
|
3134
|
-
/**
|
|
3135
|
-
* Player buffer config object to configure buffering behavior.
|
|
3136
|
-
*/
|
|
3137
|
-
interface BufferConfig {
|
|
3138
|
-
/**
|
|
3139
|
-
* Configures various settings for the audio and video buffer.
|
|
3140
|
-
*/
|
|
3141
|
-
audioAndVideo?: BufferMediaTypeConfig;
|
|
3142
|
-
/**
|
|
3143
|
-
* Amount of seconds the player buffers before playback starts again after a stall. This value is
|
|
3144
|
-
* restricted to the maximum value of the buffer minus 0.5 seconds.
|
|
3145
|
-
*
|
|
3146
|
-
* Default is `5` seconds.
|
|
3147
|
-
*
|
|
3148
|
-
* @platform Android
|
|
3149
|
-
*/
|
|
3150
|
-
restartThreshold?: number;
|
|
3151
|
-
/**
|
|
3152
|
-
* Amount of seconds the player buffers before playback starts. This value is restricted to the
|
|
3153
|
-
* maximum value of the buffer minus 0.5 seconds.
|
|
3154
|
-
*
|
|
3155
|
-
* Default is `2.5` seconds.
|
|
3156
|
-
*
|
|
3157
|
-
* @platform Android
|
|
3158
|
-
*/
|
|
3159
|
-
startupThreshold?: number;
|
|
3160
|
-
}
|
|
3161
|
-
|
|
3162
|
-
/**
|
|
3163
|
-
* Configures the playback behaviour of the player.
|
|
3164
|
-
*
|
|
3165
|
-
* @platform Android
|
|
3166
|
-
*/
|
|
3167
|
-
interface DecoderConfig extends NativeInstanceConfig {
|
|
3168
|
-
/**
|
|
3169
|
-
* A callback interface for sorting and filtering decoders based on priority.
|
|
3170
|
-
*
|
|
3171
|
-
* This callback is invoked when the player selects a decoder, providing the {@link DecoderContext}
|
|
3172
|
-
* and a list of available {@link MediaCodecInfo} objects. The list is initially ordered by
|
|
3173
|
-
* the default priority in which decoders will be attempted.
|
|
3174
|
-
*
|
|
3175
|
-
* The callback should return a reordered or filtered list of {@link MediaCodecInfo} objects
|
|
3176
|
-
* that determines the selection priority.
|
|
3177
|
-
*
|
|
3178
|
-
* ## Example Usage
|
|
3179
|
-
*
|
|
3180
|
-
* ### Prefer a specific decoder for main content video playback
|
|
3181
|
-
* The following example prioritizes a specific decoder for non-ad video playback:
|
|
3182
|
-
* ```ts
|
|
3183
|
-
* const decoderPriorityProvider: DecoderPriorityProvider = {
|
|
3184
|
-
* overrideDecodersPriority: (context: DecoderContext, preferredDecoders: MediaCodecInfo[]): MediaCodecInfo[] => {
|
|
3185
|
-
* if (!context.isAd && context.mediaType === DecoderContextMediaType.VIDEO) {
|
|
3186
|
-
* // Prioritize a specific decoder
|
|
3187
|
-
* return preferredDecoders.sort((a, b) => {
|
|
3188
|
-
* const aAsNumber = a.name.startsWith("OMX.google.") ? 1 : 2
|
|
3189
|
-
* const bAsNumber = b.name.startsWith("OMX.google.") ? 1 : 2
|
|
3190
|
-
* return aAsNumber - bAsNumber
|
|
3191
|
-
* })
|
|
3192
|
-
* }
|
|
3193
|
-
* return preferredDecoders
|
|
3194
|
-
* }
|
|
3195
|
-
* }
|
|
3196
|
-
* ```
|
|
3197
|
-
*
|
|
3198
|
-
* ### Prefer software decoders for ads playback
|
|
3199
|
-
* The following example prioritizes software decoders over hardware decoders for ad playback:
|
|
3200
|
-
* ```ts
|
|
3201
|
-
* const decoderPriorityProvider: DecoderPriorityProvider = {
|
|
3202
|
-
* overrideDecodersPriority: (context: DecoderContext, preferredDecoders: MediaCodecInfo[]): MediaCodecInfo[] => {
|
|
3203
|
-
* if (context.isAd) {
|
|
3204
|
-
* // Prioritize a specific decoder
|
|
3205
|
-
* return preferredDecoders.sort((a, b) => {
|
|
3206
|
-
* const aAsNumber = a.isSoftware ? 1 : 2
|
|
3207
|
-
* const bAsNumber = b.isSoftware ? 1 : 2
|
|
3208
|
-
* return aAsNumber - bAsNumber
|
|
3209
|
-
* })
|
|
3210
|
-
* }
|
|
3211
|
-
* return preferredDecoders
|
|
3212
|
-
* }
|
|
3213
|
-
* }
|
|
3214
|
-
* ```
|
|
3215
|
-
*
|
|
3216
|
-
* ### Disable software fallback for video playback
|
|
3217
|
-
* The following example disables software decoders for non-ad video playback:
|
|
3218
|
-
* ```ts
|
|
3219
|
-
* const decoderPriorityProvider: DecoderPriorityProvider = {
|
|
3220
|
-
* overrideDecodersPriority: (context: DecoderContext, preferredDecoders: MediaCodecInfo[]): MediaCodecInfo[] => {
|
|
3221
|
-
* if (!context.isAd && context.mediaType === DecoderContextMediaType.VIDEO) {
|
|
3222
|
-
* // Prioritize a specific decoder
|
|
3223
|
-
* return preferredDecoders.filter((info) => {
|
|
3224
|
-
* return !info.isSoftware
|
|
3225
|
-
* })
|
|
3226
|
-
* }
|
|
3227
|
-
* return preferredDecoders
|
|
3228
|
-
* }
|
|
3229
|
-
* }
|
|
3230
|
-
* ```
|
|
3231
|
-
*/
|
|
3232
|
-
decoderPriorityProvider?: DecoderPriorityProvider | null;
|
|
3233
|
-
}
|
|
3234
|
-
/**
|
|
3235
|
-
* Can be set on the `DecoderConfig.decoderPriorityProvider` to override the default decoder selection logic.
|
|
3236
|
-
* See {@link DecoderConfig#decoderPriorityProvider} for more details
|
|
3237
|
-
*
|
|
3238
|
-
* @platform Android
|
|
3239
|
-
* */
|
|
3240
|
-
interface DecoderPriorityProvider {
|
|
3241
|
-
overrideDecodersPriority: (context: DecoderContext, preferredDecoders: MediaCodecInfo[]) => MediaCodecInfo[];
|
|
3242
|
-
}
|
|
3243
|
-
/** The context in which a new decoder is chosen. */
|
|
3244
|
-
interface DecoderContext {
|
|
3245
|
-
mediaType: DecoderContextMediaType;
|
|
3246
|
-
isAd: boolean;
|
|
3247
|
-
}
|
|
3248
|
-
interface MediaCodecInfo {
|
|
3249
|
-
name: String;
|
|
3250
|
-
isSoftware: boolean;
|
|
3251
|
-
}
|
|
3252
|
-
declare enum DecoderContextMediaType {
|
|
3253
|
-
AUDIO = "Audio",
|
|
3254
|
-
VIDEO = "Video"
|
|
3255
|
-
}
|
|
3256
|
-
|
|
3257
|
-
/**
|
|
3258
|
-
* Configures the playback behaviour of the player.
|
|
3259
|
-
*/
|
|
3260
|
-
interface PlaybackConfig {
|
|
3261
|
-
/**
|
|
3262
|
-
* Whether the player starts playing automatically after loading a source or not. Default is `false`.
|
|
3263
|
-
* @example
|
|
3264
|
-
* ```
|
|
3265
|
-
* const player = new Player({
|
|
3266
|
-
* playbackConfig: {
|
|
3267
|
-
* isAutoplayEnabled: true,
|
|
3268
|
-
* },
|
|
3269
|
-
* });
|
|
3270
|
-
* ```
|
|
3271
|
-
*/
|
|
3272
|
-
isAutoplayEnabled?: boolean;
|
|
3273
|
-
/**
|
|
3274
|
-
* Whether the sound is muted on startup or not. Default value is `false`.
|
|
3275
|
-
* @example
|
|
3276
|
-
* ```
|
|
3277
|
-
* const player = new Player({
|
|
3278
|
-
* playbackConfig: {
|
|
3279
|
-
* isMuted: true,
|
|
3280
|
-
* },
|
|
3281
|
-
* });
|
|
3282
|
-
* ```
|
|
3283
|
-
*/
|
|
3284
|
-
isMuted?: boolean;
|
|
3285
|
-
/**
|
|
3286
|
-
* Whether time shift / DVR for live streams is enabled or not. Default is `true`.
|
|
3287
|
-
* @example
|
|
3288
|
-
* ```
|
|
3289
|
-
* const player = new Player({
|
|
3290
|
-
* playbackConfig: {
|
|
3291
|
-
* isTimeShiftEnabled: false,
|
|
3292
|
-
* },
|
|
3293
|
-
* });
|
|
3294
|
-
* ```
|
|
3295
|
-
*/
|
|
3296
|
-
isTimeShiftEnabled?: boolean;
|
|
3297
|
-
/**
|
|
3298
|
-
* Whether background playback is enabled or not.
|
|
3299
|
-
* Default is `false`.
|
|
3300
|
-
*
|
|
3301
|
-
* When set to `true`, playback is not automatically paused
|
|
3302
|
-
* anymore when the app moves to the background.
|
|
3303
|
-
* When set to `true`, also make sure to properly configure your app to allow
|
|
3304
|
-
* background playback.
|
|
3305
|
-
*
|
|
3306
|
-
* Default is `false`.
|
|
3307
|
-
*
|
|
3308
|
-
* @note
|
|
3309
|
-
* On Android, {@link MediaControlConfig.isEnabled} has to be `true` for
|
|
3310
|
-
* background playback to work.
|
|
3311
|
-
* @note
|
|
3312
|
-
* On tvOS, background playback is only supported for audio-only content.
|
|
3313
|
-
*
|
|
3314
|
-
* @example
|
|
3315
|
-
* ```
|
|
3316
|
-
* const player = new Player({
|
|
3317
|
-
* playbackConfig: {
|
|
3318
|
-
* isBackgroundPlaybackEnabled: true,
|
|
3319
|
-
* },
|
|
3320
|
-
* });
|
|
3321
|
-
* ```
|
|
3322
|
-
*/
|
|
3323
|
-
isBackgroundPlaybackEnabled?: boolean;
|
|
3324
|
-
/**
|
|
3325
|
-
* Whether the Picture in Picture mode option is enabled or not. Default is `false`.
|
|
3326
|
-
* @example
|
|
3327
|
-
* ```
|
|
3328
|
-
* const player = new Player({
|
|
3329
|
-
* playbackConfig: {
|
|
3330
|
-
* isPictureInPictureEnabled: true,
|
|
3331
|
-
* },
|
|
3332
|
-
* });
|
|
3333
|
-
* ```
|
|
3334
|
-
* @deprecated Use {@link PictureInPictureConfig.isEnabled} instead.
|
|
3335
|
-
*/
|
|
3336
|
-
isPictureInPictureEnabled?: boolean;
|
|
3337
|
-
/**
|
|
3338
|
-
* Configures decoder behaviour.
|
|
3339
|
-
*
|
|
3340
|
-
* @platform Android
|
|
3341
|
-
*/
|
|
3342
|
-
decoderConfig?: DecoderConfig;
|
|
3343
|
-
}
|
|
3344
|
-
|
|
3345
|
-
/**
|
|
3346
|
-
* Contains config values regarding the behaviour when playing live streams.
|
|
3347
|
-
*/
|
|
3348
|
-
interface LiveConfig {
|
|
3349
|
-
/**
|
|
3350
|
-
* The minimum buffer depth of a stream needed to enable time shifting.
|
|
3351
|
-
* When the internal value for the maximal possible timeshift is lower than this value,
|
|
3352
|
-
* timeshifting should be disabled. That means `Player.maxTimeShift` returns `0` in that case.
|
|
3353
|
-
* This value should always be non-positive value, default value is `-40`.
|
|
3354
|
-
*/
|
|
3355
|
-
minTimeshiftBufferDepth?: number;
|
|
3356
|
-
}
|
|
3357
|
-
|
|
3358
|
-
/**
|
|
3359
|
-
* Configures the media control information for the application. This information will be displayed
|
|
3360
|
-
* wherever current media information typically appears, such as the lock screen, in notifications, and
|
|
3361
|
-
* and inside the control center.
|
|
3362
|
-
*/
|
|
3363
|
-
interface MediaControlConfig {
|
|
3364
|
-
/**
|
|
3365
|
-
* Enable the default behavior of displaying media information
|
|
3366
|
-
* on the lock screen, in notifications, and within the control center.
|
|
3367
|
-
*
|
|
3368
|
-
* Default is `true`.
|
|
3369
|
-
*
|
|
3370
|
-
* For a detailed list of the supported features in the **default behavior**,
|
|
3371
|
-
* check the **Default Supported Features** section.
|
|
3372
|
-
*
|
|
3373
|
-
* @note Enabling this flag will automatically treat {@link TweaksConfig.updatesNowPlayingInfoCenter} as `false`.
|
|
3374
|
-
*
|
|
3375
|
-
* ## Limitations
|
|
3376
|
-
* ---
|
|
3377
|
-
* - Android: If an app creates multiple player instances, the player shown in media controls is the latest one created having media controls enabled.
|
|
3378
|
-
* - At the moment, the current media information is disabled during casting.
|
|
3379
|
-
*
|
|
3380
|
-
* ## Known Issues
|
|
3381
|
-
* ---
|
|
3382
|
-
* **iOS**:
|
|
3383
|
-
* - There is unexpected behavior when using the IMA SDK. The Google IMA SDK adds its own commands
|
|
3384
|
-
* for play/pause as soon as the ad starts loading (not when it starts playing). Within this window
|
|
3385
|
-
* (approximately around 10 seconds), it is possible that both the ad and the main content are playing
|
|
3386
|
-
* at the same time when a user interacts with the media control feature.
|
|
3387
|
-
*
|
|
3388
|
-
* ## Default Supported Features
|
|
3389
|
-
* ---
|
|
3390
|
-
* Here is the list of features supported by the default behavior.
|
|
3391
|
-
*
|
|
3392
|
-
* ### Populated Metadata
|
|
3393
|
-
* - media type (to visualize the correct kind of data — _e.g. a waveform for audio files_)
|
|
3394
|
-
* - title
|
|
3395
|
-
* - artwork
|
|
3396
|
-
* - elapsed time
|
|
3397
|
-
* - duration
|
|
3398
|
-
*
|
|
3399
|
-
* **Android-only**
|
|
3400
|
-
* - source description
|
|
3401
|
-
*
|
|
3402
|
-
* **iOS-only**
|
|
3403
|
-
* - live or VOD status
|
|
3404
|
-
* - playback rate
|
|
3405
|
-
* - default playback rate
|
|
3406
|
-
*
|
|
3407
|
-
* ### Registered Commands
|
|
3408
|
-
* - toggle play/pause
|
|
3409
|
-
* - change playback position
|
|
3410
|
-
*
|
|
3411
|
-
* **iOS-only**
|
|
3412
|
-
* - skip forward
|
|
3413
|
-
* - skip backward
|
|
3414
|
-
* - play
|
|
3415
|
-
* - pause
|
|
3416
|
-
*/
|
|
3417
|
-
isEnabled?: boolean;
|
|
3418
|
-
}
|
|
3419
|
-
|
|
3420
|
-
/**
|
|
3421
|
-
* Object used to configure a new `Player` instance.
|
|
3422
|
-
*/
|
|
3423
|
-
interface PlayerConfig extends NativeInstanceConfig {
|
|
3424
|
-
/**
|
|
3425
|
-
* Bitmovin license key that can be found in the Bitmovin portal.
|
|
3426
|
-
* If a license key is set here, it will be used instead of the license key found in the `Info.plist` and `AndroidManifest.xml`.
|
|
3427
|
-
* @example
|
|
3428
|
-
* Configuring the player license key from source code:
|
|
3429
|
-
* ```
|
|
3430
|
-
* const player = new Player({
|
|
3431
|
-
* licenseKey: '\<LICENSE-KEY-CODE\>',
|
|
3432
|
-
* });
|
|
3433
|
-
* ```
|
|
3434
|
-
* @example
|
|
3435
|
-
* `licenseKey` can be safely omitted from source code if it has
|
|
3436
|
-
* been configured in Info.plist/AndroidManifest.xml.
|
|
3437
|
-
* ```
|
|
3438
|
-
* const player = new Player(); // omit `licenseKey`
|
|
3439
|
-
* player.play(); // call methods and properties...
|
|
3440
|
-
* ```
|
|
3441
|
-
*/
|
|
3442
|
-
licenseKey?: string;
|
|
3443
|
-
/**
|
|
3444
|
-
* Configures playback behaviour. A default {@link PlaybackConfig} is set initially.
|
|
3445
|
-
*/
|
|
3446
|
-
playbackConfig?: PlaybackConfig;
|
|
3447
|
-
/**
|
|
3448
|
-
* Configures the visual presentation and behaviour of the player UI. A default {@link StyleConfig} is set initially.
|
|
3449
|
-
*/
|
|
3450
|
-
styleConfig?: StyleConfig;
|
|
3451
|
-
/**
|
|
3452
|
-
* Configures advertising functionality. A default {@link AdvertisingConfig} is set initially.
|
|
3453
|
-
*/
|
|
3454
|
-
advertisingConfig?: AdvertisingConfig;
|
|
3455
|
-
/**
|
|
3456
|
-
* Configures experimental features. A default {@link TweaksConfig} is set initially.
|
|
3457
|
-
*/
|
|
3458
|
-
tweaksConfig?: TweaksConfig;
|
|
3459
|
-
/**
|
|
3460
|
-
* Configures analytics functionality.
|
|
3461
|
-
*/
|
|
3462
|
-
analyticsConfig?: AnalyticsConfig;
|
|
3463
|
-
/**
|
|
3464
|
-
* Configures adaptation logic.
|
|
3465
|
-
*/
|
|
3466
|
-
adaptationConfig?: AdaptationConfig;
|
|
3467
|
-
/**
|
|
3468
|
-
* Configures remote playback functionality.
|
|
3469
|
-
*/
|
|
3470
|
-
remoteControlConfig?: RemoteControlConfig;
|
|
3471
|
-
/**
|
|
3472
|
-
* Configures buffer settings. A default {@link BufferConfig} is set initially.
|
|
3473
|
-
*/
|
|
3474
|
-
bufferConfig?: BufferConfig;
|
|
3475
|
-
/**
|
|
3476
|
-
* Configures behaviour when playing live content. A default {@link LiveConfig} is set initially.
|
|
3477
|
-
*/
|
|
3478
|
-
liveConfig?: LiveConfig;
|
|
3479
|
-
/**
|
|
3480
|
-
* Configures network request manipulation functionality. A default {@link NetworkConfig} is set initially.
|
|
3481
|
-
*/
|
|
3482
|
-
networkConfig?: NetworkConfig;
|
|
3483
|
-
/**
|
|
3484
|
-
* Configures the media control information for the application. This information will be displayed
|
|
3485
|
-
* wherever current media information typically appears, such as the lock screen, in notifications,
|
|
3486
|
-
* and inside the control center.
|
|
3487
|
-
*/
|
|
3488
|
-
mediaControlConfig?: MediaControlConfig;
|
|
3489
|
-
}
|
|
3490
|
-
|
|
3491
|
-
/**
|
|
3492
|
-
* Represents different types of media.
|
|
3493
|
-
*/
|
|
3494
|
-
declare enum MediaType {
|
|
3495
|
-
/**
|
|
3496
|
-
* Audio media type.
|
|
3497
|
-
*/
|
|
3498
|
-
AUDIO = "audio",
|
|
3499
|
-
/**
|
|
3500
|
-
* Video media type.
|
|
3501
|
-
*/
|
|
3502
|
-
VIDEO = "video"
|
|
3503
|
-
}
|
|
3504
|
-
/**
|
|
3505
|
-
* Represents different types of buffered data.
|
|
3506
|
-
*/
|
|
3507
|
-
declare enum BufferType {
|
|
3508
|
-
/**
|
|
3509
|
-
* Represents the buffered data starting at the current playback time.
|
|
3510
|
-
*/
|
|
3511
|
-
FORWARD_DURATION = "forwardDuration",
|
|
3512
|
-
/**
|
|
3513
|
-
* Represents the buffered data up until the current playback time.
|
|
3514
|
-
*/
|
|
3515
|
-
BACKWARD_DURATION = "backwardDuration"
|
|
3516
|
-
}
|
|
3517
|
-
/**
|
|
3518
|
-
* Holds different information about the buffer levels.
|
|
3519
|
-
*/
|
|
3520
|
-
interface BufferLevel {
|
|
3521
|
-
/**
|
|
3522
|
-
* The amount of currently buffered data, e.g. audio or video buffer level.
|
|
3523
|
-
*/
|
|
3524
|
-
level?: number;
|
|
3525
|
-
/**
|
|
3526
|
-
* The target buffer level the player tries to maintain.
|
|
3527
|
-
*/
|
|
3528
|
-
targetLevel?: number;
|
|
3529
|
-
/**
|
|
3530
|
-
* The media type the buffer data applies to.
|
|
3531
|
-
*/
|
|
3532
|
-
media?: MediaType;
|
|
3533
|
-
/**
|
|
3534
|
-
* The buffer type the buffer data applies to.
|
|
3535
|
-
*/
|
|
3536
|
-
type?: BufferType;
|
|
3537
|
-
}
|
|
3538
|
-
/**
|
|
3539
|
-
* Collection of {@link BufferLevel} objects
|
|
3540
|
-
*/
|
|
3541
|
-
interface BufferLevels {
|
|
3542
|
-
/**
|
|
3543
|
-
* {@link BufferLevel} for {@link MediaType.AUDIO}.
|
|
3544
|
-
*/
|
|
3545
|
-
audio: BufferLevel;
|
|
3546
|
-
/**
|
|
3547
|
-
* {@link BufferLevel} for {@link MediaType.VIDEO}.
|
|
3548
|
-
*/
|
|
3549
|
-
video: BufferLevel;
|
|
3550
|
-
}
|
|
3551
|
-
/**
|
|
3552
|
-
* Provides the means to configure buffer settings and to query the current buffer state.
|
|
3553
|
-
* Accessible through {@link Player.buffer}.
|
|
3554
|
-
*/
|
|
3555
|
-
declare class BufferApi {
|
|
3556
|
-
/**
|
|
3557
|
-
* The native player id that this buffer api is attached to.
|
|
3558
|
-
*/
|
|
3559
|
-
readonly nativeId: string;
|
|
3560
|
-
constructor(playerId: string);
|
|
3561
|
-
/**
|
|
3562
|
-
* Gets the {@link BufferLevel|buffer level} from the Player
|
|
3563
|
-
* @param type The {@link BufferType} to return the level for.
|
|
3564
|
-
* @returns a {@link BufferLevels} that contains {@link BufferLevel} values for audio and video.
|
|
3565
|
-
*/
|
|
3566
|
-
getLevel: (type: BufferType) => Promise<BufferLevels>;
|
|
3567
|
-
/**
|
|
3568
|
-
* Sets the target buffer level for the chosen buffer {@link BufferType} across all {@link MediaType} options.
|
|
3569
|
-
*
|
|
3570
|
-
* @param type The {@link BufferType} to set the target level for. On iOS and tvOS, only {@link BufferType.FORWARD_DURATION} is supported.
|
|
3571
|
-
* @param value The value to set. On iOS and tvOS when passing `0`, the player will choose an appropriate forward buffer duration suitable for most use-cases. On Android setting to `0` will have no effect.
|
|
3572
|
-
*/
|
|
3573
|
-
setTargetLevel: (type: BufferType, value: number) => Promise<void>;
|
|
3574
|
-
}
|
|
3575
|
-
|
|
3576
|
-
/**
|
|
3577
|
-
* Loads, controls and renders audio and video content represented through {@link Source}s. A player
|
|
3578
|
-
* instance can be created via the {@link usePlayer} hook and will idle until one or more {@link Source}s are
|
|
3579
|
-
* loaded. Once {@link Player.load} or {@link Player.loadSource} is called, the player becomes active and initiates necessary downloads to
|
|
3580
|
-
* start playback of the loaded source(s).
|
|
3581
|
-
*
|
|
3582
|
-
* Can be attached to {@link PlayerView} component in order to use Bitmovin's Player Web UI.
|
|
3583
|
-
* @see PlayerView
|
|
3584
|
-
*/
|
|
3585
|
-
declare class Player extends NativeInstance<PlayerConfig> {
|
|
3586
|
-
/**
|
|
3587
|
-
* Whether the native `Player` object has been created.
|
|
3588
|
-
*/
|
|
3589
|
-
isInitialized: boolean;
|
|
3590
|
-
/**
|
|
3591
|
-
* Whether the native `Player` object has been disposed.
|
|
3592
|
-
*/
|
|
3593
|
-
isDestroyed: boolean;
|
|
3594
|
-
/**
|
|
3595
|
-
* Currently active source, or `null` if none is active.
|
|
3596
|
-
*/
|
|
3597
|
-
source?: Source;
|
|
3598
|
-
/**
|
|
3599
|
-
* The `AnalyticsApi` for interactions regarding the `Player`'s analytics.
|
|
3600
|
-
*
|
|
3601
|
-
* `undefined` if the player was created without analytics support.
|
|
3602
|
-
*/
|
|
3603
|
-
analytics?: AnalyticsApi;
|
|
3604
|
-
/**
|
|
3605
|
-
* The {@link BufferApi} for interactions regarding the buffer.
|
|
3606
|
-
*/
|
|
3607
|
-
buffer: BufferApi;
|
|
3608
|
-
private network?;
|
|
3609
|
-
private decoderConfig?;
|
|
3610
|
-
/**
|
|
3611
|
-
* Allocates the native `Player` instance and its resources natively.
|
|
3612
|
-
*/
|
|
3613
|
-
initialize: () => void;
|
|
3614
|
-
/**
|
|
3615
|
-
* Destroys the native `Player` and releases all of its allocated resources.
|
|
3616
|
-
*/
|
|
3617
|
-
destroy: () => void;
|
|
3618
|
-
/**
|
|
3619
|
-
* Loads a new {@link Source} from `sourceConfig` into the player.
|
|
3620
|
-
*/
|
|
3621
|
-
load: (sourceConfig: SourceConfig) => void;
|
|
3622
|
-
/**
|
|
3623
|
-
* Loads the downloaded content from {@link OfflineContentManager} into the player.
|
|
3624
|
-
*/
|
|
3625
|
-
loadOfflineContent: (offlineContentManager: OfflineContentManager, options?: OfflineSourceOptions) => void;
|
|
3626
|
-
/**
|
|
3627
|
-
* Loads the given {@link Source} into the player.
|
|
3628
|
-
*/
|
|
3629
|
-
loadSource: (source: Source) => void;
|
|
3630
|
-
/**
|
|
3631
|
-
* Unloads all {@link Source}s from the player.
|
|
3632
|
-
*/
|
|
3633
|
-
unload: () => void;
|
|
3634
|
-
/**
|
|
3635
|
-
* Starts or resumes playback after being paused. Has no effect if the player is already playing.
|
|
3636
|
-
*/
|
|
3637
|
-
play: () => void;
|
|
3638
|
-
/**
|
|
3639
|
-
* Pauses the video if it is playing. Has no effect if the player is already paused.
|
|
3640
|
-
*/
|
|
3641
|
-
pause: () => void;
|
|
3642
|
-
/**
|
|
3643
|
-
* Seeks to the given playback time specified by the parameter `time` in seconds. Must not be
|
|
3644
|
-
* greater than the total duration of the video. Has no effect when watching a live stream since
|
|
3645
|
-
* seeking is not possible.
|
|
3646
|
-
*
|
|
3647
|
-
* @param time - The time to seek to in seconds.
|
|
3648
|
-
*/
|
|
3649
|
-
seek: (time: number) => void;
|
|
3650
|
-
/**
|
|
3651
|
-
* Shifts the time to the given `offset` in seconds from the live edge. The resulting offset has to be within the
|
|
3652
|
-
* timeShift window as specified by `maxTimeShift` (which is a negative value) and 0. When the provided `offset` is
|
|
3653
|
-
* positive, it will be interpreted as a UNIX timestamp in seconds and converted to fit into the timeShift window.
|
|
3654
|
-
* When the provided `offset` is negative, but lower than `maxTimeShift`, then it will be clamped to `maxTimeShift`.
|
|
3655
|
-
* Has no effect for VoD.
|
|
3656
|
-
*
|
|
3657
|
-
* Has no effect if no sources are loaded.
|
|
3658
|
-
*
|
|
3659
|
-
* @param offset - Target offset from the live edge in seconds.
|
|
3660
|
-
*/
|
|
3661
|
-
timeShift: (offset: number) => void;
|
|
3662
|
-
/**
|
|
3663
|
-
* Mutes the player if an audio track is available. Has no effect if the player is already muted.
|
|
3664
|
-
*/
|
|
3665
|
-
mute: () => void;
|
|
3666
|
-
/**
|
|
3667
|
-
* Unmutes the player if it is muted. Has no effect if the player is already unmuted.
|
|
3668
|
-
*/
|
|
3669
|
-
unmute: () => void;
|
|
3670
|
-
/**
|
|
3671
|
-
* Sets the player's volume between 0 (silent) and 100 (max volume).
|
|
3672
|
-
*
|
|
3673
|
-
* @param volume - The volume level to set.
|
|
3674
|
-
*/
|
|
3675
|
-
setVolume: (volume: number) => void;
|
|
3676
|
-
/**
|
|
3677
|
-
* @returns The player's current volume level.
|
|
3678
|
-
*/
|
|
3679
|
-
getVolume: () => Promise<number>;
|
|
3680
|
-
/**
|
|
3681
|
-
* @returns The current playback time in seconds.
|
|
3682
|
-
*
|
|
3683
|
-
* For VoD streams the returned time ranges between 0 and the duration of the asset.
|
|
3684
|
-
*
|
|
3685
|
-
* For live streams it can be specified if an absolute UNIX timestamp or a value
|
|
3686
|
-
* relative to the playback start should be returned.
|
|
3687
|
-
*
|
|
3688
|
-
* @param mode - The time mode to specify: an absolute UNIX timestamp ('absolute') or relative time ('relative').
|
|
3689
|
-
*/
|
|
3690
|
-
getCurrentTime: (mode?: 'relative' | 'absolute') => Promise<number>;
|
|
3691
|
-
/**
|
|
3692
|
-
* @returns The total duration in seconds of the current video or INFINITY if it’s a live stream.
|
|
3693
|
-
*/
|
|
3694
|
-
getDuration: () => Promise<number>;
|
|
3695
|
-
/**
|
|
3696
|
-
* @returns `true` if the player is muted.
|
|
3697
|
-
*/
|
|
3698
|
-
isMuted: () => Promise<boolean>;
|
|
3699
|
-
/**
|
|
3700
|
-
* @returns `true` if the player is currently playing, i.e. has started and is not paused.
|
|
3701
|
-
*/
|
|
3702
|
-
isPlaying: () => Promise<boolean>;
|
|
3703
|
-
/**
|
|
3704
|
-
* @returns `true` if the player has started playback but it's currently paused.
|
|
3705
|
-
*/
|
|
3706
|
-
isPaused: () => Promise<boolean>;
|
|
3707
|
-
/**
|
|
3708
|
-
* @returns `true` if the displayed video is a live stream.
|
|
3709
|
-
*/
|
|
3710
|
-
isLive: () => Promise<boolean>;
|
|
3711
|
-
/**
|
|
3712
|
-
* @remarks Only available for iOS devices.
|
|
3713
|
-
* @returns `true` when media is played externally using AirPlay.
|
|
3714
|
-
*/
|
|
3715
|
-
isAirPlayActive: () => Promise<boolean>;
|
|
3716
|
-
/**
|
|
3717
|
-
* @remarks Only available for iOS devices.
|
|
3718
|
-
* @returns `true` when AirPlay is available.
|
|
3719
|
-
*/
|
|
3720
|
-
isAirPlayAvailable: () => Promise<boolean>;
|
|
3721
|
-
/**
|
|
3722
|
-
* @returns The currently selected audio track or `null`.
|
|
3723
|
-
*/
|
|
3724
|
-
getAudioTrack: () => Promise<AudioTrack | null>;
|
|
3725
|
-
/**
|
|
3726
|
-
* @returns An array containing {@link AudioTrack} objects for all available audio tracks.
|
|
3727
|
-
*/
|
|
3728
|
-
getAvailableAudioTracks: () => Promise<AudioTrack[]>;
|
|
3729
|
-
/**
|
|
3730
|
-
* Sets the audio track to the ID specified by trackIdentifier. A list can be retrieved by calling getAvailableAudioTracks.
|
|
3731
|
-
*
|
|
3732
|
-
* @param trackIdentifier - The {@link AudioTrack.identifier} to be set.
|
|
3733
|
-
*/
|
|
3734
|
-
setAudioTrack: (trackIdentifier: string) => Promise<void>;
|
|
3735
|
-
/**
|
|
3736
|
-
* @returns The currently selected {@link SubtitleTrack} or `null`.
|
|
3737
|
-
*/
|
|
3738
|
-
getSubtitleTrack: () => Promise<SubtitleTrack | null>;
|
|
3739
|
-
/**
|
|
3740
|
-
* @returns An array containing SubtitleTrack objects for all available subtitle tracks.
|
|
3741
|
-
*/
|
|
3742
|
-
getAvailableSubtitles: () => Promise<SubtitleTrack[]>;
|
|
3743
|
-
/**
|
|
3744
|
-
* Sets the subtitle track to the ID specified by trackIdentifier. A list can be retrieved by calling getAvailableSubtitles.
|
|
3745
|
-
*
|
|
3746
|
-
* @param trackIdentifier - The {@link SubtitleTrack.identifier} to be set.
|
|
3747
|
-
*/
|
|
3748
|
-
setSubtitleTrack: (trackIdentifier?: string) => Promise<void>;
|
|
3749
|
-
/**
|
|
3750
|
-
* Dynamically schedules the {@link AdItem} for playback.
|
|
3751
|
-
* Has no effect if there is no active playback session.
|
|
3752
|
-
*
|
|
3753
|
-
* @param adItem - Ad to be scheduled for playback.
|
|
3754
|
-
*
|
|
3755
|
-
* @platform iOS, Android
|
|
3756
|
-
*/
|
|
3757
|
-
scheduleAd: (adItem: AdItem) => void;
|
|
3758
|
-
/**
|
|
3759
|
-
* Skips the current ad.
|
|
3760
|
-
* Has no effect if the current ad is not skippable or if no ad is being played back.
|
|
3761
|
-
*
|
|
3762
|
-
* @platform iOS, Android
|
|
3763
|
-
*/
|
|
3764
|
-
skipAd: () => void;
|
|
3765
|
-
/**
|
|
3766
|
-
* @returns `true` while an ad is being played back or when main content playback has been paused for ad playback.
|
|
3767
|
-
* @platform iOS, Android
|
|
3768
|
-
*/
|
|
3769
|
-
isAd: () => Promise<boolean>;
|
|
3770
|
-
/**
|
|
3771
|
-
* The current time shift of the live stream in seconds. This value is always 0 if the active {@link Source} is not a
|
|
3772
|
-
* live stream or no sources are loaded.
|
|
3773
|
-
*/
|
|
3774
|
-
getTimeShift: () => Promise<number>;
|
|
3775
|
-
/**
|
|
3776
|
-
* The limit in seconds for time shifting. This value is either negative or 0 and it is always 0 if the active
|
|
3777
|
-
* {@link Source} is not a live stream or no sources are loaded.
|
|
3778
|
-
*/
|
|
3779
|
-
getMaxTimeShift: () => Promise<number>;
|
|
3780
|
-
/**
|
|
3781
|
-
* Sets the upper bitrate boundary for video qualities. All qualities with a bitrate
|
|
3782
|
-
* that is higher than this threshold will not be eligible for automatic quality selection.
|
|
3783
|
-
*
|
|
3784
|
-
* Can be set to `null` for no limitation.
|
|
3785
|
-
*/
|
|
3786
|
-
setMaxSelectableBitrate: (bitrate: number | null) => void;
|
|
3787
|
-
/**
|
|
3788
|
-
* @returns a {@link Thumbnail} for the specified playback time for the currently active source if available.
|
|
3789
|
-
* Supported thumbnail formats are:
|
|
3790
|
-
* - `WebVtt` configured via {@link SourceConfig.thumbnailTrack}, on all supported platforms
|
|
3791
|
-
* - HLS `Image Media Playlist` in the multivariant playlist, Android-only
|
|
3792
|
-
* - DASH `Image Adaptation Set` as specified in DASH-IF IOP, Android-only
|
|
3793
|
-
* If a `WebVtt` thumbnail track is provided, any potential in-manifest thumbnails are ignored on Android.
|
|
3794
|
-
*
|
|
3795
|
-
* @param time - The time in seconds for which to retrieve the thumbnail.
|
|
3796
|
-
*/
|
|
3797
|
-
getThumbnail: (time: number) => Promise<Thumbnail | null>;
|
|
3798
|
-
/**
|
|
3799
|
-
* Whether casting to a cast-compatible remote device is available. {@link CastAvailableEvent} signals when
|
|
3800
|
-
* casting becomes available.
|
|
3801
|
-
*
|
|
3802
|
-
* @platform iOS, Android
|
|
3803
|
-
*/
|
|
3804
|
-
isCastAvailable: () => Promise<boolean>;
|
|
3805
|
-
/**
|
|
3806
|
-
* Whether video is currently being casted to a remote device and not played locally.
|
|
3807
|
-
*
|
|
3808
|
-
* @platform iOS, Android
|
|
3809
|
-
*/
|
|
3810
|
-
isCasting: () => Promise<boolean>;
|
|
3811
|
-
/**
|
|
3812
|
-
* Initiates casting the current video to a cast-compatible remote device. The user has to choose to which device it
|
|
3813
|
-
* should be sent.
|
|
3814
|
-
*
|
|
3815
|
-
* @platform iOS, Android
|
|
3816
|
-
*/
|
|
3817
|
-
castVideo: () => void;
|
|
3818
|
-
/**
|
|
3819
|
-
* Stops casting the current video. Has no effect if {@link Player.isCasting} is `false`.
|
|
3820
|
-
*
|
|
3821
|
-
* @platform iOS, Android
|
|
3822
|
-
*/
|
|
3823
|
-
castStop: () => void;
|
|
3824
|
-
/**
|
|
3825
|
-
* Returns the currently selected video quality.
|
|
3826
|
-
* @returns The currently selected video quality.
|
|
3827
|
-
*/
|
|
3828
|
-
getVideoQuality: () => Promise<VideoQuality>;
|
|
3829
|
-
/**
|
|
3830
|
-
* Returns an array containing all available video qualities the player can adapt between.
|
|
3831
|
-
* @returns An array containing all available video qualities the player can adapt between.
|
|
3832
|
-
*/
|
|
3833
|
-
getAvailableVideoQualities: () => Promise<VideoQuality[]>;
|
|
3834
|
-
/**
|
|
3835
|
-
* Sets the video quality.
|
|
3836
|
-
* @remarks Only available on Android.
|
|
3837
|
-
* @platform Android
|
|
3838
|
-
*
|
|
3839
|
-
* @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.
|
|
3840
|
-
*/
|
|
3841
|
-
setVideoQuality: (qualityId: String) => void;
|
|
3842
|
-
/**
|
|
3843
|
-
* Sets the playback speed of the player. Fast forward, slow motion and reverse playback are supported.
|
|
3844
|
-
* @note
|
|
3845
|
-
* - Slow motion is indicated by values between `0` and `1`.
|
|
3846
|
-
* - Fast forward by values greater than `1`.
|
|
3847
|
-
* - Slow reverse is used by values between `0` and `-1`, and fast reverse is used by values less than `-1`. iOS and tvOS only.
|
|
3848
|
-
* @note
|
|
3849
|
-
* Negative values are ignored during Casting and on Android.
|
|
3850
|
-
* @note
|
|
3851
|
-
* During reverse playback the playback will continue until the beginning of the active source is
|
|
3852
|
-
* reached. When reaching the beginning of the source, playback will be paused and the playback
|
|
3853
|
-
* speed will be reset to its default value of `1`. No {@link PlaybackFinishedEvent} will be
|
|
3854
|
-
* emitted in this case.
|
|
3855
|
-
*
|
|
3856
|
-
* @param playbackSpeed - The playback speed to set.
|
|
3857
|
-
*/
|
|
3858
|
-
setPlaybackSpeed: (playbackSpeed: number) => void;
|
|
3859
|
-
/**
|
|
3860
|
-
* @see {@link setPlaybackSpeed} for details on which values playback speed can assume.
|
|
3861
|
-
* @returns The player's current playback speed.
|
|
3862
|
-
*/
|
|
3863
|
-
getPlaybackSpeed: () => Promise<number>;
|
|
3864
|
-
/**
|
|
3865
|
-
* Checks the possibility to play the media at specified playback speed.
|
|
3866
|
-
* @param playbackSpeed - The playback speed to check.
|
|
3867
|
-
* @returns `true` if it's possible to play the media at the specified playback speed, otherwise `false`. On Android it always returns `undefined`.
|
|
3868
|
-
* @platform iOS, tvOS
|
|
3869
|
-
*/
|
|
3870
|
-
canPlayAtPlaybackSpeed: (playbackSpeed: number) => Promise<boolean | undefined>;
|
|
3871
|
-
private maybeInitDecoderConfig;
|
|
3872
|
-
}
|
|
3873
|
-
|
|
3874
|
-
/**
|
|
3875
|
-
* Handles the UI state change when fullscreen should be entered or exited.
|
|
3876
|
-
*/
|
|
3877
|
-
interface FullscreenHandler {
|
|
3878
|
-
/**
|
|
3879
|
-
* Indicates if the UI is currently in fullscreen mode
|
|
3880
|
-
*/
|
|
3881
|
-
isFullscreenActive: boolean;
|
|
3882
|
-
/**
|
|
3883
|
-
* Is called by the `PlayerView` when the UI should enter fullscreen mode.
|
|
3884
|
-
*/
|
|
3885
|
-
enterFullscreen(): void;
|
|
3886
|
-
/**
|
|
3887
|
-
* Is called by the `PlayerView` when the UI should exit fullscreen mode.
|
|
3888
|
-
*/
|
|
3889
|
-
exitFullscreen(): void;
|
|
3890
|
-
}
|
|
3891
|
-
|
|
3892
|
-
/** @internal */
|
|
3893
|
-
interface CustomMessageSender {
|
|
3894
|
-
sendMessage(message: string, data: string | undefined): void;
|
|
3895
|
-
}
|
|
3896
|
-
|
|
3897
|
-
interface CustomMessageHandlerProps {
|
|
3898
|
-
/**
|
|
3899
|
-
* A function that will be called when the Player UI sends a synchronous message to the integration.
|
|
3900
|
-
*/
|
|
3901
|
-
onReceivedSynchronousMessage: (message: string, data: string | undefined) => string | undefined;
|
|
3902
|
-
/**
|
|
3903
|
-
* A function that will be called when the Player UI sends an asynchronous message to the integration.
|
|
3904
|
-
*/
|
|
3905
|
-
onReceivedAsynchronousMessage: (message: string, data: string | undefined) => void;
|
|
3906
|
-
}
|
|
3907
|
-
/**
|
|
3908
|
-
* Android and iOS only.
|
|
3909
|
-
* For Android it requires Player SDK version 3.39.0 or higher.
|
|
3910
|
-
*
|
|
3911
|
-
* Provides a two-way communication channel between the Player UI and the integration.
|
|
3912
|
-
*/
|
|
3913
|
-
declare class CustomMessageHandler {
|
|
3914
|
-
private readonly onReceivedSynchronousMessage;
|
|
3915
|
-
private readonly onReceivedAsynchronousMessage;
|
|
3916
|
-
/** @internal */
|
|
3917
|
-
customMessageSender?: CustomMessageSender;
|
|
3918
|
-
/**
|
|
3919
|
-
* Android and iOS only.
|
|
3920
|
-
*
|
|
3921
|
-
* Creates a new `CustomMessageHandler` instance to handle two-way communication between the integation and the Player UI.
|
|
3922
|
-
*
|
|
3923
|
-
* @param options - Configuration options for the `CustomMessageHandler` instance.
|
|
3924
|
-
*/
|
|
3925
|
-
constructor({ onReceivedSynchronousMessage, onReceivedAsynchronousMessage, }: CustomMessageHandlerProps);
|
|
3926
|
-
/**
|
|
3927
|
-
* Gets called when a synchronous message was received from the Bitmovin Web UI.
|
|
3928
|
-
*
|
|
3929
|
-
* @param message Identifier of the message.
|
|
3930
|
-
* @param data Optional data of the message as string (can be a serialized object).
|
|
3931
|
-
* @returns Optional return value as string which will be propagates back to the JS counterpart.
|
|
3932
|
-
*/
|
|
3933
|
-
receivedSynchronousMessage(message: string, data: string | undefined): string | undefined;
|
|
3934
|
-
/**
|
|
3935
|
-
* Gets called when an asynchronous message was received from the Bitmovin Web UI.
|
|
3936
|
-
*
|
|
3937
|
-
* @param message Identifier of the message.
|
|
3938
|
-
* @param data Optional data of the message as string (can be a serialized object).
|
|
3939
|
-
*/
|
|
3940
|
-
receivedAsynchronousMessage(message: string, data: string | undefined): void;
|
|
3941
|
-
/**
|
|
3942
|
-
* Android and iOS only.
|
|
3943
|
-
*
|
|
3944
|
-
* Sends a message to the Player UI.
|
|
3945
|
-
*
|
|
3946
|
-
* @param message - Identifier for the callback which should be called.
|
|
3947
|
-
* @param data - Payload for the callback.
|
|
3948
|
-
*/
|
|
3949
|
-
sendMessage(message: string, data: string | undefined): void;
|
|
3950
|
-
}
|
|
3951
|
-
|
|
3952
|
-
/**
|
|
3953
|
-
* Provides options to configure Picture in Picture playback.
|
|
3954
|
-
*/
|
|
3955
|
-
interface PictureInPictureConfig {
|
|
3956
|
-
/**
|
|
3957
|
-
* Whether Picture in Picture feature is enabled or not.
|
|
3958
|
-
*
|
|
3959
|
-
* Default is `false`.
|
|
3960
|
-
*/
|
|
3961
|
-
isEnabled?: boolean;
|
|
3962
|
-
/**
|
|
3963
|
-
* Defines whether Picture in Picture should start automatically when the app transitions to background.
|
|
3964
|
-
*
|
|
3965
|
-
* Does not have any affect when Picture in Picture is disabled.
|
|
3966
|
-
*
|
|
3967
|
-
* Default is `false`.
|
|
3968
|
-
*
|
|
3969
|
-
* @platform iOS 14.2 and above
|
|
3970
|
-
*/
|
|
3971
|
-
shouldEnterOnBackground?: boolean;
|
|
3972
|
-
}
|
|
3973
|
-
|
|
3974
|
-
/**
|
|
3975
|
-
* Configures the visual presentation and behaviour of the `PlayerView`.
|
|
3976
|
-
*/
|
|
3977
|
-
interface PlayerViewConfig {
|
|
3978
|
-
/**
|
|
3979
|
-
* Configures the visual presentation and behaviour of the Bitmovin Player UI.
|
|
3980
|
-
* A {@link WebUiConfig} can be used to configure the default Bitmovin Player Web UI.
|
|
3981
|
-
*
|
|
3982
|
-
* Default is {@link WebUiConfig}.
|
|
3983
|
-
*
|
|
3984
|
-
* Limitations:
|
|
3985
|
-
* Configuring the `uiConfig` only has an effect if the {@link StyleConfig.userInterfaceType} is set to {@link UserInterfaceType.Bitmovin}.
|
|
3986
|
-
*/
|
|
3987
|
-
uiConfig?: UiConfig;
|
|
3988
|
-
/**
|
|
3989
|
-
* Provides options to configure Picture in Picture playback.
|
|
3990
|
-
*/
|
|
3991
|
-
pictureInPictureConfig?: PictureInPictureConfig;
|
|
3992
|
-
/**
|
|
3993
|
-
* When set to `true`, the first frame of the main content will not be rendered before playback starts. Default is `false`.
|
|
3994
|
-
* This configuration has no effect for the {@link UserInterfaceType.Subtitle} on iOS/tvOS.
|
|
3995
|
-
*
|
|
3996
|
-
* To reliably hide the first frame before a pre-roll ad, please ensure that you are using the {@link AdvertisingConfig} to schedule ads and not the {@link Player.scheduleAd} API call.
|
|
3997
|
-
*/
|
|
3998
|
-
hideFirstFrame?: boolean;
|
|
3999
|
-
/**
|
|
4000
|
-
* Specify on which surface type the video should be rendered.
|
|
4001
|
-
*
|
|
4002
|
-
* See {@link https://developer.android.com/guide/topics/media/ui/playerview#surfacetype|Choosing a surface type}
|
|
4003
|
-
* for more information.
|
|
4004
|
-
*
|
|
4005
|
-
* Default is {@link SurfaceType.SurfaceView}.
|
|
4006
|
-
*
|
|
4007
|
-
* @platform Android
|
|
4008
|
-
*/
|
|
4009
|
-
surfaceType?: SurfaceType;
|
|
4010
|
-
}
|
|
4011
|
-
/**
|
|
4012
|
-
* Configures the visual presentation and behaviour of the Bitmovin Player UI.
|
|
4013
|
-
*/
|
|
4014
|
-
interface UiConfig {
|
|
4015
|
-
}
|
|
4016
|
-
/**
|
|
4017
|
-
* Configures the visual presentation and behaviour of the Bitmovin Web UI.
|
|
4018
|
-
*/
|
|
4019
|
-
interface WebUiConfig extends UiConfig {
|
|
4020
|
-
/**
|
|
4021
|
-
* Whether the Bitmovin Web UI will show playback speed selection options in the settings menu.
|
|
4022
|
-
* Default is `true`.
|
|
4023
|
-
*/
|
|
4024
|
-
playbackSpeedSelectionEnabled?: boolean;
|
|
4025
|
-
/**
|
|
4026
|
-
* The UI variant to use for the Bitmovin Player Web UI.
|
|
4027
|
-
*
|
|
4028
|
-
* Default is {@link SmallScreenUi}
|
|
4029
|
-
*/
|
|
4030
|
-
variant?: Variant;
|
|
4031
|
-
/**
|
|
4032
|
-
* Whether the WebView should be focused on initialization.
|
|
4033
|
-
*
|
|
4034
|
-
* By default this is enabled only for the TV UI variant, as it's needed there to
|
|
4035
|
-
* initiate spatial navigation using the remote control.
|
|
4036
|
-
*
|
|
4037
|
-
* @platform Android
|
|
4038
|
-
*/
|
|
4039
|
-
focusUiOnInitialization?: boolean;
|
|
4040
|
-
}
|
|
4041
|
-
declare abstract class Variant {
|
|
4042
|
-
readonly uiManagerFactoryFunction: string;
|
|
4043
|
-
/**
|
|
4044
|
-
* Specifies the function name that will be used to initialize the `UIManager`
|
|
4045
|
-
* for the Bitmovin Player Web UI.
|
|
4046
|
-
*
|
|
4047
|
-
* The function is called on the `window` object with the `Player` as the first argument and
|
|
4048
|
-
* the `UIConfig` as the second argument.
|
|
4049
|
-
*
|
|
4050
|
-
* Example:
|
|
4051
|
-
* When you added a new function or want to use a different function of our `UIFactory`,
|
|
4052
|
-
* you can specify the full qualifier name including namespaces.
|
|
4053
|
-
* e.g. `bitmovin.playerui.UIFactory.buildDefaultSmallScreenUI` for the SmallScreenUi.
|
|
4054
|
-
* @see UIFactory https://github.com/bitmovin/bitmovin-player-ui/blob/develop/src/ts/uifactory.ts#L60
|
|
4055
|
-
*
|
|
4056
|
-
* Notes:
|
|
4057
|
-
* - It's not necessary to use our `UIFactory`. Any static function can be specified.
|
|
4058
|
-
*/
|
|
4059
|
-
constructor(uiManagerFactoryFunction: string);
|
|
4060
|
-
}
|
|
4061
|
-
declare class SmallScreenUi extends Variant {
|
|
4062
|
-
constructor();
|
|
4063
|
-
}
|
|
4064
|
-
declare class TvUi extends Variant {
|
|
4065
|
-
constructor();
|
|
4066
|
-
}
|
|
4067
|
-
declare class CustomUi extends Variant {
|
|
4068
|
-
constructor(uiManagerFactoryFunction: string);
|
|
4069
|
-
}
|
|
4070
|
-
/**
|
|
4071
|
-
* The type of surface on which to render video.
|
|
4072
|
-
*
|
|
4073
|
-
* See {@link https://developer.android.com/guide/topics/media/ui/playerview#surfacetype|Choosing a surface type}
|
|
4074
|
-
* for more information.
|
|
4075
|
-
*/
|
|
4076
|
-
declare enum SurfaceType {
|
|
4077
|
-
/**
|
|
4078
|
-
* SurfaceView generally causes lower battery consumption,
|
|
4079
|
-
* and has better handling for HDR and secure content.
|
|
4080
|
-
*/
|
|
4081
|
-
SurfaceView = "SurfaceView",
|
|
4082
|
-
/** TextureView is sometime needed for smooth animations. */
|
|
4083
|
-
TextureView = "TextureView"
|
|
4084
|
-
}
|
|
4085
|
-
|
|
4086
|
-
/**
|
|
4087
|
-
* Base `PlayerView` component props.
|
|
4088
|
-
* Used to establish common props between `NativePlayerView` and {@link PlayerView}.
|
|
4089
|
-
*/
|
|
4090
|
-
interface BasePlayerViewProps {
|
|
4091
|
-
/**
|
|
4092
|
-
* The {@link FullscreenHandler} that is used by the {@link PlayerView} to control the fullscreen mode.
|
|
4093
|
-
*/
|
|
4094
|
-
fullscreenHandler?: FullscreenHandler;
|
|
4095
|
-
/**
|
|
4096
|
-
* The {@link CustomMessageHandler} that can be used to directly communicate with the embedded Bitmovin Web UI.
|
|
4097
|
-
*/
|
|
4098
|
-
customMessageHandler?: CustomMessageHandler;
|
|
4099
|
-
/**
|
|
4100
|
-
* Style of the {@link PlayerView}.
|
|
4101
|
-
*/
|
|
4102
|
-
style?: ViewStyle;
|
|
4103
|
-
/**
|
|
4104
|
-
* Configures the visual presentation and behaviour of the {@link PlayerView}.
|
|
4105
|
-
* The value must not be altered after setting it initially.
|
|
4106
|
-
*/
|
|
4107
|
-
config?: PlayerViewConfig;
|
|
4108
|
-
}
|
|
4109
|
-
/**
|
|
4110
|
-
* {@link PlayerView} component props.
|
|
4111
|
-
*/
|
|
4112
|
-
interface PlayerViewProps extends BasePlayerViewProps, PlayerViewEvents {
|
|
4113
|
-
viewRef?: React.MutableRefObject<null>;
|
|
4114
|
-
/**
|
|
4115
|
-
* {@link Player} instance (generally returned from {@link usePlayer} hook) that will control
|
|
4116
|
-
* and render audio/video inside the {@link PlayerView}.
|
|
4117
|
-
*/
|
|
4118
|
-
player: Player;
|
|
4119
|
-
/**
|
|
4120
|
-
* Can be set to `true` to request fullscreen mode, or `false` to request exit of fullscreen mode.
|
|
4121
|
-
* Should not be used to get the current fullscreen state. Use {@link PlayerViewEvents.onFullscreenEnter} and {@link PlayerViewEvents.onFullscreenExit}
|
|
4122
|
-
* or the {@link FullscreenHandler.isFullscreenActive} property to get the current state.
|
|
4123
|
-
* Using this property to change the fullscreen state, it is ensured that the embedded Player UI is also aware
|
|
4124
|
-
* of potential fullscreen state changes.
|
|
4125
|
-
* To use this property, a {@link FullscreenHandler} must be set.
|
|
4126
|
-
*/
|
|
4127
|
-
isFullscreenRequested?: Boolean;
|
|
4128
|
-
/**
|
|
4129
|
-
* A value defining how the video is displayed within the parent container's bounds.
|
|
4130
|
-
* Possible values are defined in {@link ScalingMode}.
|
|
4131
|
-
*/
|
|
4132
|
-
scalingMode?: ScalingMode;
|
|
4133
|
-
/**
|
|
4134
|
-
* Can be set to `true` to request Picture in Picture mode, or `false` to request exit of Picture in Picture mode.
|
|
4135
|
-
* Should not be used to get the current Picture in Picture state. Use {@link PlayerViewEvents.onPictureInPictureEnter} and {@link PlayerViewEvents.onPictureInPictureExit}.
|
|
4136
|
-
*/
|
|
4137
|
-
isPictureInPictureRequested?: Boolean;
|
|
4138
|
-
}
|
|
4139
|
-
|
|
4140
|
-
/**
|
|
4141
|
-
* Component that provides the Bitmovin Player UI and default UI handling to an attached `Player` instance.
|
|
4142
|
-
* This component needs a `Player` instance to work properly so make sure one is passed to it as a prop.
|
|
4143
|
-
*
|
|
4144
|
-
* @param options configuration options
|
|
4145
|
-
*/
|
|
4146
|
-
declare function PlayerView({ viewRef, style, player, config, fullscreenHandler, customMessageHandler, isFullscreenRequested, scalingMode, isPictureInPictureRequested, ...props }: PlayerViewProps): React$1.JSX.Element;
|
|
4147
|
-
|
|
4148
|
-
/**
|
|
4149
|
-
* React hook that creates and returns a reference to a `Player` instance
|
|
4150
|
-
* that can be used inside any component.
|
|
4151
|
-
*/
|
|
4152
|
-
declare function usePlayer(config?: PlayerConfig): Player;
|
|
4153
|
-
|
|
4154
|
-
/**
|
|
4155
|
-
* The options to be used for initializing `BitmovinCastManager`
|
|
4156
|
-
* @platform Android, iOS
|
|
4157
|
-
*/
|
|
4158
|
-
interface BitmovinCastManagerOptions {
|
|
4159
|
-
/**
|
|
4160
|
-
* ID of receiver application.
|
|
4161
|
-
* Using `null` value will result in using the default application ID
|
|
4162
|
-
*/
|
|
4163
|
-
applicationId?: string | null;
|
|
4164
|
-
/**
|
|
4165
|
-
* A custom message namespace to be used for communication between sender and receiver.
|
|
4166
|
-
* Using `null` value will result in using the default message namespace
|
|
4167
|
-
*/
|
|
4168
|
-
messageNamespace?: string | null;
|
|
4169
|
-
}
|
|
4170
|
-
/**
|
|
4171
|
-
* Singleton providing access to GoogleCast related features.
|
|
4172
|
-
* The `BitmovinCastManager` needs to be initialized by calling `BitmovinCastManager.initialize`
|
|
4173
|
-
* before `Player` creation to enable casting features.
|
|
4174
|
-
*
|
|
4175
|
-
* @platform Android, iOS
|
|
4176
|
-
*/
|
|
4177
|
-
declare const BitmovinCastManager: {
|
|
4178
|
-
/**
|
|
4179
|
-
* Returns whether the `BitmovinCastManager` is initialized.
|
|
4180
|
-
* @returns A promise that resolves with a boolean indicating whether the `BitmovinCastManager` is initialized
|
|
4181
|
-
*/
|
|
4182
|
-
isInitialized: () => Promise<boolean>;
|
|
4183
|
-
/**
|
|
4184
|
-
* Initialize `BitmovinCastManager` based on the provided `BitmovinCastManagerOptions`.
|
|
4185
|
-
* This method needs to be called before `Player` creation to enable casting features.
|
|
4186
|
-
* If no options are provided, the default options will be used.
|
|
4187
|
-
*
|
|
4188
|
-
* IMPORTANT: This should only be called when the Google Cast SDK is available in the application.
|
|
4189
|
-
*
|
|
4190
|
-
* @param options The options to be used for initializing `BitmovinCastManager`
|
|
4191
|
-
* @returns A promise that resolves when the `BitmovinCastManager` was initialized successfully
|
|
4192
|
-
*/
|
|
4193
|
-
initialize: (options?: BitmovinCastManagerOptions | null) => Promise<void>;
|
|
4194
|
-
/**
|
|
4195
|
-
* Must be called in every Android Activity to update the context to the current one.
|
|
4196
|
-
* Make sure to call this method on every Android Activity switch.
|
|
4197
|
-
*
|
|
4198
|
-
* @returns A promise that resolves when the context was updated successfully
|
|
4199
|
-
* @platform Android
|
|
4200
|
-
*/
|
|
4201
|
-
updateContext: () => Promise<void>;
|
|
4202
|
-
/**
|
|
4203
|
-
* Sends the given message to the cast receiver.
|
|
4204
|
-
*
|
|
4205
|
-
* @param message The message to be sent
|
|
4206
|
-
* @param messageNamespace The message namespace to be used, in case of null the default message namespace will be used
|
|
4207
|
-
* @returns A promise that resolves when the message was sent successfully
|
|
4208
|
-
*/
|
|
4209
|
-
sendMessage: (message: String, messageNamespace?: String | null) => any;
|
|
4210
|
-
};
|
|
4211
|
-
|
|
4212
|
-
/**
|
|
4213
|
-
* Represents a native Network configuration object.
|
|
4214
|
-
* @internal
|
|
4215
|
-
*/
|
|
4216
|
-
declare class Network extends NativeInstance<NetworkConfig> {
|
|
4217
|
-
/**
|
|
4218
|
-
* Whether this object's native instance has been created.
|
|
4219
|
-
*/
|
|
4220
|
-
isInitialized: boolean;
|
|
4221
|
-
/**
|
|
4222
|
-
* Whether this object's native instance has been disposed.
|
|
4223
|
-
*/
|
|
4224
|
-
isDestroyed: boolean;
|
|
4225
|
-
/**
|
|
4226
|
-
* Allocates the Network config instance and its resources natively.
|
|
4227
|
-
*/
|
|
4228
|
-
initialize: () => void;
|
|
4229
|
-
/**
|
|
4230
|
-
* Destroys the native Network config and releases all of its allocated resources.
|
|
4231
|
-
*/
|
|
4232
|
-
destroy: () => void;
|
|
4233
|
-
/**
|
|
4234
|
-
* Applies the user-defined `preprocessHttpRequest` function to native's `type` and `request` data and store
|
|
4235
|
-
* the result back in `NetworkModule`.
|
|
4236
|
-
*
|
|
4237
|
-
* Called from native code when `NetworkConfig.preprocessHttpRequest` is dispatched.
|
|
4238
|
-
*
|
|
4239
|
-
* @param requestId Passed through to identify the completion handler of the request on native.
|
|
4240
|
-
* @param type Type of the request to be made.
|
|
4241
|
-
* @param request The HTTP request to process.
|
|
4242
|
-
*/
|
|
4243
|
-
onPreprocessHttpRequest: (requestId: string, type: HttpRequestType, request: HttpRequest) => void;
|
|
4244
|
-
/**
|
|
4245
|
-
* Applies the user-defined `preprocessHttpResponse` function to native's `type` and `response` data and store
|
|
4246
|
-
* the result back in `NetworkModule`.
|
|
4247
|
-
*
|
|
4248
|
-
* Called from native code when `NetworkConfig.preprocessHttpResponse` is dispatched.
|
|
4249
|
-
*
|
|
4250
|
-
* @param responseId Passed through to identify the completion handler of the response on native.
|
|
4251
|
-
* @param type Type of the request to be made.
|
|
4252
|
-
* @param response The HTTP response to process.
|
|
4253
|
-
*/
|
|
4254
|
-
onPreprocessHttpResponse: (responseId: string, type: HttpRequestType, response: HttpResponse) => void;
|
|
4255
|
-
}
|
|
4256
|
-
|
|
4257
|
-
/**
|
|
4258
|
-
* Global debug configuration for all Bitmovin components.
|
|
4259
|
-
*/
|
|
4260
|
-
declare class DebugConfig {
|
|
4261
|
-
private static _isDebugEnabled;
|
|
4262
|
-
/**
|
|
4263
|
-
* Retrieves the current debug logging state.
|
|
4264
|
-
*
|
|
4265
|
-
* @returns `true` if debug logging is enabled, otherwise `false`.
|
|
4266
|
-
*/
|
|
4267
|
-
static get isDebugLoggingEnabled(): boolean;
|
|
4268
|
-
/**
|
|
4269
|
-
* Enables or disables global debug logging for all Bitmovin components.
|
|
4270
|
-
*
|
|
4271
|
-
* Debug logging provides detailed information primarily for debugging purposes,
|
|
4272
|
-
* helping to diagnose problems and trace the flow of execution within the Player.
|
|
4273
|
-
*
|
|
4274
|
-
* ### Warning:
|
|
4275
|
-
* This option **should not be enabled in production** as it may log sensitive or confidential
|
|
4276
|
-
* information to the console.
|
|
4277
|
-
*
|
|
4278
|
-
* ## Platform-Specific Logging Behavior
|
|
4279
|
-
* ---
|
|
4280
|
-
* - **iOS:** logs are printed using `NSLog` at the verbose log level.
|
|
4281
|
-
* - **Android:** logs are printed using `android.util.Log` with the following tags:
|
|
4282
|
-
* - `BitmovinPlayer`
|
|
4283
|
-
* - `BitmovinPlayerView`
|
|
4284
|
-
* - `BitmovinOffline`
|
|
4285
|
-
* - `BitmovinSource`
|
|
4286
|
-
* - `BitmovinExoPlayer`
|
|
4287
|
-
*
|
|
4288
|
-
* ## Limitations
|
|
4289
|
-
* ---
|
|
4290
|
-
* **Android**
|
|
4291
|
-
* - This flag **must** be set **before** creating any Bitmovin component to take effect.
|
|
4292
|
-
*
|
|
4293
|
-
* ## Usage Notes
|
|
4294
|
-
* ---
|
|
4295
|
-
* - We recommend setting this flag during your app's initialization phase, such as in the
|
|
4296
|
-
* application's entry point (e.g. `App.tsx`).
|
|
4297
|
-
*
|
|
4298
|
-
* @defaultValue `false`
|
|
4299
|
-
*/
|
|
4300
|
-
static setDebugLoggingEnabled(value: boolean): Promise<void>;
|
|
4301
|
-
}
|
|
4302
|
-
|
|
4303
|
-
export { Ad, AdBreak, AdBreakFinishedEvent, AdBreakStartedEvent, AdClickedEvent, AdConfig, AdData, AdErrorEvent, AdFinishedEvent, AdItem, AdManifestLoadEvent, AdManifestLoadedEvent, AdQuartile, AdQuartileEvent, AdScheduledEvent, AdSkippedEvent, AdSource, AdSourceType, AdStartedEvent, AdaptationConfig, AdvertisingConfig, AnalyticsApi, AnalyticsConfig, AudioAddedEvent, AudioChangedEvent, AudioQuality, AudioRemovedEvent, AudioSession, AudioSessionCategory, AudioTrack, BasePlayerViewProps, BitmovinCastManager, BitmovinCastManagerOptions, BitmovinNativeOfflineEventData, BufferApi, BufferConfig, BufferLevel, BufferLevels, BufferMediaTypeConfig, BufferType, CastAvailableEvent, CastPausedEvent, CastPayload, CastPlaybackFinishedEvent, CastPlayingEvent, CastStartEvent, CastStartedEvent, CastStoppedEvent, CastTimeUpdatedEvent, CastWaitingForDeviceEvent, CueEnterEvent, CueExitEvent, CustomDataConfig, CustomMessageHandler, CustomMessageHandlerProps, CustomUi, DebugConfig, DecoderConfig, DecoderContext, DecoderContextMediaType, DecoderPriorityProvider, DefaultMetadata, DestroyEvent, DownloadFinishedEvent, Drm, DrmConfig, ErrorEvent, Event, EventSource, FairplayConfig, ForceReuseVideoCodecReason, FullscreenDisabledEvent, FullscreenEnabledEvent, FullscreenEnterEvent, FullscreenExitEvent, FullscreenHandler, HttpRequest, HttpRequestType, HttpResponse, LiveConfig, LoadingState, MediaCodecInfo, MediaControlConfig, MediaTrackRole, MediaType, MutedEvent, Network, NetworkConfig, OfflineContentConfig, OfflineContentManager, OfflineContentManagerListener, OfflineContentOptionEntry, OfflineContentOptions, OfflineDownloadRequest, OfflineEvent, OfflineEventType, OfflineSourceOptions, OfflineState, OnCanceledEvent, OnCompletedEvent, OnDrmLicenseExpiredEvent, OnDrmLicenseUpdatedEvent, OnErrorEvent, OnOptionsAvailableEvent, OnProgressEvent, OnResumedEvent, OnSuspendedEvent, PausedEvent, PictureInPictureAvailabilityChangedEvent, PictureInPictureConfig, PictureInPictureEnterEvent, PictureInPictureEnteredEvent, PictureInPictureExitEvent, PictureInPictureExitedEvent, PlayEvent, PlaybackConfig, PlaybackFinishedEvent, PlaybackSpeedChangedEvent, Player, PlayerActiveEvent, PlayerConfig, PlayerErrorEvent, PlayerView, PlayerViewConfig, PlayerViewProps, PlayerWarningEvent, PlayingEvent, ReadyEvent, RemoteControlConfig, ScalingMode, SeekEvent, SeekPosition, SeekedEvent, SideLoadedSubtitleTrack, SmallScreenUi, Source, SourceConfig, SourceErrorEvent, SourceLoadEvent, SourceLoadedEvent, SourceMetadata, SourceOptions, SourceRemoteControlConfig, SourceType, SourceUnloadedEvent, SourceWarningEvent, StallEndedEvent, StallStartedEvent, StyleConfig, SubtitleAddedEvent, SubtitleChangedEvent, SubtitleFormat, SubtitleRemovedEvent, SubtitleTrack, SurfaceType, Thumbnail, TimeChangedEvent, TimeShiftEvent, TimeShiftedEvent, TimelineReferencePoint, TvUi, TweaksConfig, UiConfig, UnmutedEvent, UserInterfaceType, Variant, VideoDownloadQualityChangedEvent, VideoPlaybackQualityChangedEvent, VideoQuality, WebUiConfig, WidevineConfig, usePlayer };
|