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
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Provides options to configure Picture in Picture playback.
|
|
3
|
+
*/
|
|
4
|
+
export interface PictureInPictureConfig {
|
|
5
|
+
/**
|
|
6
|
+
* Whether Picture in Picture feature is enabled or not.
|
|
7
|
+
*
|
|
8
|
+
* Default is `false`.
|
|
9
|
+
*/
|
|
10
|
+
isEnabled?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Defines whether Picture in Picture should start automatically when the app transitions to background.
|
|
13
|
+
*
|
|
14
|
+
* Does not have any affect when Picture in Picture is disabled.
|
|
15
|
+
*
|
|
16
|
+
* Default is `false`.
|
|
17
|
+
*
|
|
18
|
+
* @remarks Platform: iOS 14.2 and above
|
|
19
|
+
*/
|
|
20
|
+
shouldEnterOnBackground?: boolean;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=pictureInPictureConfig.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pictureInPictureConfig.d.ts","sourceRoot":"","sources":["../../../src/components/PlayerView/pictureInPictureConfig.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;;;;;;;OAQG;IACH,uBAAuB,CAAC,EAAE,OAAO,CAAC;CACnC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pictureInPictureConfig.js","sourceRoot":"","sources":["../../../src/components/PlayerView/pictureInPictureConfig.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Provides options to configure Picture in Picture playback.\n */\nexport interface PictureInPictureConfig {\n /**\n * Whether Picture in Picture feature is enabled or not.\n *\n * Default is `false`.\n */\n isEnabled?: boolean;\n\n /**\n * Defines whether Picture in Picture should start automatically when the app transitions to background.\n *\n * Does not have any affect when Picture in Picture is disabled.\n *\n * Default is `false`.\n *\n * @remarks Platform: iOS 14.2 and above\n */\n shouldEnterOnBackground?: boolean;\n}\n"]}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { PictureInPictureConfig } from './pictureInPictureConfig';
|
|
2
|
+
/**
|
|
3
|
+
* Configures the visual presentation and behaviour of the `PlayerView`.
|
|
4
|
+
*/
|
|
5
|
+
export interface PlayerViewConfig {
|
|
6
|
+
/**
|
|
7
|
+
* Configures the visual presentation and behaviour of the Bitmovin Player UI.
|
|
8
|
+
* A {@link WebUiConfig} can be used to configure the default Bitmovin Player Web UI.
|
|
9
|
+
*
|
|
10
|
+
* Default is {@link WebUiConfig}.
|
|
11
|
+
*
|
|
12
|
+
* Limitations:
|
|
13
|
+
* Configuring the `uiConfig` only has an effect if the {@link StyleConfig.userInterfaceType} is set to {@link UserInterfaceType.Bitmovin}.
|
|
14
|
+
*/
|
|
15
|
+
uiConfig?: UiConfig;
|
|
16
|
+
/**
|
|
17
|
+
* Provides options to configure Picture in Picture playback.
|
|
18
|
+
*/
|
|
19
|
+
pictureInPictureConfig?: PictureInPictureConfig;
|
|
20
|
+
/**
|
|
21
|
+
* When set to `true`, the first frame of the main content will not be rendered before playback starts. Default is `false`.
|
|
22
|
+
* This configuration has no effect for the {@link UserInterfaceType.Subtitle} on iOS/tvOS.
|
|
23
|
+
*
|
|
24
|
+
* 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.
|
|
25
|
+
*/
|
|
26
|
+
hideFirstFrame?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Specify on which surface type the video should be rendered.
|
|
29
|
+
*
|
|
30
|
+
* See {@link https://developer.android.com/guide/topics/media/ui/playerview#surfacetype|Choosing a surface type}
|
|
31
|
+
* for more information.
|
|
32
|
+
*
|
|
33
|
+
* Default is {@link SurfaceType.SurfaceView}.
|
|
34
|
+
*
|
|
35
|
+
* @remarks Platform: Android
|
|
36
|
+
*/
|
|
37
|
+
surfaceType?: SurfaceType;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Configures the visual presentation and behaviour of the Bitmovin Player UI.
|
|
41
|
+
*/
|
|
42
|
+
export type UiConfig = object;
|
|
43
|
+
/**
|
|
44
|
+
* Configures the visual presentation and behaviour of the Bitmovin Web UI.
|
|
45
|
+
*/
|
|
46
|
+
export interface WebUiConfig extends UiConfig {
|
|
47
|
+
/**
|
|
48
|
+
* Whether the Bitmovin Web UI will show playback speed selection options in the settings menu.
|
|
49
|
+
* Default is `true`.
|
|
50
|
+
*/
|
|
51
|
+
playbackSpeedSelectionEnabled?: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* The UI variant to use for the Bitmovin Player Web UI.
|
|
54
|
+
*
|
|
55
|
+
* Default is {@link SmallScreenUi}
|
|
56
|
+
*/
|
|
57
|
+
variant?: Variant;
|
|
58
|
+
/**
|
|
59
|
+
* Whether the WebView should be focused on initialization.
|
|
60
|
+
*
|
|
61
|
+
* By default this is enabled only for the TV UI variant, as it's needed there to
|
|
62
|
+
* initiate spatial navigation using the remote control.
|
|
63
|
+
*
|
|
64
|
+
* @remarks Platform: Android
|
|
65
|
+
*/
|
|
66
|
+
focusUiOnInitialization?: boolean;
|
|
67
|
+
}
|
|
68
|
+
export declare abstract class Variant {
|
|
69
|
+
readonly uiManagerFactoryFunction: string;
|
|
70
|
+
/**
|
|
71
|
+
* Specifies the function name that will be used to initialize the `UIManager`
|
|
72
|
+
* for the Bitmovin Player Web UI.
|
|
73
|
+
*
|
|
74
|
+
* The function is called on the `window` object with the `Player` as the first argument and
|
|
75
|
+
* the `UIConfig` as the second argument.
|
|
76
|
+
*
|
|
77
|
+
* Example:
|
|
78
|
+
* When you added a new function or want to use a different function of our `UIFactory`,
|
|
79
|
+
* you can specify the full qualifier name including namespaces.
|
|
80
|
+
* e.g. `bitmovin.playerui.UIFactory.buildDefaultSmallScreenUI` for the SmallScreenUi.
|
|
81
|
+
* @see UIFactory https://github.com/bitmovin/bitmovin-player-ui/blob/develop/src/ts/uifactory.ts#L60
|
|
82
|
+
*
|
|
83
|
+
* Notes:
|
|
84
|
+
* - It's not necessary to use our `UIFactory`. Any static function can be specified.
|
|
85
|
+
*/
|
|
86
|
+
constructor(uiManagerFactoryFunction: string);
|
|
87
|
+
}
|
|
88
|
+
export declare class SmallScreenUi extends Variant {
|
|
89
|
+
constructor();
|
|
90
|
+
}
|
|
91
|
+
export declare class TvUi extends Variant {
|
|
92
|
+
constructor();
|
|
93
|
+
}
|
|
94
|
+
export declare class CustomUi extends Variant {
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* The type of surface on which to render video.
|
|
98
|
+
*
|
|
99
|
+
* See {@link https://developer.android.com/guide/topics/media/ui/playerview#surfacetype|Choosing a surface type}
|
|
100
|
+
* for more information.
|
|
101
|
+
*/
|
|
102
|
+
export declare enum SurfaceType {
|
|
103
|
+
/**
|
|
104
|
+
* SurfaceView generally causes lower battery consumption,
|
|
105
|
+
* and has better handling for HDR and secure content.
|
|
106
|
+
*/
|
|
107
|
+
SurfaceView = "SurfaceView",
|
|
108
|
+
/** TextureView is sometime needed for smooth animations. */
|
|
109
|
+
TextureView = "TextureView"
|
|
110
|
+
}
|
|
111
|
+
//# sourceMappingURL=playerViewConfig.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"playerViewConfig.d.ts","sourceRoot":"","sources":["../../../src/components/PlayerView/playerViewConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAElE;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;;;;;;OAQG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAC;IAEpB;;OAEG;IACH,sBAAsB,CAAC,EAAE,sBAAsB,CAAC;IAEhD;;;;;OAKG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IAEzB;;;;;;;;;OASG;IACH,WAAW,CAAC,EAAE,WAAW,CAAC;CAC3B;AAED;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC;AAE9B;;GAEG;AACH,MAAM,WAAW,WAAY,SAAQ,QAAQ;IAC3C;;;OAGG;IACH,6BAA6B,CAAC,EAAE,OAAO,CAAC;IACxC;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;;;;OAOG;IACH,uBAAuB,CAAC,EAAE,OAAO,CAAC;CACnC;AAED,8BAAsB,OAAO;aAiBC,wBAAwB,EAAE,MAAM;IAhB5D;;;;;;;;;;;;;;;OAeG;gBACyB,wBAAwB,EAAE,MAAM;CAC7D;AAED,qBAAa,aAAc,SAAQ,OAAO;;CAIzC;AAED,qBAAa,IAAK,SAAQ,OAAO;;CAIhC;AAED,qBAAa,QAAS,SAAQ,OAAO;CAAG;AAExC;;;;;GAKG;AACH,oBAAY,WAAW;IACrB;;;OAGG;IACH,WAAW,gBAAgB;IAC3B,4DAA4D;IAC5D,WAAW,gBAAgB;CAC5B"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
export class Variant {
|
|
2
|
+
uiManagerFactoryFunction;
|
|
3
|
+
/**
|
|
4
|
+
* Specifies the function name that will be used to initialize the `UIManager`
|
|
5
|
+
* for the Bitmovin Player Web UI.
|
|
6
|
+
*
|
|
7
|
+
* The function is called on the `window` object with the `Player` as the first argument and
|
|
8
|
+
* the `UIConfig` as the second argument.
|
|
9
|
+
*
|
|
10
|
+
* Example:
|
|
11
|
+
* When you added a new function or want to use a different function of our `UIFactory`,
|
|
12
|
+
* you can specify the full qualifier name including namespaces.
|
|
13
|
+
* e.g. `bitmovin.playerui.UIFactory.buildDefaultSmallScreenUI` for the SmallScreenUi.
|
|
14
|
+
* @see UIFactory https://github.com/bitmovin/bitmovin-player-ui/blob/develop/src/ts/uifactory.ts#L60
|
|
15
|
+
*
|
|
16
|
+
* Notes:
|
|
17
|
+
* - It's not necessary to use our `UIFactory`. Any static function can be specified.
|
|
18
|
+
*/
|
|
19
|
+
constructor(uiManagerFactoryFunction) {
|
|
20
|
+
this.uiManagerFactoryFunction = uiManagerFactoryFunction;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
export class SmallScreenUi extends Variant {
|
|
24
|
+
constructor() {
|
|
25
|
+
super('bitmovin.playerui.UIFactory.buildDefaultSmallScreenUI');
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
export class TvUi extends Variant {
|
|
29
|
+
constructor() {
|
|
30
|
+
super('bitmovin.playerui.UIFactory.buildDefaultTvUI');
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
export class CustomUi extends Variant {
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* The type of surface on which to render video.
|
|
37
|
+
*
|
|
38
|
+
* See {@link https://developer.android.com/guide/topics/media/ui/playerview#surfacetype|Choosing a surface type}
|
|
39
|
+
* for more information.
|
|
40
|
+
*/
|
|
41
|
+
export var SurfaceType;
|
|
42
|
+
(function (SurfaceType) {
|
|
43
|
+
/**
|
|
44
|
+
* SurfaceView generally causes lower battery consumption,
|
|
45
|
+
* and has better handling for HDR and secure content.
|
|
46
|
+
*/
|
|
47
|
+
SurfaceType["SurfaceView"] = "SurfaceView";
|
|
48
|
+
/** TextureView is sometime needed for smooth animations. */
|
|
49
|
+
SurfaceType["TextureView"] = "TextureView";
|
|
50
|
+
})(SurfaceType || (SurfaceType = {}));
|
|
51
|
+
//# sourceMappingURL=playerViewConfig.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"playerViewConfig.js","sourceRoot":"","sources":["../../../src/components/PlayerView/playerViewConfig.ts"],"names":[],"mappings":"AA0EA,MAAM,OAAgB,OAAO;IAiBC;IAhB5B;;;;;;;;;;;;;;;OAeG;IACH,YAA4B,wBAAgC;QAAhC,6BAAwB,GAAxB,wBAAwB,CAAQ;IAAG,CAAC;CACjE;AAED,MAAM,OAAO,aAAc,SAAQ,OAAO;IACxC;QACE,KAAK,CAAC,uDAAuD,CAAC,CAAC;IACjE,CAAC;CACF;AAED,MAAM,OAAO,IAAK,SAAQ,OAAO;IAC/B;QACE,KAAK,CAAC,8CAA8C,CAAC,CAAC;IACxD,CAAC;CACF;AAED,MAAM,OAAO,QAAS,SAAQ,OAAO;CAAG;AAExC;;;;;GAKG;AACH,MAAM,CAAN,IAAY,WAQX;AARD,WAAY,WAAW;IACrB;;;OAGG;IACH,0CAA2B,CAAA;IAC3B,4DAA4D;IAC5D,0CAA2B,CAAA;AAC7B,CAAC,EARW,WAAW,KAAX,WAAW,QAQtB","sourcesContent":["import { PictureInPictureConfig } from './pictureInPictureConfig';\n\n/**\n * Configures the visual presentation and behaviour of the `PlayerView`.\n */\nexport interface PlayerViewConfig {\n /**\n * Configures the visual presentation and behaviour of the Bitmovin Player UI.\n * A {@link WebUiConfig} can be used to configure the default Bitmovin Player Web UI.\n *\n * Default is {@link WebUiConfig}.\n *\n * Limitations:\n * Configuring the `uiConfig` only has an effect if the {@link StyleConfig.userInterfaceType} is set to {@link UserInterfaceType.Bitmovin}.\n */\n uiConfig?: UiConfig;\n\n /**\n * Provides options to configure Picture in Picture playback.\n */\n pictureInPictureConfig?: PictureInPictureConfig;\n\n /**\n * When set to `true`, the first frame of the main content will not be rendered before playback starts. Default is `false`.\n * This configuration has no effect for the {@link UserInterfaceType.Subtitle} on iOS/tvOS.\n *\n * 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.\n */\n hideFirstFrame?: boolean;\n\n /**\n * Specify on which surface type the video should be rendered.\n *\n * See {@link https://developer.android.com/guide/topics/media/ui/playerview#surfacetype|Choosing a surface type}\n * for more information.\n *\n * Default is {@link SurfaceType.SurfaceView}.\n *\n * @remarks Platform: Android\n */\n surfaceType?: SurfaceType;\n}\n\n/**\n * Configures the visual presentation and behaviour of the Bitmovin Player UI.\n */\nexport type UiConfig = object;\n\n/**\n * Configures the visual presentation and behaviour of the Bitmovin Web UI.\n */\nexport interface WebUiConfig extends UiConfig {\n /**\n * Whether the Bitmovin Web UI will show playback speed selection options in the settings menu.\n * Default is `true`.\n */\n playbackSpeedSelectionEnabled?: boolean;\n /**\n * The UI variant to use for the Bitmovin Player Web UI.\n *\n * Default is {@link SmallScreenUi}\n */\n variant?: Variant;\n /**\n * Whether the WebView should be focused on initialization.\n *\n * By default this is enabled only for the TV UI variant, as it's needed there to\n * initiate spatial navigation using the remote control.\n *\n * @remarks Platform: Android\n */\n focusUiOnInitialization?: boolean;\n}\n\nexport abstract class Variant {\n /**\n * Specifies the function name that will be used to initialize the `UIManager`\n * for the Bitmovin Player Web UI.\n *\n * The function is called on the `window` object with the `Player` as the first argument and\n * the `UIConfig` as the second argument.\n *\n * Example:\n * When you added a new function or want to use a different function of our `UIFactory`,\n * you can specify the full qualifier name including namespaces.\n * e.g. `bitmovin.playerui.UIFactory.buildDefaultSmallScreenUI` for the SmallScreenUi.\n * @see UIFactory https://github.com/bitmovin/bitmovin-player-ui/blob/develop/src/ts/uifactory.ts#L60\n *\n * Notes:\n * - It's not necessary to use our `UIFactory`. Any static function can be specified.\n */\n constructor(public readonly uiManagerFactoryFunction: string) {}\n}\n\nexport class SmallScreenUi extends Variant {\n constructor() {\n super('bitmovin.playerui.UIFactory.buildDefaultSmallScreenUI');\n }\n}\n\nexport class TvUi extends Variant {\n constructor() {\n super('bitmovin.playerui.UIFactory.buildDefaultTvUI');\n }\n}\n\nexport class CustomUi extends Variant {}\n\n/**\n * The type of surface on which to render video.\n *\n * See {@link https://developer.android.com/guide/topics/media/ui/playerview#surfacetype|Choosing a surface type}\n * for more information.\n */\nexport enum SurfaceType {\n /**\n * SurfaceView generally causes lower battery consumption,\n * and has better handling for HDR and secure content.\n */\n SurfaceView = 'SurfaceView',\n /** TextureView is sometime needed for smooth animations. */\n TextureView = 'TextureView',\n}\n"]}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { PlayerViewEvents } from './events';
|
|
2
|
+
import { Player } from '../../player';
|
|
3
|
+
import { FullscreenHandler, CustomMessageHandler } from '../../ui';
|
|
4
|
+
import { ScalingMode } from '../../styleConfig';
|
|
5
|
+
import { ViewStyle } from 'react-native';
|
|
6
|
+
import { PlayerViewConfig } from './playerViewConfig';
|
|
7
|
+
/**
|
|
8
|
+
* Base `PlayerView` component props.
|
|
9
|
+
* Used to establish common props between `NativePlayerView` and {@link PlayerView}.
|
|
10
|
+
*/
|
|
11
|
+
export interface BasePlayerViewProps {
|
|
12
|
+
ref?: React.RefObject<null>;
|
|
13
|
+
/**
|
|
14
|
+
* The {@link FullscreenHandler} that is used by the {@link PlayerView} to control the fullscreen mode.
|
|
15
|
+
*/
|
|
16
|
+
fullscreenHandler?: FullscreenHandler;
|
|
17
|
+
/**
|
|
18
|
+
* The {@link CustomMessageHandler} that can be used to directly communicate with the embedded Bitmovin Web UI.
|
|
19
|
+
*/
|
|
20
|
+
customMessageHandler?: CustomMessageHandler;
|
|
21
|
+
/**
|
|
22
|
+
* Can be set to `true` to request fullscreen mode, or `false` to request exit of fullscreen mode.
|
|
23
|
+
* Should not be used to get the current fullscreen state. Use {@link PlayerViewEvents.onFullscreenEnter} and {@link PlayerViewEvents.onFullscreenExit}
|
|
24
|
+
* or the {@link FullscreenHandler.isFullscreenActive} property to get the current state.
|
|
25
|
+
* Using this property to change the fullscreen state, it is ensured that the embedded Player UI is also aware
|
|
26
|
+
* of potential fullscreen state changes.
|
|
27
|
+
* To use this property, a {@link FullscreenHandler} must be set.
|
|
28
|
+
*/
|
|
29
|
+
isFullscreenRequested?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* A value defining how the video is displayed within the parent container's bounds.
|
|
32
|
+
* Possible values are defined in {@link ScalingMode}.
|
|
33
|
+
*/
|
|
34
|
+
scalingMode?: ScalingMode;
|
|
35
|
+
/**
|
|
36
|
+
* Can be set to `true` to request Picture in Picture mode, or `false` to request exit of Picture in Picture mode.
|
|
37
|
+
* Should not be used to get the current Picture in Picture state. Use {@link PlayerViewEvents.onPictureInPictureEnter} and {@link PlayerViewEvents.onPictureInPictureExit}.
|
|
38
|
+
*/
|
|
39
|
+
isPictureInPictureRequested?: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Style of the {@link PlayerView}.
|
|
42
|
+
*/
|
|
43
|
+
style?: ViewStyle;
|
|
44
|
+
/**
|
|
45
|
+
* Configures the visual presentation and behaviour of the {@link PlayerView}.
|
|
46
|
+
* The value must not be altered after setting it initially.
|
|
47
|
+
*/
|
|
48
|
+
config?: PlayerViewConfig;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* {@link PlayerView} component props.
|
|
52
|
+
*/
|
|
53
|
+
export interface PlayerViewProps extends BasePlayerViewProps, PlayerViewEvents {
|
|
54
|
+
viewRef?: React.MutableRefObject<null>;
|
|
55
|
+
/**
|
|
56
|
+
* {@link Player} instance (generally returned from {@link usePlayer} hook) that will control
|
|
57
|
+
* and render audio/video inside the {@link PlayerView}.
|
|
58
|
+
*/
|
|
59
|
+
player: Player;
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=properties.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"properties.d.ts","sourceRoot":"","sources":["../../../src/components/PlayerView/properties.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AACnE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC,GAAG,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IAC5B;;OAEG;IACH,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IAEtC;;OAEG;IACH,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;IAE5C;;;;;;;OAOG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAEhC;;;OAGG;IACH,WAAW,CAAC,EAAE,WAAW,CAAC;IAE1B;;;OAGG;IACH,2BAA2B,CAAC,EAAE,OAAO,CAAC;IAEtC;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAElB;;;OAGG;IACH,MAAM,CAAC,EAAE,gBAAgB,CAAC;CAC3B;AAED;;GAEG;AACH,MAAM,WAAW,eAAgB,SAAQ,mBAAmB,EAAE,gBAAgB;IAC5E,OAAO,CAAC,EAAE,KAAK,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC;IACvC;;;OAGG;IACH,MAAM,EAAE,MAAM,CAAC;CAChB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"properties.js","sourceRoot":"","sources":["../../../src/components/PlayerView/properties.ts"],"names":[],"mappings":"","sourcesContent":["import { PlayerViewEvents } from './events';\nimport { Player } from '../../player';\nimport { FullscreenHandler, CustomMessageHandler } from '../../ui';\nimport { ScalingMode } from '../../styleConfig';\nimport { ViewStyle } from 'react-native';\nimport { PlayerViewConfig } from './playerViewConfig';\n\n/**\n * Base `PlayerView` component props.\n * Used to establish common props between `NativePlayerView` and {@link PlayerView}.\n */\nexport interface BasePlayerViewProps {\n ref?: React.RefObject<null>;\n /**\n * The {@link FullscreenHandler} that is used by the {@link PlayerView} to control the fullscreen mode.\n */\n fullscreenHandler?: FullscreenHandler;\n\n /**\n * The {@link CustomMessageHandler} that can be used to directly communicate with the embedded Bitmovin Web UI.\n */\n customMessageHandler?: CustomMessageHandler;\n\n /**\n * Can be set to `true` to request fullscreen mode, or `false` to request exit of fullscreen mode.\n * Should not be used to get the current fullscreen state. Use {@link PlayerViewEvents.onFullscreenEnter} and {@link PlayerViewEvents.onFullscreenExit}\n * or the {@link FullscreenHandler.isFullscreenActive} property to get the current state.\n * Using this property to change the fullscreen state, it is ensured that the embedded Player UI is also aware\n * of potential fullscreen state changes.\n * To use this property, a {@link FullscreenHandler} must be set.\n */\n isFullscreenRequested?: boolean;\n\n /**\n * A value defining how the video is displayed within the parent container's bounds.\n * Possible values are defined in {@link ScalingMode}.\n */\n scalingMode?: ScalingMode;\n\n /**\n * Can be set to `true` to request Picture in Picture mode, or `false` to request exit of Picture in Picture mode.\n * Should not be used to get the current Picture in Picture state. Use {@link PlayerViewEvents.onPictureInPictureEnter} and {@link PlayerViewEvents.onPictureInPictureExit}.\n */\n isPictureInPictureRequested?: boolean;\n\n /**\n * Style of the {@link PlayerView}.\n */\n style?: ViewStyle;\n\n /**\n * Configures the visual presentation and behaviour of the {@link PlayerView}.\n * The value must not be altered after setting it initially.\n */\n config?: PlayerViewConfig;\n}\n\n/**\n * {@link PlayerView} component props.\n */\nexport interface PlayerViewProps extends BasePlayerViewProps, PlayerViewEvents {\n viewRef?: React.MutableRefObject<null>;\n /**\n * {@link Player} instance (generally returned from {@link usePlayer} hook) that will control\n * and render audio/video inside the {@link PlayerView}.\n */\n player: Player;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,qCAAqC,CAAC;AACpD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,yBAAyB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,qCAAqC,CAAC;AACpD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,yBAAyB,CAAC","sourcesContent":["export * from './PlayerView';\nexport * from './PlayerView/pictureInPictureConfig';\nexport * from './PlayerView/playerViewConfig';\nexport * from './PlayerView/properties';\n"]}
|
package/build/debug.d.ts
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Global debug configuration for all Bitmovin components.
|
|
3
|
+
*/
|
|
4
|
+
export declare class DebugConfig {
|
|
5
|
+
private static _isDebugEnabled;
|
|
6
|
+
/**
|
|
7
|
+
* Retrieves the current debug logging state.
|
|
8
|
+
*
|
|
9
|
+
* @returns `true` if debug logging is enabled, otherwise `false`.
|
|
10
|
+
*/
|
|
11
|
+
static get isDebugLoggingEnabled(): boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Enables or disables global debug logging for all Bitmovin components.
|
|
14
|
+
*
|
|
15
|
+
* Debug logging provides detailed information primarily for debugging purposes,
|
|
16
|
+
* helping to diagnose problems and trace the flow of execution within the Player.
|
|
17
|
+
*
|
|
18
|
+
* ### Warning:
|
|
19
|
+
* This option **should not be enabled in production** as it may log sensitive or confidential
|
|
20
|
+
* information to the console.
|
|
21
|
+
*
|
|
22
|
+
* ## Platform-Specific Logging Behavior
|
|
23
|
+
* ---
|
|
24
|
+
* - **iOS:** logs are printed using `NSLog` at the verbose log level.
|
|
25
|
+
* - **Android:** logs are printed using `android.util.Log` with the following tags:
|
|
26
|
+
* - `BitmovinPlayer`
|
|
27
|
+
* - `BitmovinPlayerView`
|
|
28
|
+
* - `BitmovinOffline`
|
|
29
|
+
* - `BitmovinSource`
|
|
30
|
+
* - `BitmovinExoPlayer`
|
|
31
|
+
*
|
|
32
|
+
* ## Limitations
|
|
33
|
+
* ---
|
|
34
|
+
* **Android**
|
|
35
|
+
* - This flag **must** be set **before** creating any Bitmovin component to take effect.
|
|
36
|
+
*
|
|
37
|
+
* ## Usage Notes
|
|
38
|
+
* ---
|
|
39
|
+
* - We recommend setting this flag during your app's initialization phase, such as in the
|
|
40
|
+
* application's entry point (e.g. `App.tsx`).
|
|
41
|
+
*
|
|
42
|
+
* @defaultValue `false`
|
|
43
|
+
*/
|
|
44
|
+
static setDebugLoggingEnabled(value: boolean): Promise<void>;
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=debug.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debug.d.ts","sourceRoot":"","sources":["../src/debug.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,qBAAa,WAAW;IACtB,OAAO,CAAC,MAAM,CAAC,eAAe,CAAS;IAEvC;;;;OAIG;IACH,MAAM,KAAK,qBAAqB,IAAI,OAAO,CAE1C;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA+BG;WACU,sBAAsB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;CAInE"}
|
package/build/debug.js
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import DebugModule from './modules/DebugModule';
|
|
2
|
+
/**
|
|
3
|
+
* Global debug configuration for all Bitmovin components.
|
|
4
|
+
*/
|
|
5
|
+
export class DebugConfig {
|
|
6
|
+
static _isDebugEnabled = false;
|
|
7
|
+
/**
|
|
8
|
+
* Retrieves the current debug logging state.
|
|
9
|
+
*
|
|
10
|
+
* @returns `true` if debug logging is enabled, otherwise `false`.
|
|
11
|
+
*/
|
|
12
|
+
static get isDebugLoggingEnabled() {
|
|
13
|
+
return DebugConfig._isDebugEnabled;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Enables or disables global debug logging for all Bitmovin components.
|
|
17
|
+
*
|
|
18
|
+
* Debug logging provides detailed information primarily for debugging purposes,
|
|
19
|
+
* helping to diagnose problems and trace the flow of execution within the Player.
|
|
20
|
+
*
|
|
21
|
+
* ### Warning:
|
|
22
|
+
* This option **should not be enabled in production** as it may log sensitive or confidential
|
|
23
|
+
* information to the console.
|
|
24
|
+
*
|
|
25
|
+
* ## Platform-Specific Logging Behavior
|
|
26
|
+
* ---
|
|
27
|
+
* - **iOS:** logs are printed using `NSLog` at the verbose log level.
|
|
28
|
+
* - **Android:** logs are printed using `android.util.Log` with the following tags:
|
|
29
|
+
* - `BitmovinPlayer`
|
|
30
|
+
* - `BitmovinPlayerView`
|
|
31
|
+
* - `BitmovinOffline`
|
|
32
|
+
* - `BitmovinSource`
|
|
33
|
+
* - `BitmovinExoPlayer`
|
|
34
|
+
*
|
|
35
|
+
* ## Limitations
|
|
36
|
+
* ---
|
|
37
|
+
* **Android**
|
|
38
|
+
* - This flag **must** be set **before** creating any Bitmovin component to take effect.
|
|
39
|
+
*
|
|
40
|
+
* ## Usage Notes
|
|
41
|
+
* ---
|
|
42
|
+
* - We recommend setting this flag during your app's initialization phase, such as in the
|
|
43
|
+
* application's entry point (e.g. `App.tsx`).
|
|
44
|
+
*
|
|
45
|
+
* @defaultValue `false`
|
|
46
|
+
*/
|
|
47
|
+
static async setDebugLoggingEnabled(value) {
|
|
48
|
+
DebugConfig._isDebugEnabled = value;
|
|
49
|
+
await DebugModule.setDebugLoggingEnabled(value);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=debug.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debug.js","sourceRoot":"","sources":["../src/debug.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,uBAAuB,CAAC;AAEhD;;GAEG;AACH,MAAM,OAAO,WAAW;IACd,MAAM,CAAC,eAAe,GAAG,KAAK,CAAC;IAEvC;;;;OAIG;IACH,MAAM,KAAK,qBAAqB;QAC9B,OAAO,WAAW,CAAC,eAAe,CAAC;IACrC,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA+BG;IACH,MAAM,CAAC,KAAK,CAAC,sBAAsB,CAAC,KAAc;QAChD,WAAW,CAAC,eAAe,GAAG,KAAK,CAAC;QACpC,MAAM,WAAW,CAAC,sBAAsB,CAAC,KAAK,CAAC,CAAC;IAClD,CAAC","sourcesContent":["import DebugModule from './modules/DebugModule';\n\n/**\n * Global debug configuration for all Bitmovin components.\n */\nexport class DebugConfig {\n private static _isDebugEnabled = false;\n\n /**\n * Retrieves the current debug logging state.\n *\n * @returns `true` if debug logging is enabled, otherwise `false`.\n */\n static get isDebugLoggingEnabled(): boolean {\n return DebugConfig._isDebugEnabled;\n }\n\n /**\n * Enables or disables global debug logging for all Bitmovin components.\n *\n * Debug logging provides detailed information primarily for debugging purposes,\n * helping to diagnose problems and trace the flow of execution within the Player.\n *\n * ### Warning:\n * This option **should not be enabled in production** as it may log sensitive or confidential\n * information to the console.\n *\n * ## Platform-Specific Logging Behavior\n * ---\n * - **iOS:** logs are printed using `NSLog` at the verbose log level.\n * - **Android:** logs are printed using `android.util.Log` with the following tags:\n * - `BitmovinPlayer`\n * - `BitmovinPlayerView`\n * - `BitmovinOffline`\n * - `BitmovinSource`\n * - `BitmovinExoPlayer`\n *\n * ## Limitations\n * ---\n * **Android**\n * - This flag **must** be set **before** creating any Bitmovin component to take effect.\n *\n * ## Usage Notes\n * ---\n * - We recommend setting this flag during your app's initialization phase, such as in the\n * application's entry point (e.g. `App.tsx`).\n *\n * @defaultValue `false`\n */\n static async setDebugLoggingEnabled(value: boolean): Promise<void> {\n DebugConfig._isDebugEnabled = value;\n await DebugModule.setDebugLoggingEnabled(value);\n }\n}\n"]}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { NativeInstanceConfig } from '../nativeInstance';
|
|
2
|
+
/**
|
|
3
|
+
* Configures the playback behaviour of the player.
|
|
4
|
+
*
|
|
5
|
+
* @remarks Platform: Android
|
|
6
|
+
*/
|
|
7
|
+
export interface DecoderConfig extends NativeInstanceConfig {
|
|
8
|
+
/**
|
|
9
|
+
* A callback interface for sorting and filtering decoders based on priority.
|
|
10
|
+
*
|
|
11
|
+
* This callback is invoked when the player selects a decoder, providing the {@link DecoderContext}
|
|
12
|
+
* and a list of available {@link MediaCodecInfo} objects. The list is initially ordered by
|
|
13
|
+
* the default priority in which decoders will be attempted.
|
|
14
|
+
*
|
|
15
|
+
* The callback should return a reordered or filtered list of {@link MediaCodecInfo} objects
|
|
16
|
+
* that determines the selection priority.
|
|
17
|
+
*
|
|
18
|
+
* ## Example Usage
|
|
19
|
+
*
|
|
20
|
+
* ### Prefer a specific decoder for main content video playback
|
|
21
|
+
* The following example prioritizes a specific decoder for non-ad video playback:
|
|
22
|
+
* ```ts
|
|
23
|
+
* const decoderPriorityProvider: DecoderPriorityProvider = {
|
|
24
|
+
* overrideDecodersPriority: (context: DecoderContext, preferredDecoders: MediaCodecInfo[]): MediaCodecInfo[] => {
|
|
25
|
+
* if (!context.isAd && context.mediaType === DecoderContextMediaType.VIDEO) {
|
|
26
|
+
* // Prioritize a specific decoder
|
|
27
|
+
* return preferredDecoders.sort((a, b) => {
|
|
28
|
+
* const aAsNumber = a.name.startsWith("OMX.google.") ? 1 : 2
|
|
29
|
+
* const bAsNumber = b.name.startsWith("OMX.google.") ? 1 : 2
|
|
30
|
+
* return aAsNumber - bAsNumber
|
|
31
|
+
* })
|
|
32
|
+
* }
|
|
33
|
+
* return preferredDecoders
|
|
34
|
+
* }
|
|
35
|
+
* }
|
|
36
|
+
* ```
|
|
37
|
+
*
|
|
38
|
+
* ### Prefer software decoders for ads playback
|
|
39
|
+
* The following example prioritizes software decoders over hardware decoders for ad playback:
|
|
40
|
+
* ```ts
|
|
41
|
+
* const decoderPriorityProvider: DecoderPriorityProvider = {
|
|
42
|
+
* overrideDecodersPriority: (context: DecoderContext, preferredDecoders: MediaCodecInfo[]): MediaCodecInfo[] => {
|
|
43
|
+
* if (context.isAd) {
|
|
44
|
+
* // Prioritize a specific decoder
|
|
45
|
+
* return preferredDecoders.sort((a, b) => {
|
|
46
|
+
* const aAsNumber = a.isSoftware ? 1 : 2
|
|
47
|
+
* const bAsNumber = b.isSoftware ? 1 : 2
|
|
48
|
+
* return aAsNumber - bAsNumber
|
|
49
|
+
* })
|
|
50
|
+
* }
|
|
51
|
+
* return preferredDecoders
|
|
52
|
+
* }
|
|
53
|
+
* }
|
|
54
|
+
* ```
|
|
55
|
+
*
|
|
56
|
+
* ### Disable software fallback for video playback
|
|
57
|
+
* The following example disables software decoders for non-ad video playback:
|
|
58
|
+
* ```ts
|
|
59
|
+
* const decoderPriorityProvider: DecoderPriorityProvider = {
|
|
60
|
+
* overrideDecodersPriority: (context: DecoderContext, preferredDecoders: MediaCodecInfo[]): MediaCodecInfo[] => {
|
|
61
|
+
* if (!context.isAd && context.mediaType === DecoderContextMediaType.VIDEO) {
|
|
62
|
+
* // Prioritize a specific decoder
|
|
63
|
+
* return preferredDecoders.filter((info) => {
|
|
64
|
+
* return !info.isSoftware
|
|
65
|
+
* })
|
|
66
|
+
* }
|
|
67
|
+
* return preferredDecoders
|
|
68
|
+
* }
|
|
69
|
+
* }
|
|
70
|
+
* ```
|
|
71
|
+
*/
|
|
72
|
+
decoderPriorityProvider?: DecoderPriorityProvider | null;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Can be set on the `DecoderConfig.decoderPriorityProvider` to override the default decoder selection logic.
|
|
76
|
+
* See {@link DecoderConfig#decoderPriorityProvider} for more details
|
|
77
|
+
*
|
|
78
|
+
* @remarks Platform: Android
|
|
79
|
+
* */
|
|
80
|
+
export interface DecoderPriorityProvider {
|
|
81
|
+
overrideDecodersPriority: (context: DecoderContext, preferredDecoders: MediaCodecInfo[]) => MediaCodecInfo[];
|
|
82
|
+
}
|
|
83
|
+
/** The context in which a new decoder is chosen. */
|
|
84
|
+
export interface DecoderContext {
|
|
85
|
+
mediaType: DecoderContextMediaType;
|
|
86
|
+
isAd: boolean;
|
|
87
|
+
}
|
|
88
|
+
export interface MediaCodecInfo {
|
|
89
|
+
name: string;
|
|
90
|
+
isSoftware: boolean;
|
|
91
|
+
}
|
|
92
|
+
export declare enum DecoderContextMediaType {
|
|
93
|
+
AUDIO = "Audio",
|
|
94
|
+
VIDEO = "Video"
|
|
95
|
+
}
|
|
96
|
+
//# sourceMappingURL=decoderConfig.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decoderConfig.d.ts","sourceRoot":"","sources":["../../src/decoder/decoderConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAEzD;;;;GAIG;AACH,MAAM,WAAW,aAAc,SAAQ,oBAAoB;IACzD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA+DG;IACH,uBAAuB,CAAC,EAAE,uBAAuB,GAAG,IAAI,CAAC;CAC1D;AAED;;;;;KAKK;AACL,MAAM,WAAW,uBAAuB;IACtC,wBAAwB,EAAE,CACxB,OAAO,EAAE,cAAc,EACvB,iBAAiB,EAAE,cAAc,EAAE,KAChC,cAAc,EAAE,CAAC;CACvB;AAED,oDAAoD;AACpD,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,uBAAuB,CAAC;IACnC,IAAI,EAAE,OAAO,CAAC;CACf;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,OAAO,CAAC;CACrB;AAED,oBAAY,uBAAuB;IACjC,KAAK,UAAU;IACf,KAAK,UAAU;CAChB"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export var DecoderContextMediaType;
|
|
2
|
+
(function (DecoderContextMediaType) {
|
|
3
|
+
DecoderContextMediaType["AUDIO"] = "Audio";
|
|
4
|
+
DecoderContextMediaType["VIDEO"] = "Video";
|
|
5
|
+
})(DecoderContextMediaType || (DecoderContextMediaType = {}));
|
|
6
|
+
//# sourceMappingURL=decoderConfig.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decoderConfig.js","sourceRoot":"","sources":["../../src/decoder/decoderConfig.ts"],"names":[],"mappings":"AAmGA,MAAM,CAAN,IAAY,uBAGX;AAHD,WAAY,uBAAuB;IACjC,0CAAe,CAAA;IACf,0CAAe,CAAA;AACjB,CAAC,EAHW,uBAAuB,KAAvB,uBAAuB,QAGlC","sourcesContent":["import { NativeInstanceConfig } from '../nativeInstance';\n\n/**\n * Configures the playback behaviour of the player.\n *\n * @remarks Platform: Android\n */\nexport interface DecoderConfig extends NativeInstanceConfig {\n /**\n * A callback interface for sorting and filtering decoders based on priority.\n *\n * This callback is invoked when the player selects a decoder, providing the {@link DecoderContext}\n * and a list of available {@link MediaCodecInfo} objects. The list is initially ordered by\n * the default priority in which decoders will be attempted.\n *\n * The callback should return a reordered or filtered list of {@link MediaCodecInfo} objects\n * that determines the selection priority.\n *\n * ## Example Usage\n *\n * ### Prefer a specific decoder for main content video playback\n * The following example prioritizes a specific decoder for non-ad video playback:\n * ```ts\n * const decoderPriorityProvider: DecoderPriorityProvider = {\n * overrideDecodersPriority: (context: DecoderContext, preferredDecoders: MediaCodecInfo[]): MediaCodecInfo[] => {\n * if (!context.isAd && context.mediaType === DecoderContextMediaType.VIDEO) {\n * // Prioritize a specific decoder\n * return preferredDecoders.sort((a, b) => {\n * const aAsNumber = a.name.startsWith(\"OMX.google.\") ? 1 : 2\n * const bAsNumber = b.name.startsWith(\"OMX.google.\") ? 1 : 2\n * return aAsNumber - bAsNumber\n * })\n * }\n * return preferredDecoders\n * }\n * }\n * ```\n *\n * ### Prefer software decoders for ads playback\n * The following example prioritizes software decoders over hardware decoders for ad playback:\n * ```ts\n * const decoderPriorityProvider: DecoderPriorityProvider = {\n * overrideDecodersPriority: (context: DecoderContext, preferredDecoders: MediaCodecInfo[]): MediaCodecInfo[] => {\n * if (context.isAd) {\n * // Prioritize a specific decoder\n * return preferredDecoders.sort((a, b) => {\n * const aAsNumber = a.isSoftware ? 1 : 2\n * const bAsNumber = b.isSoftware ? 1 : 2\n * return aAsNumber - bAsNumber\n * })\n * }\n * return preferredDecoders\n * }\n * }\n * ```\n *\n * ### Disable software fallback for video playback\n * The following example disables software decoders for non-ad video playback:\n * ```ts\n * const decoderPriorityProvider: DecoderPriorityProvider = {\n * overrideDecodersPriority: (context: DecoderContext, preferredDecoders: MediaCodecInfo[]): MediaCodecInfo[] => {\n * if (!context.isAd && context.mediaType === DecoderContextMediaType.VIDEO) {\n * // Prioritize a specific decoder\n * return preferredDecoders.filter((info) => {\n * return !info.isSoftware\n * })\n * }\n * return preferredDecoders\n * }\n * }\n * ```\n */\n decoderPriorityProvider?: DecoderPriorityProvider | null;\n}\n\n/**\n * Can be set on the `DecoderConfig.decoderPriorityProvider` to override the default decoder selection logic.\n * See {@link DecoderConfig#decoderPriorityProvider} for more details\n *\n * @remarks Platform: Android\n * */\nexport interface DecoderPriorityProvider {\n overrideDecodersPriority: (\n context: DecoderContext,\n preferredDecoders: MediaCodecInfo[]\n ) => MediaCodecInfo[];\n}\n\n/** The context in which a new decoder is chosen. */\nexport interface DecoderContext {\n mediaType: DecoderContextMediaType;\n isAd: boolean;\n}\n\nexport interface MediaCodecInfo {\n name: string;\n isSoftware: boolean;\n}\n\nexport enum DecoderContextMediaType {\n AUDIO = 'Audio',\n VIDEO = 'Video',\n}\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type DecoderConfigModuleEvents = {
|
|
2
|
+
onOverrideDecodersPriority: ({ nativeId, context, preferredDecoders, }: {
|
|
3
|
+
nativeId: string;
|
|
4
|
+
context: any;
|
|
5
|
+
preferredDecoders: any[];
|
|
6
|
+
}) => void;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Expo-based DecoderConfigModule implementation.
|
|
10
|
+
* Android-only module that gracefully handles iOS by providing no-op implementations.
|
|
11
|
+
*/
|
|
12
|
+
declare let DecoderConfigModuleInstance: any;
|
|
13
|
+
export default DecoderConfigModuleInstance;
|
|
14
|
+
//# sourceMappingURL=decoderConfigModule.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decoderConfigModule.d.ts","sourceRoot":"","sources":["../../src/decoder/decoderConfigModule.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,yBAAyB,GAAG;IACtC,0BAA0B,EAAE,CAAC,EAC3B,QAAQ,EACR,OAAO,EACP,iBAAiB,GAClB,EAAE;QACD,QAAQ,EAAE,MAAM,CAAC;QACjB,OAAO,EAAE,GAAG,CAAC;QACb,iBAAiB,EAAE,GAAG,EAAE,CAAC;KAC1B,KAAK,IAAI,CAAC;CACZ,CAAC;AAkBF;;;GAGG;AACH,QAAA,IAAI,2BAA2B,EAAE,GAAG,CAAC;AA0BrC,eAAe,2BAA2B,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { requireNativeModule } from 'expo-modules-core';
|
|
2
|
+
import { Platform } from 'react-native';
|
|
3
|
+
/**
|
|
4
|
+
* Expo-based DecoderConfigModule implementation.
|
|
5
|
+
* Android-only module that gracefully handles iOS by providing no-op implementations.
|
|
6
|
+
*/
|
|
7
|
+
let DecoderConfigModuleInstance;
|
|
8
|
+
if (Platform.OS === 'android') {
|
|
9
|
+
DecoderConfigModuleInstance = requireNativeModule('DecoderConfigModule');
|
|
10
|
+
}
|
|
11
|
+
else {
|
|
12
|
+
// iOS graceful fallback - provide no-op implementations
|
|
13
|
+
DecoderConfigModuleInstance = {
|
|
14
|
+
initializeWithConfig: async () => {
|
|
15
|
+
// No-op on iOS
|
|
16
|
+
},
|
|
17
|
+
overrideDecoderPriorityProviderComplete: async () => {
|
|
18
|
+
// No-op on iOS
|
|
19
|
+
},
|
|
20
|
+
destroy: async () => {
|
|
21
|
+
// No-op on iOS
|
|
22
|
+
},
|
|
23
|
+
addListener: () => ({ remove: () => { } }),
|
|
24
|
+
removeListener: () => { },
|
|
25
|
+
removeAllListeners: () => { },
|
|
26
|
+
emit: () => { },
|
|
27
|
+
listenerCount: () => 0,
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
export default DecoderConfigModuleInstance;
|
|
31
|
+
//# sourceMappingURL=decoderConfigModule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decoderConfigModule.js","sourceRoot":"","sources":["../../src/decoder/decoderConfigModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACtE,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AA8BxC;;;GAGG;AACH,IAAI,2BAAgC,CAAC;AAErC,IAAI,QAAQ,CAAC,EAAE,KAAK,SAAS,EAAE,CAAC;IAC9B,2BAA2B,GAAG,mBAAmB,CAC/C,qBAAqB,CACtB,CAAC;AACJ,CAAC;KAAM,CAAC;IACN,wDAAwD;IACxD,2BAA2B,GAAG;QAC5B,oBAAoB,EAAE,KAAK,IAAI,EAAE;YAC/B,eAAe;QACjB,CAAC;QACD,uCAAuC,EAAE,KAAK,IAAI,EAAE;YAClD,eAAe;QACjB,CAAC;QACD,OAAO,EAAE,KAAK,IAAI,EAAE;YAClB,eAAe;QACjB,CAAC;QACD,WAAW,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,GAAE,CAAC,EAAE,CAAC;QACzC,cAAc,EAAE,GAAG,EAAE,GAAE,CAAC;QACxB,kBAAkB,EAAE,GAAG,EAAE,GAAE,CAAC;QAC5B,IAAI,EAAE,GAAG,EAAE,GAAE,CAAC;QACd,aAAa,EAAE,GAAG,EAAE,CAAC,CAAC;KACvB,CAAC;AACJ,CAAC;AAED,eAAe,2BAA2B,CAAC","sourcesContent":["import { NativeModule, requireNativeModule } from 'expo-modules-core';\nimport { Platform } from 'react-native';\n\nexport type DecoderConfigModuleEvents = {\n onOverrideDecodersPriority: ({\n nativeId,\n context,\n preferredDecoders,\n }: {\n nativeId: string;\n context: any;\n preferredDecoders: any[];\n }) => void;\n};\n\n/**\n * Native DecoderConfigModule using Expo modules API.\n * Android-only module for decoder configuration.\n */\ndeclare class DecoderConfigModule extends NativeModule<DecoderConfigModuleEvents> {\n initializeWithConfig(\n nativeId: string,\n config: Record<string, any>\n ): Promise<void>;\n overrideDecoderPriorityProviderComplete(\n nativeId: string,\n response: any[]\n ): Promise<void>;\n destroy(nativeId: string): Promise<void>;\n}\n\n/**\n * Expo-based DecoderConfigModule implementation.\n * Android-only module that gracefully handles iOS by providing no-op implementations.\n */\nlet DecoderConfigModuleInstance: any;\n\nif (Platform.OS === 'android') {\n DecoderConfigModuleInstance = requireNativeModule<DecoderConfigModule>(\n 'DecoderConfigModule'\n );\n} else {\n // iOS graceful fallback - provide no-op implementations\n DecoderConfigModuleInstance = {\n initializeWithConfig: async () => {\n // No-op on iOS\n },\n overrideDecoderPriorityProviderComplete: async () => {\n // No-op on iOS\n },\n destroy: async () => {\n // No-op on iOS\n },\n addListener: () => ({ remove: () => {} }),\n removeListener: () => {},\n removeAllListeners: () => {},\n emit: () => {},\n listenerCount: () => 0,\n };\n}\n\nexport default DecoderConfigModuleInstance;\n"]}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { DecoderConfig } from './decoderConfig';
|
|
2
|
+
import NativeInstance from '../nativeInstance';
|
|
3
|
+
/**
|
|
4
|
+
* Takes care of JS/Native communication for a `DecoderConfig`.
|
|
5
|
+
*/
|
|
6
|
+
export declare class DecoderConfigBridge extends NativeInstance<DecoderConfig> {
|
|
7
|
+
/**
|
|
8
|
+
* Whether this object's native instance has been created.
|
|
9
|
+
*/
|
|
10
|
+
isInitialized: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Whether this object's native instance has been disposed.
|
|
13
|
+
*/
|
|
14
|
+
isDestroyed: boolean;
|
|
15
|
+
private onOverrideDecodersPrioritySubscription?;
|
|
16
|
+
initialize(): void;
|
|
17
|
+
/**
|
|
18
|
+
* Destroys the native `DecoderConfig`
|
|
19
|
+
*/
|
|
20
|
+
destroy(): void;
|
|
21
|
+
/**
|
|
22
|
+
* Called by native code, when the decoder priority should be evaluated.
|
|
23
|
+
*/
|
|
24
|
+
private overrideDecodersPriority;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/decoder/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAkC,MAAM,iBAAiB,CAAC;AAChF,OAAO,cAAc,MAAM,mBAAmB,CAAC;AAG/C;;GAEG;AACH,qBAAa,mBAAoB,SAAQ,cAAc,CAAC,aAAa,CAAC;IACpE;;OAEG;IACH,aAAa,UAAS;IACtB;;OAEG;IACH,WAAW,UAAS;IAEpB,OAAO,CAAC,sCAAsC,CAAC,CAAoB;IAEnE,UAAU;IA+BV;;OAEG;IACH,OAAO;IASP;;OAEG;IACH,OAAO,CAAC,wBAAwB;CAejC"}
|