react-native-theoplayer 2.16.1 → 3.0.0-pre1
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/CHANGELOG.md +10 -0
- package/README.md +1 -0
- package/android/build.gradle +19 -22
- package/android/src/main/java/com/theoplayer/PlayerConfigAdapter.kt +87 -101
- package/android/src/main/java/com/theoplayer/ReactTHEOplayerContext.kt +30 -30
- package/android/src/main/java/com/theoplayer/ReactTHEOplayerPackage.kt +3 -1
- package/android/src/main/java/com/theoplayer/ReactTHEOplayerView.kt +1 -1
- package/android/src/main/java/com/theoplayer/cache/CacheAdapter.kt +127 -0
- package/android/src/main/java/com/theoplayer/cache/CacheModule.kt +238 -0
- package/android/src/main/java/com/theoplayer/player/PlayerModule.kt +27 -12
- package/android/src/main/java/com/theoplayer/source/SourceAdapter.kt +16 -37
- package/android/src/main/java/com/theoplayer/util/BridgeUtils.kt +60 -0
- package/android/src/main/java/com/theoplayer/util/PayloadBuilder.kt +10 -10
- package/ios/THEOplayerRCTBridge.m +22 -0
- package/ios/THEOplayerRCTDebug.swift +7 -1
- package/ios/THEOplayerRCTMainEventHandler.swift +25 -27
- package/ios/THEOplayerRCTSourceDescriptionAggregator.swift +41 -0
- package/ios/THEOplayerRCTSourceDescriptionBuilder.swift +3 -2
- package/ios/THEOplayerRCTTypeUtils.swift +37 -0
- package/ios/THEOplayerRCTView.swift +1 -2
- package/ios/ads/THEOplayerRCTAdsAPI+DAI.swift +3 -13
- package/ios/ads/THEOplayerRCTAdsAPI.swift +14 -48
- package/ios/ads/THEOplayerRCTView+AdsConfig.swift +0 -13
- package/ios/backgroundAudio/THEOplayerRCTNowPlayingManager.swift +24 -36
- package/ios/backgroundAudio/THEOplayerRCTRemoteCommandsManager.swift +2 -10
- package/ios/cache/THEOplayerRCTCacheAPI.swift +202 -0
- package/ios/cache/THEOplayerRCTCacheAggregator.swift +87 -0
- package/ios/cache/THEOplayerRCTCachingParametersBuilder.swift +27 -0
- package/ios/pip/THEOplayerRCTPipControlsManager.swift +2 -4
- package/lib/commonjs/api/abr/ABRConfiguration.js +21 -7
- package/lib/commonjs/api/abr/ABRConfiguration.js.map +1 -1
- package/lib/commonjs/api/ads/GoogleImaConfiguration.js.map +1 -1
- package/lib/commonjs/api/barrel.js +30 -19
- package/lib/commonjs/api/barrel.js.map +1 -1
- package/lib/commonjs/api/cache/CachingPreferredTrackSelection.js +2 -0
- package/lib/commonjs/api/cache/CachingPreferredTrackSelection.js.map +1 -0
- package/lib/commonjs/api/cache/CachingTask.js +30 -0
- package/lib/commonjs/api/cache/CachingTask.js.map +1 -0
- package/lib/commonjs/api/cache/CachingTaskLicense.js +6 -0
- package/lib/commonjs/api/cache/CachingTaskLicense.js.map +1 -0
- package/lib/commonjs/api/cache/CachingTaskList.js +6 -0
- package/lib/commonjs/api/cache/CachingTaskList.js.map +1 -0
- package/lib/commonjs/api/cache/CachingTaskParameters.js +6 -0
- package/lib/commonjs/api/cache/CachingTaskParameters.js.map +1 -0
- package/lib/commonjs/api/cache/MediaCacheAPI.js +24 -0
- package/lib/commonjs/api/cache/MediaCacheAPI.js.map +1 -0
- package/lib/commonjs/api/cache/barrel.js +83 -0
- package/lib/commonjs/api/cache/barrel.js.map +1 -0
- package/lib/commonjs/api/cache/events/CacheEvent.js +28 -0
- package/lib/commonjs/api/cache/events/CacheEvent.js.map +1 -0
- package/lib/commonjs/api/cache/events/CachingTaskEvent.js +17 -0
- package/lib/commonjs/api/cache/events/CachingTaskEvent.js.map +1 -0
- package/lib/commonjs/api/cache/events/barrel.js +28 -0
- package/lib/commonjs/api/cache/events/barrel.js.map +1 -0
- package/lib/commonjs/api/cache/hooks/barrel.js +39 -0
- package/lib/commonjs/api/cache/hooks/barrel.js.map +1 -0
- package/lib/commonjs/api/cache/hooks/useCachingTaskList.js +31 -0
- package/lib/commonjs/api/cache/hooks/useCachingTaskList.js.map +1 -0
- package/lib/commonjs/api/cache/hooks/useCachingTaskProgress.js +28 -0
- package/lib/commonjs/api/cache/hooks/useCachingTaskProgress.js.map +1 -0
- package/lib/commonjs/api/cache/hooks/useCachingTaskStatus.js +28 -0
- package/lib/commonjs/api/cache/hooks/useCachingTaskStatus.js.map +1 -0
- package/lib/commonjs/api/cast/CastState.js +3 -4
- package/lib/commonjs/api/cast/CastState.js.map +1 -1
- package/lib/commonjs/api/config/PlayerConfiguration.js.map +1 -1
- package/lib/commonjs/api/event/AdEvent.js +3 -4
- package/lib/commonjs/api/event/AdEvent.js.map +1 -1
- package/lib/commonjs/api/event/CastEvent.js +3 -4
- package/lib/commonjs/api/event/CastEvent.js.map +1 -1
- package/lib/commonjs/api/event/PlayerEvent.js +3 -4
- package/lib/commonjs/api/event/PlayerEvent.js.map +1 -1
- package/lib/commonjs/api/event/TrackEvent.js +12 -16
- package/lib/commonjs/api/event/TrackEvent.js.map +1 -1
- package/lib/commonjs/api/player/PlayerEventMap.js +7 -8
- package/lib/commonjs/api/player/PlayerEventMap.js.map +1 -1
- package/lib/commonjs/api/player/THEOplayer.js +6 -4
- package/lib/commonjs/api/player/THEOplayer.js.map +1 -1
- package/lib/commonjs/api/presentation/PresentationMode.js +3 -4
- package/lib/commonjs/api/presentation/PresentationMode.js.map +1 -1
- package/lib/commonjs/api/source/ads/Ads.js +3 -4
- package/lib/commonjs/api/source/ads/Ads.js.map +1 -1
- package/lib/commonjs/api/track/TextTrack.js +9 -12
- package/lib/commonjs/api/track/TextTrack.js.map +1 -1
- package/lib/commonjs/api/track/TextTrackStyle.js +3 -4
- package/lib/commonjs/api/track/TextTrackStyle.js.map +1 -1
- package/lib/commonjs/index.js +9 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/internal/THEOplayerView.js +1 -1
- package/lib/commonjs/internal/THEOplayerView.js.map +1 -1
- package/lib/commonjs/internal/THEOplayerView.style.js +1 -2
- package/lib/commonjs/internal/THEOplayerView.style.js.map +1 -1
- package/lib/commonjs/internal/THEOplayerView.web.js +5 -5
- package/lib/commonjs/internal/THEOplayerView.web.js.map +1 -1
- package/lib/commonjs/internal/adapter/THEOplayerAdapter.js.map +1 -1
- package/lib/commonjs/internal/adapter/THEOplayerWebAdapter.js +12 -13
- package/lib/commonjs/internal/adapter/THEOplayerWebAdapter.js.map +1 -1
- package/lib/commonjs/internal/adapter/WebEventForwarder.js +10 -10
- package/lib/commonjs/internal/adapter/WebEventForwarder.js.map +1 -1
- package/lib/commonjs/internal/adapter/abr/AbrAdapter.js.map +1 -1
- package/lib/commonjs/internal/adapter/ads/THEOplayerWebAdsAdapter.js +2 -2
- package/lib/commonjs/internal/adapter/ads/THEOplayerWebAdsAdapter.js.map +1 -1
- package/lib/commonjs/internal/adapter/cast/THEOplayerNativeCastAdapter.js +1 -1
- package/lib/commonjs/internal/adapter/cast/THEOplayerNativeCastAdapter.js.map +1 -1
- package/lib/commonjs/internal/adapter/cast/THEOplayerWebCastAdapter.js.map +1 -1
- package/lib/commonjs/internal/adapter/event/BaseEvent.js.map +1 -1
- package/lib/commonjs/internal/adapter/event/DefaultEventDispatcher.js +1 -1
- package/lib/commonjs/internal/adapter/event/DefaultEventDispatcher.js.map +1 -1
- package/lib/commonjs/internal/adapter/event/native/NativeTrackEvent.js +12 -16
- package/lib/commonjs/internal/adapter/event/native/NativeTrackEvent.js.map +1 -1
- package/lib/commonjs/internal/adapter/track/TextTrackStyleAdapter.js.map +1 -1
- package/lib/commonjs/internal/adapter/web/FullscreenAPI.js +1 -2
- package/lib/commonjs/internal/adapter/web/FullscreenAPI.js.map +1 -1
- package/lib/commonjs/internal/adapter/web/WebMediaSession.js +9 -11
- package/lib/commonjs/internal/adapter/web/WebMediaSession.js.map +1 -1
- package/lib/commonjs/internal/adapter/web/WebPresentationModeManager.js +4 -4
- package/lib/commonjs/internal/adapter/web/WebPresentationModeManager.js.map +1 -1
- package/lib/commonjs/internal/cache/MediaCache.js +117 -0
- package/lib/commonjs/internal/cache/MediaCache.js.map +1 -0
- package/lib/commonjs/internal/cache/MediaCache.web.js +54 -0
- package/lib/commonjs/internal/cache/MediaCache.web.js.map +1 -0
- package/lib/commonjs/internal/cache/NativeCachingTaskAdapter.js +59 -0
- package/lib/commonjs/internal/cache/NativeCachingTaskAdapter.js.map +1 -0
- package/lib/commonjs/internal/cache/NativeCachingTaskParametersAdapter.js +27 -0
- package/lib/commonjs/internal/cache/NativeCachingTaskParametersAdapter.js.map +1 -0
- package/lib/commonjs/internal/cache/WebCachingTaskAdapter.js +71 -0
- package/lib/commonjs/internal/cache/WebCachingTaskAdapter.js.map +1 -0
- package/lib/commonjs/internal/drm/ContentProtectionRegistry.js +1 -2
- package/lib/commonjs/internal/drm/ContentProtectionRegistry.js.map +1 -1
- package/lib/commonjs/internal/drm/ContentProtectionRegistry.web.js +1 -2
- package/lib/commonjs/internal/drm/ContentProtectionRegistry.web.js.map +1 -1
- package/lib/commonjs/internal/drm/NativeCertificateResponse.js.map +1 -1
- package/lib/commonjs/internal/drm/NativeLicenseResponse.js.map +1 -1
- package/lib/commonjs/internal/utils/TypeUtils.js +2 -4
- package/lib/commonjs/internal/utils/TypeUtils.js.map +1 -1
- package/lib/module/api/abr/ABRConfiguration.js +24 -6
- package/lib/module/api/abr/ABRConfiguration.js.map +1 -1
- package/lib/module/api/ads/GoogleImaConfiguration.js.map +1 -1
- package/lib/module/api/barrel.js +1 -0
- package/lib/module/api/barrel.js.map +1 -1
- package/lib/module/api/cache/CachingPreferredTrackSelection.js +2 -0
- package/lib/module/api/cache/CachingPreferredTrackSelection.js.map +1 -0
- package/lib/module/api/cache/CachingTask.js +25 -0
- package/lib/module/api/cache/CachingTask.js.map +1 -0
- package/lib/module/api/cache/CachingTaskLicense.js +2 -0
- package/lib/module/api/cache/CachingTaskLicense.js.map +1 -0
- package/lib/module/api/cache/CachingTaskList.js +2 -0
- package/lib/module/api/cache/CachingTaskList.js.map +1 -0
- package/lib/module/api/cache/CachingTaskParameters.js +2 -0
- package/lib/module/api/cache/CachingTaskParameters.js.map +1 -0
- package/lib/module/api/cache/MediaCacheAPI.js +19 -0
- package/lib/module/api/cache/MediaCacheAPI.js.map +1 -0
- package/lib/module/api/cache/barrel.js +8 -0
- package/lib/module/api/cache/barrel.js.map +1 -0
- package/lib/module/api/cache/events/CacheEvent.js +25 -0
- package/lib/module/api/cache/events/CacheEvent.js.map +1 -0
- package/lib/module/api/cache/events/CachingTaskEvent.js +12 -0
- package/lib/module/api/cache/events/CachingTaskEvent.js.map +1 -0
- package/lib/module/api/cache/events/barrel.js +3 -0
- package/lib/module/api/cache/events/barrel.js.map +1 -0
- package/lib/module/api/cache/hooks/barrel.js +4 -0
- package/lib/module/api/cache/hooks/barrel.js.map +1 -0
- package/lib/module/api/cache/hooks/useCachingTaskList.js +24 -0
- package/lib/module/api/cache/hooks/useCachingTaskList.js.map +1 -0
- package/lib/module/api/cache/hooks/useCachingTaskProgress.js +21 -0
- package/lib/module/api/cache/hooks/useCachingTaskProgress.js.map +1 -0
- package/lib/module/api/cache/hooks/useCachingTaskStatus.js +21 -0
- package/lib/module/api/cache/hooks/useCachingTaskStatus.js.map +1 -0
- package/lib/module/api/cast/CastState.js +3 -3
- package/lib/module/api/cast/CastState.js.map +1 -1
- package/lib/module/api/config/PlayerConfiguration.js.map +1 -1
- package/lib/module/api/event/AdEvent.js +3 -3
- package/lib/module/api/event/AdEvent.js.map +1 -1
- package/lib/module/api/event/CastEvent.js +3 -3
- package/lib/module/api/event/CastEvent.js.map +1 -1
- package/lib/module/api/event/PlayerEvent.js +3 -3
- package/lib/module/api/event/PlayerEvent.js.map +1 -1
- package/lib/module/api/event/TrackEvent.js +12 -12
- package/lib/module/api/event/TrackEvent.js.map +1 -1
- package/lib/module/api/player/PlayerEventMap.js +8 -8
- package/lib/module/api/player/PlayerEventMap.js.map +1 -1
- package/lib/module/api/player/THEOplayer.js +7 -3
- package/lib/module/api/player/THEOplayer.js.map +1 -1
- package/lib/module/api/presentation/PresentationMode.js +3 -3
- package/lib/module/api/presentation/PresentationMode.js.map +1 -1
- package/lib/module/api/source/ads/Ads.js +3 -3
- package/lib/module/api/source/ads/Ads.js.map +1 -1
- package/lib/module/api/track/TextTrack.js +9 -9
- package/lib/module/api/track/TextTrack.js.map +1 -1
- package/lib/module/api/track/TextTrackStyle.js +3 -3
- package/lib/module/api/track/TextTrackStyle.js.map +1 -1
- package/lib/module/index.js +1 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/internal/THEOplayerView.js +1 -1
- package/lib/module/internal/THEOplayerView.js.map +1 -1
- package/lib/module/internal/THEOplayerView.web.js +5 -5
- package/lib/module/internal/THEOplayerView.web.js.map +1 -1
- package/lib/module/internal/adapter/THEOplayerAdapter.js.map +1 -1
- package/lib/module/internal/adapter/THEOplayerWebAdapter.js +12 -11
- package/lib/module/internal/adapter/THEOplayerWebAdapter.js.map +1 -1
- package/lib/module/internal/adapter/WebEventForwarder.js +10 -10
- package/lib/module/internal/adapter/WebEventForwarder.js.map +1 -1
- package/lib/module/internal/adapter/abr/AbrAdapter.js.map +1 -1
- package/lib/module/internal/adapter/ads/THEOplayerWebAdsAdapter.js +2 -2
- package/lib/module/internal/adapter/ads/THEOplayerWebAdsAdapter.js.map +1 -1
- package/lib/module/internal/adapter/cast/THEOplayerNativeCastAdapter.js +1 -1
- package/lib/module/internal/adapter/cast/THEOplayerNativeCastAdapter.js.map +1 -1
- package/lib/module/internal/adapter/cast/THEOplayerWebCastAdapter.js.map +1 -1
- package/lib/module/internal/adapter/event/BaseEvent.js.map +1 -1
- package/lib/module/internal/adapter/event/DefaultEventDispatcher.js +1 -1
- package/lib/module/internal/adapter/event/DefaultEventDispatcher.js.map +1 -1
- package/lib/module/internal/adapter/event/native/NativeTrackEvent.js +12 -12
- package/lib/module/internal/adapter/event/native/NativeTrackEvent.js.map +1 -1
- package/lib/module/internal/adapter/track/TextTrackStyleAdapter.js.map +1 -1
- package/lib/module/internal/adapter/web/FullscreenAPI.js.map +1 -1
- package/lib/module/internal/adapter/web/WebMediaSession.js +8 -9
- package/lib/module/internal/adapter/web/WebMediaSession.js.map +1 -1
- package/lib/module/internal/adapter/web/WebPresentationModeManager.js +4 -4
- package/lib/module/internal/adapter/web/WebPresentationModeManager.js.map +1 -1
- package/lib/module/internal/cache/MediaCache.js +110 -0
- package/lib/module/internal/cache/MediaCache.js.map +1 -0
- package/lib/module/internal/cache/MediaCache.web.js +45 -0
- package/lib/module/internal/cache/MediaCache.web.js.map +1 -0
- package/lib/module/internal/cache/NativeCachingTaskAdapter.js +52 -0
- package/lib/module/internal/cache/NativeCachingTaskAdapter.js.map +1 -0
- package/lib/module/internal/cache/NativeCachingTaskParametersAdapter.js +20 -0
- package/lib/module/internal/cache/NativeCachingTaskParametersAdapter.js.map +1 -0
- package/lib/module/internal/cache/WebCachingTaskAdapter.js +64 -0
- package/lib/module/internal/cache/WebCachingTaskAdapter.js.map +1 -0
- package/lib/module/internal/drm/ContentProtectionRegistry.js.map +1 -1
- package/lib/module/internal/drm/ContentProtectionRegistry.web.js.map +1 -1
- package/lib/module/internal/drm/NativeCertificateResponse.js.map +1 -1
- package/lib/module/internal/drm/NativeLicenseResponse.js.map +1 -1
- package/lib/typescript/api/abr/ABRConfiguration.d.ts +1 -1
- package/lib/typescript/api/ads/Ad.d.ts +2 -2
- package/lib/typescript/api/ads/AdsConfiguration.d.ts +2 -2
- package/lib/typescript/api/ads/GoogleImaConfiguration.d.ts +1 -0
- package/lib/typescript/api/barrel.d.ts +1 -0
- package/lib/typescript/api/cache/CachingPreferredTrackSelection.d.ts +23 -0
- package/lib/typescript/api/cache/CachingTask.d.ts +93 -0
- package/lib/typescript/api/cache/CachingTaskLicense.d.ts +14 -0
- package/lib/typescript/api/cache/CachingTaskList.d.ts +7 -0
- package/lib/typescript/api/cache/CachingTaskParameters.d.ts +57 -0
- package/lib/typescript/api/cache/MediaCacheAPI.d.ts +39 -0
- package/lib/typescript/api/cache/barrel.d.ts +7 -0
- package/lib/typescript/api/cache/events/CacheEvent.d.ts +55 -0
- package/lib/typescript/api/cache/events/CachingTaskEvent.d.ts +22 -0
- package/lib/typescript/api/cache/events/barrel.d.ts +2 -0
- package/lib/typescript/api/cache/hooks/barrel.d.ts +3 -0
- package/lib/typescript/api/cache/hooks/useCachingTaskList.d.ts +1 -0
- package/lib/typescript/api/cache/hooks/useCachingTaskProgress.d.ts +2 -0
- package/lib/typescript/api/cache/hooks/useCachingTaskStatus.d.ts +2 -0
- package/lib/typescript/api/cast/CastConfiguration.d.ts +1 -1
- package/lib/typescript/api/config/PlayerConfiguration.d.ts +4 -1
- package/lib/typescript/api/drm/ContentProtectionIntegration.d.ts +2 -2
- package/lib/typescript/api/drm/ContentProtectionRequest.d.ts +1 -1
- package/lib/typescript/api/error/ChromecastError.d.ts +1 -1
- package/lib/typescript/api/event/CastEvent.d.ts +1 -1
- package/lib/typescript/api/event/EventDispatcher.d.ts +2 -2
- package/lib/typescript/api/event/EventListener.d.ts +1 -1
- package/lib/typescript/api/player/THEOplayer.d.ts +2 -2
- package/lib/typescript/api/source/SourceDescription.d.ts +3 -3
- package/lib/typescript/api/source/ads/Ads.d.ts +1 -1
- package/lib/typescript/api/source/ads/FreeWheelAdDescription.d.ts +1 -1
- package/lib/typescript/api/source/ads/ssai/GoogleDAIConfiguration.d.ts +2 -2
- package/lib/typescript/api/source/ads/ssai/ImagineServerSideAdInsertionConfiguration.d.ts +1 -1
- package/lib/typescript/api/source/ads/ssai/ServerSideAdInsertionConfiguration.d.ts +1 -1
- package/lib/typescript/api/source/ads/ssai/YospaceServerSideAdInsertionConfiguration.d.ts +2 -2
- package/lib/typescript/api/source/dash/DashPlaybackConfiguration.d.ts +1 -1
- package/lib/typescript/api/source/drm/DRMConfiguration.d.ts +3 -3
- package/lib/typescript/api/source/hls/HlsPlaybackConfiguration.d.ts +1 -1
- package/lib/typescript/api/track/MediaTrack.d.ts +1 -1
- package/lib/typescript/index.d.ts +1 -0
- package/lib/typescript/internal/THEOplayerView.web.d.ts +1 -1
- package/lib/typescript/internal/adapter/THEOplayerWebAdapter.d.ts +2 -2
- package/lib/typescript/internal/adapter/WebEventForwarder.d.ts +2 -2
- package/lib/typescript/internal/adapter/ads/THEOplayerWebAdsAdapter.d.ts +2 -2
- package/lib/typescript/internal/adapter/cast/THEOplayerWebCastAdapter.d.ts +2 -2
- package/lib/typescript/internal/adapter/event/native/NativeCastEvent.d.ts +1 -1
- package/lib/typescript/internal/adapter/web/WebPresentationModeManager.d.ts +2 -2
- package/lib/typescript/internal/cache/MediaCache.d.ts +25 -0
- package/lib/typescript/internal/cache/MediaCache.web.d.ts +16 -0
- package/lib/typescript/internal/cache/NativeCachingTaskAdapter.d.ts +33 -0
- package/lib/typescript/internal/cache/NativeCachingTaskParametersAdapter.d.ts +11 -0
- package/lib/typescript/internal/cache/WebCachingTaskAdapter.d.ts +25 -0
- package/package.json +16 -15
- package/react-native-theoplayer.podspec +4 -4
- package/src/api/ads/GoogleImaConfiguration.ts +1 -0
- package/src/api/barrel.ts +1 -0
- package/src/api/cache/CachingPreferredTrackSelection.ts +24 -0
- package/src/api/cache/CachingTask.ts +107 -0
- package/src/api/cache/CachingTaskLicense.ts +15 -0
- package/src/api/cache/CachingTaskList.ts +8 -0
- package/src/api/cache/CachingTaskParameters.ts +62 -0
- package/src/api/cache/MediaCacheAPI.ts +43 -0
- package/src/api/cache/barrel.ts +7 -0
- package/src/api/cache/events/CacheEvent.ts +62 -0
- package/src/api/cache/events/CachingTaskEvent.ts +27 -0
- package/src/api/cache/events/barrel.ts +2 -0
- package/src/api/cache/hooks/barrel.ts +3 -0
- package/src/api/cache/hooks/useCachingTaskList.ts +23 -0
- package/src/api/cache/hooks/useCachingTaskProgress.ts +20 -0
- package/src/api/cache/hooks/useCachingTaskStatus.ts +20 -0
- package/src/api/config/PlayerConfiguration.ts +3 -0
- package/src/index.tsx +1 -0
- package/src/internal/THEOplayerView.web.tsx +5 -5
- package/src/internal/adapter/THEOplayerWebAdapter.ts +6 -6
- package/src/internal/adapter/WebEventForwarder.ts +3 -3
- package/src/internal/adapter/ads/THEOplayerWebAdsAdapter.ts +3 -3
- package/src/internal/adapter/cast/THEOplayerWebCastAdapter.ts +3 -3
- package/src/internal/adapter/web/WebPresentationModeManager.ts +3 -3
- package/src/internal/cache/MediaCache.ts +151 -0
- package/src/internal/cache/MediaCache.web.ts +54 -0
- package/src/internal/cache/NativeCachingTaskAdapter.ts +81 -0
- package/src/internal/cache/NativeCachingTaskParametersAdapter.ts +32 -0
- package/src/internal/cache/WebCachingTaskAdapter.ts +95 -0
- package/android/src/main/java/com/theoplayer/track/QualityListFilter.kt +0 -28
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.NativeCachingTaskAdapter = void 0;
|
|
7
|
+
var _DefaultEventDispatcher = require("../adapter/event/DefaultEventDispatcher");
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _NativeCachingTaskParametersAdapter = require("./NativeCachingTaskParametersAdapter");
|
|
10
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
11
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
12
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
13
|
+
class NativeCachingTaskAdapter extends _DefaultEventDispatcher.DefaultEventDispatcher {
|
|
14
|
+
constructor(task) {
|
|
15
|
+
super();
|
|
16
|
+
_defineProperty(this, "bytes", void 0);
|
|
17
|
+
_defineProperty(this, "bytesCached", void 0);
|
|
18
|
+
_defineProperty(this, "cached", void 0);
|
|
19
|
+
_defineProperty(this, "duration", void 0);
|
|
20
|
+
_defineProperty(this, "id", void 0);
|
|
21
|
+
_defineProperty(this, "license", void 0);
|
|
22
|
+
_defineProperty(this, "parameters", void 0);
|
|
23
|
+
_defineProperty(this, "percentageCached", void 0);
|
|
24
|
+
_defineProperty(this, "secondsCached", void 0);
|
|
25
|
+
_defineProperty(this, "source", void 0);
|
|
26
|
+
_defineProperty(this, "status", void 0);
|
|
27
|
+
this.bytes = task.bytes;
|
|
28
|
+
this.cached = {
|
|
29
|
+
...task.cached
|
|
30
|
+
};
|
|
31
|
+
this.duration = task.duration;
|
|
32
|
+
this.id = task.id;
|
|
33
|
+
this.bytesCached = task.bytesCached;
|
|
34
|
+
this.license = {
|
|
35
|
+
renew(drmConfiguration) {
|
|
36
|
+
_reactNative.NativeModules.CacheModule.renewLicense(task.id, drmConfiguration);
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
this.parameters = (0, _NativeCachingTaskParametersAdapter.fromNativeCachingTaskParameters)(task.parameters);
|
|
40
|
+
this.percentageCached = task.percentageCached;
|
|
41
|
+
this.secondsCached = task.secondsCached;
|
|
42
|
+
// TODO!
|
|
43
|
+
this.source = {
|
|
44
|
+
...task.source
|
|
45
|
+
};
|
|
46
|
+
this.status = task.status;
|
|
47
|
+
}
|
|
48
|
+
pause() {
|
|
49
|
+
_reactNative.NativeModules.CacheModule.pauseCachingTask(this.id);
|
|
50
|
+
}
|
|
51
|
+
remove() {
|
|
52
|
+
_reactNative.NativeModules.CacheModule.removeCachingTask(this.id);
|
|
53
|
+
}
|
|
54
|
+
start() {
|
|
55
|
+
_reactNative.NativeModules.CacheModule.startCachingTask(this.id);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
exports.NativeCachingTaskAdapter = NativeCachingTaskAdapter;
|
|
59
|
+
//# sourceMappingURL=NativeCachingTaskAdapter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_DefaultEventDispatcher","require","_reactNative","_NativeCachingTaskParametersAdapter","_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","arg","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","undefined","res","call","TypeError","Number","NativeCachingTaskAdapter","DefaultEventDispatcher","constructor","task","bytes","cached","duration","id","bytesCached","license","renew","drmConfiguration","NativeModules","CacheModule","renewLicense","parameters","fromNativeCachingTaskParameters","percentageCached","secondsCached","source","status","pause","pauseCachingTask","remove","removeCachingTask","start","startCachingTask","exports"],"sources":["NativeCachingTaskAdapter.ts"],"sourcesContent":["import { DefaultEventDispatcher } from '../adapter/event/DefaultEventDispatcher';\nimport type {\n CachingTask,\n CachingTaskEventMap,\n CachingTaskLicense,\n CachingTaskParameters,\n SourceDescription,\n TimeRange,\n} from 'react-native-theoplayer';\nimport type { CacheTaskStatus } from 'react-native-theoplayer';\nimport { NativeModules } from 'react-native';\nimport type { DRMConfiguration } from 'react-native-theoplayer';\nimport { fromNativeCachingTaskParameters, NativeCachingTaskParameters } from \"./NativeCachingTaskParametersAdapter\";\n\nexport interface NativeCachingTask {\n readonly id: string;\n\n readonly status: CacheTaskStatus;\n\n readonly source: SourceDescription;\n\n readonly parameters: NativeCachingTaskParameters;\n\n readonly duration: number;\n\n readonly cached: TimeRange[];\n\n readonly secondsCached: number;\n\n readonly percentageCached: number;\n\n readonly bytes: number;\n\n readonly bytesCached: number;\n}\n\nexport class NativeCachingTaskAdapter extends DefaultEventDispatcher<CachingTaskEventMap> implements CachingTask {\n readonly bytes: number;\n readonly bytesCached: number;\n readonly cached: TimeRange[];\n readonly duration: number;\n readonly id: string;\n readonly license: CachingTaskLicense;\n readonly parameters: CachingTaskParameters;\n readonly percentageCached: number;\n readonly secondsCached: number;\n readonly source: SourceDescription;\n readonly status: CacheTaskStatus;\n\n constructor(task: NativeCachingTask) {\n super();\n this.bytes = task.bytes;\n this.cached = { ...task.cached };\n this.duration = task.duration;\n this.id = task.id;\n this.bytesCached = task.bytesCached;\n this.license = {\n renew(drmConfiguration?: DRMConfiguration) {\n NativeModules.CacheModule.renewLicense(task.id, drmConfiguration);\n },\n };\n this.parameters = fromNativeCachingTaskParameters(task.parameters);\n this.percentageCached = task.percentageCached;\n this.secondsCached = task.secondsCached;\n // TODO!\n this.source = { ...task.source };\n this.status = task.status;\n }\n\n pause(): void {\n NativeModules.CacheModule.pauseCachingTask(this.id);\n }\n\n remove(): void {\n NativeModules.CacheModule.removeCachingTask(this.id);\n }\n\n start(): void {\n NativeModules.CacheModule.startCachingTask(this.id);\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,uBAAA,GAAAC,OAAA;AAUA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,mCAAA,GAAAF,OAAA;AAAoH,SAAAG,gBAAAC,GAAA,EAAAC,GAAA,EAAAC,KAAA,IAAAD,GAAA,GAAAE,cAAA,CAAAF,GAAA,OAAAA,GAAA,IAAAD,GAAA,IAAAI,MAAA,CAAAC,cAAA,CAAAL,GAAA,EAAAC,GAAA,IAAAC,KAAA,EAAAA,KAAA,EAAAI,UAAA,QAAAC,YAAA,QAAAC,QAAA,oBAAAR,GAAA,CAAAC,GAAA,IAAAC,KAAA,WAAAF,GAAA;AAAA,SAAAG,eAAAM,GAAA,QAAAR,GAAA,GAAAS,YAAA,CAAAD,GAAA,2BAAAR,GAAA,gBAAAA,GAAA,GAAAU,MAAA,CAAAV,GAAA;AAAA,SAAAS,aAAAE,KAAA,EAAAC,IAAA,eAAAD,KAAA,iBAAAA,KAAA,kBAAAA,KAAA,MAAAE,IAAA,GAAAF,KAAA,CAAAG,MAAA,CAAAC,WAAA,OAAAF,IAAA,KAAAG,SAAA,QAAAC,GAAA,GAAAJ,IAAA,CAAAK,IAAA,CAAAP,KAAA,EAAAC,IAAA,2BAAAK,GAAA,sBAAAA,GAAA,YAAAE,SAAA,4DAAAP,IAAA,gBAAAF,MAAA,GAAAU,MAAA,EAAAT,KAAA;AAwB7G,MAAMU,wBAAwB,SAASC,8CAAsB,C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B,CAAC,IAAI,CAACnB,EAAE,CAAC;EACrD;AACF;AAACoB,OAAA,CAAA3B,wBAAA,GAAAA,wBAAA"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.fromNativeCachingTaskParameters = fromNativeCachingTaskParameters;
|
|
7
|
+
exports.toNativeCachingTaskParameters = toNativeCachingTaskParameters;
|
|
8
|
+
function fromNativeCachingTaskParameters(parameters) {
|
|
9
|
+
return {
|
|
10
|
+
amount: parameters.amount,
|
|
11
|
+
expirationDate: parameters !== null && parameters !== void 0 && parameters.expirationDate ? new Date(parameters === null || parameters === void 0 ? void 0 : parameters.expirationDate) : undefined,
|
|
12
|
+
bandwidth: parameters.bandwidth,
|
|
13
|
+
preferredTrackSelection: parameters.preferredTrackSelection,
|
|
14
|
+
allowsCellularAccess: parameters.allowsCellularAccess
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
function toNativeCachingTaskParameters(parameters) {
|
|
18
|
+
var _parameters$expiratio;
|
|
19
|
+
return {
|
|
20
|
+
amount: parameters.amount,
|
|
21
|
+
expirationDate: parameters === null || parameters === void 0 || (_parameters$expiratio = parameters.expirationDate) === null || _parameters$expiratio === void 0 ? void 0 : _parameters$expiratio.getTime(),
|
|
22
|
+
bandwidth: parameters.bandwidth,
|
|
23
|
+
preferredTrackSelection: parameters.preferredTrackSelection,
|
|
24
|
+
allowsCellularAccess: parameters.allowsCellularAccess
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=NativeCachingTaskParametersAdapter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["fromNativeCachingTaskParameters","parameters","amount","expirationDate","Date","undefined","bandwidth","preferredTrackSelection","allowsCellularAccess","toNativeCachingTaskParameters","_parameters$expiratio","getTime"],"sources":["NativeCachingTaskParametersAdapter.ts"],"sourcesContent":["import type {\n CachingTaskParameters,\n} from 'react-native-theoplayer';\nimport type { CachingPreferredTrackSelection } from \"../../api/cache/CachingPreferredTrackSelection\";\n\nexport interface NativeCachingTaskParameters {\n readonly amount: number | string;\n readonly expirationDate: number | undefined;\n readonly bandwidth: number | undefined;\n readonly preferredTrackSelection: CachingPreferredTrackSelection | undefined;\n readonly allowsCellularAccess: boolean | undefined;\n}\n\nexport function fromNativeCachingTaskParameters(parameters: NativeCachingTaskParameters): CachingTaskParameters {\n return {\n amount: parameters.amount,\n expirationDate: parameters?.expirationDate? new Date(parameters?.expirationDate) : undefined,\n bandwidth: parameters.bandwidth,\n preferredTrackSelection: parameters.preferredTrackSelection,\n allowsCellularAccess: parameters.allowsCellularAccess\n }\n}\n\nexport function toNativeCachingTaskParameters(parameters: CachingTaskParameters): NativeCachingTaskParameters {\n return {\n amount: parameters.amount,\n expirationDate: parameters?.expirationDate?.getTime(),\n bandwidth: parameters.bandwidth,\n preferredTrackSelection: parameters.preferredTrackSelection,\n allowsCellularAccess: parameters.allowsCellularAccess\n }\n}\n"],"mappings":";;;;;;;AAaO,SAASA,+BAA+BA,CAACC,UAAuC,EAAyB;EAC9G,OAAO;IACLC,MAAM,EAAED,UAAU,CAACC,MAAM;IACzBC,cAAc,EAAEF,UAAU,aAAVA,UAAU,eAAVA,UAAU,CAAEE,cAAc,GAAE,IAAIC,IAAI,CAACH,UAAU,aAAVA,UAAU,uBAAVA,UAAU,CAAEE,cAAc,CAAC,GAAGE,SAAS;IAC5FC,SAAS,EAAEL,UAAU,CAACK,SAAS;IAC/BC,uBAAuB,EAAEN,UAAU,CAACM,uBAAuB;IAC3DC,oBAAoB,EAAEP,UAAU,CAACO;EACnC,CAAC;AACH;AAEO,SAASC,6BAA6BA,CAACR,UAAiC,EAA+B;EAAA,IAAAS,qBAAA;EAC5G,OAAO;IACLR,MAAM,EAAED,UAAU,CAACC,MAAM;IACzBC,cAAc,EAAEF,UAAU,aAAVA,UAAU,gBAAAS,qBAAA,GAAVT,UAAU,CAAEE,cAAc,cAAAO,qBAAA,uBAA1BA,qBAAA,CAA4BC,OAAO,CAAC,CAAC;IACrDL,SAAS,EAAEL,UAAU,CAACK,SAAS;IAC/BC,uBAAuB,EAAEN,UAAU,CAACM,uBAAuB;IAC3DC,oBAAoB,EAAEP,UAAU,CAACO;EACnC,CAAC;AACH"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.WebCachingTaskAdapter = void 0;
|
|
7
|
+
class WebCachingTaskAdapter {
|
|
8
|
+
constructor(webCachingTask) {
|
|
9
|
+
this.webCachingTask = webCachingTask;
|
|
10
|
+
}
|
|
11
|
+
get bytes() {
|
|
12
|
+
return this.webCachingTask.bytes;
|
|
13
|
+
}
|
|
14
|
+
get bytesCached() {
|
|
15
|
+
return this.webCachingTask.bytesCached;
|
|
16
|
+
}
|
|
17
|
+
get cached() {
|
|
18
|
+
return fromTimeRanges(this.webCachingTask.cached);
|
|
19
|
+
}
|
|
20
|
+
get duration() {
|
|
21
|
+
return this.webCachingTask.duration;
|
|
22
|
+
}
|
|
23
|
+
get id() {
|
|
24
|
+
return this.webCachingTask.id;
|
|
25
|
+
}
|
|
26
|
+
get license() {
|
|
27
|
+
return this.webCachingTask.license;
|
|
28
|
+
}
|
|
29
|
+
get parameters() {
|
|
30
|
+
return this.webCachingTask.parameters;
|
|
31
|
+
}
|
|
32
|
+
get percentageCached() {
|
|
33
|
+
return this.webCachingTask.percentageCached;
|
|
34
|
+
}
|
|
35
|
+
get secondsCached() {
|
|
36
|
+
return this.webCachingTask.secondsCached;
|
|
37
|
+
}
|
|
38
|
+
get source() {
|
|
39
|
+
return this.webCachingTask.source;
|
|
40
|
+
}
|
|
41
|
+
get status() {
|
|
42
|
+
return this.webCachingTask.status;
|
|
43
|
+
}
|
|
44
|
+
start() {
|
|
45
|
+
this.webCachingTask.start();
|
|
46
|
+
}
|
|
47
|
+
pause() {
|
|
48
|
+
this.webCachingTask.pause();
|
|
49
|
+
}
|
|
50
|
+
remove() {
|
|
51
|
+
this.webCachingTask.remove();
|
|
52
|
+
}
|
|
53
|
+
addEventListener(type, listener) {
|
|
54
|
+
this.webCachingTask.addEventListener(type, listener);
|
|
55
|
+
}
|
|
56
|
+
removeEventListener(type, listener) {
|
|
57
|
+
this.webCachingTask.removeEventListener(type, listener);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
exports.WebCachingTaskAdapter = WebCachingTaskAdapter;
|
|
61
|
+
function fromTimeRanges(timeRanges) {
|
|
62
|
+
const result = [];
|
|
63
|
+
for (let i = 0; i < timeRanges.length; i++) {
|
|
64
|
+
result.push({
|
|
65
|
+
start: timeRanges.start(i) * 1e3,
|
|
66
|
+
end: timeRanges.end(i) * 1e3
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
return result;
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=WebCachingTaskAdapter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["WebCachingTaskAdapter","constructor","webCachingTask","bytes","bytesCached","cached","fromTimeRanges","duration","id","license","parameters","percentageCached","secondsCached","source","status","start","pause","remove","addEventListener","type","listener","removeEventListener","exports","timeRanges","result","i","length","push","end"],"sources":["WebCachingTaskAdapter.ts"],"sourcesContent":["import type {\n CachingTask,\n CachingTaskEventMap,\n CachingTaskLicense,\n CachingTaskParameters,\n SourceDescription,\n TimeRange,\n} from 'react-native-theoplayer';\n\nimport type { CachingTask as WebCachingTask, CachingTaskEventMap as WebCachingTaskEventMap } from 'theoplayer';\nimport type { CacheTaskStatus } from 'react-native-theoplayer';\nimport type { StringKeyOf } from '../../api/event/EventDispatcher';\nimport type { EventListener } from '../../api/event/EventListener';\n\nexport class WebCachingTaskAdapter implements CachingTask {\n constructor(private webCachingTask: WebCachingTask) {}\n\n get bytes(): number {\n return this.webCachingTask.bytes;\n }\n\n get bytesCached(): number {\n return this.webCachingTask.bytesCached;\n }\n\n get cached(): TimeRange[] {\n return fromTimeRanges(this.webCachingTask.cached);\n }\n\n get duration(): number {\n return this.webCachingTask.duration;\n }\n\n get id(): string {\n return this.webCachingTask.id;\n }\n\n get license(): CachingTaskLicense {\n return this.webCachingTask.license;\n }\n\n get parameters(): CachingTaskParameters {\n return this.webCachingTask.parameters;\n }\n\n get percentageCached(): number {\n return this.webCachingTask.percentageCached;\n }\n\n get secondsCached(): number {\n return this.webCachingTask.secondsCached;\n }\n\n get source(): SourceDescription {\n return this.webCachingTask.source as SourceDescription;\n }\n\n get status(): CacheTaskStatus {\n return this.webCachingTask.status as CacheTaskStatus;\n }\n\n start(): void {\n this.webCachingTask.start();\n }\n\n pause(): void {\n this.webCachingTask.pause();\n }\n\n remove(): void {\n this.webCachingTask.remove();\n }\n\n addEventListener<TType extends StringKeyOf<CachingTaskEventMap>>(type: TType[] | TType, listener: EventListener<CachingTaskEventMap[TType]>) {\n this.webCachingTask.addEventListener(type, listener as EventListener<WebCachingTaskEventMap[TType]>);\n }\n\n removeEventListener<TType extends StringKeyOf<CachingTaskEventMap>>(\n type: TType[] | TType,\n listener: EventListener<CachingTaskEventMap[TType]>,\n ): void {\n this.webCachingTask.removeEventListener(type, listener as EventListener<WebCachingTaskEventMap[TType]>);\n }\n}\n\nfunction fromTimeRanges(timeRanges: TimeRanges): TimeRange[] {\n const result: TimeRange[] = [];\n for (let i = 0; i < timeRanges.length; i++) {\n result.push({\n start: timeRanges.start(i) * 1e3,\n end: timeRanges.end(i) * 1e3,\n });\n }\n return result;\n}\n"],"mappings":";;;;;;AAcO,MAAMA,qBAAqB,CAAwB;EACxDC,WAAWA,CAASC,cAA8B,EAAE;IAAA,KAAhCA,cAA8B,GAA9BA,cAA8B;EAAG;EAErD,IAAIC,KAAKA,CAAA,EAAW;IAClB,OAAO,IAAI,CAACD,cAAc,CAACC,KAAK;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EAEAC,mBAAmBA,CACjBF,IAAqB,EACrBC,QAAmD,EAC7C;IACN,IAAI,CAAClB,cAAc,CAACmB,mBAAmB,CAACF,IAAI,EAAEC,QAAwD,CAAC;EACzG;AACF;AAACE,OAAA,CAAAtB,qBAAA,GAAAA,qBAAA;AAED,SAASM,cAAcA,CAACiB,UAAsB,EAAe;EAC3D,MAAMC,MAAmB,GAAG,EAAE;EAC9B,KAAK,IAAIC,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGF,UAAU,CAACG,MAAM,EAAED,CAAC,EAAE,EAAE;IAC1CD,MAAM,CAACG,IAAI,CAAC;MACVZ,KAAK,EAAEQ,UAAU,CAACR,KAAK,CAACU,CAAC,CAAC,GAAG,GAAG;MAChCG,GAAG,EAAEL,UAAU,CAACK,GAAG,CAACH,CAAC,CAAC,GAAG;IAC3B,CAAC,CAAC;EACJ;EACA,OAAOD,MAAM;AACf"}
|
|
@@ -172,6 +172,5 @@ class NativeContentProtectionRegistry {
|
|
|
172
172
|
}
|
|
173
173
|
}
|
|
174
174
|
exports.NativeContentProtectionRegistry = NativeContentProtectionRegistry;
|
|
175
|
-
const ContentProtectionRegistry = new NativeContentProtectionRegistry();
|
|
176
|
-
exports.ContentProtectionRegistry = ContentProtectionRegistry;
|
|
175
|
+
const ContentProtectionRegistry = exports.ContentProtectionRegistry = new NativeContentProtectionRegistry();
|
|
177
176
|
//# sourceMappingURL=ContentProtectionRegistry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","_NativeLicenseRequest","_NativeLicenseResponse","_NativeCertificateRequest","_NativeCertificateResponse","_TypeUtils","_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","arg","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","undefined","res","call","TypeError","Number","NativeContentProtectionRegistry","constructor","event","requestId","integrationId","keySystemId","drmConfig","console","log","factory","getFactory","currentIntegration","integration","build","NativeModules","ContentProtectionModule","onBuildProcessed","resultString","request","getIntegration","onCertificateRequest","result","fromNativeCertificateRequest","isBufferSource","nativeResponse","toNativeCertificateResponseResult","onCertificateRequestProcessedAsCertificate","modifiedNativeRequest","toNativeCertificateRequest","onCertificateRequestProcessedAsRequest","response","onCertificateResponse","responseResult","fromNativeCertificateResponse","modifiedNativeResponse","onCertificateResponseProcessed","onLicenseRequest","fromNativeLicenseRequest","toNativeLicenseResponseResult","onLicenseRequestProcessedAsLicense","toNativeLicenseRequest","onLicenseRequestProcessedAsRequest","onLicenseResponse","fromNativeLicenseResponse","onLicenseResponseProcessed","fairplaySkdUrl","extractFairplayContentId","contentId","onExtractFairplayContentIdProcessed","emitter","NativeEventEmitter","addListener","onBuildIntegrationRequest","onExtractFairplayContentId","registerContentProtectionIntegration","integrationFactory","registeredFactories","push","_this$registeredFacto","find","init","_this$currentIntegrat","_this$currentIntegrat2","_this$currentIntegrat3","exports","ContentProtectionRegistry"],"sources":["ContentProtectionRegistry.ts"],"sourcesContent":["import type { CertificateRequest, ContentProtectionAPI, DRMConfiguration, LicenseRequest } from 'react-native-theoplayer';\nimport type { KeySystemId } from 'react-native-theoplayer';\nimport type { ContentProtectionIntegrationFactory } from 'react-native-theoplayer';\nimport { NativeEventEmitter, NativeModules } from 'react-native';\nimport type { ContentProtectionIntegration } from 'react-native-theoplayer';\nimport type { NativeContentProtectionEvent } from './NativeContentProtectionEvent';\nimport { fromNativeLicenseRequest, NativeLicenseRequest, toNativeLicenseRequest } from './NativeLicenseRequest';\nimport { fromNativeLicenseResponse, NativeLicenseResponse, toNativeLicenseResponseResult } from './NativeLicenseResponse';\nimport { fromNativeCertificateRequest, NativeCertificateRequest, toNativeCertificateRequest } from './NativeCertificateRequest';\nimport { fromNativeCertificateResponse, NativeCertificateResponse, toNativeCertificateResponseResult } from './NativeCertificateResponse';\nimport { isBufferSource } from '../utils/TypeUtils';\n\ninterface WrappedContentProtectionIntegrationFactory {\n integrationId: string;\n keySystemId: string;\n integrationFactory: ContentProtectionIntegrationFactory;\n}\n\ninterface WrappedContentProtectionIntegration {\n integrationId: string;\n keySystemId: string;\n integration: ContentProtectionIntegration;\n}\n\ninterface BuildEvent extends NativeContentProtectionEvent {\n drmConfig: DRMConfiguration;\n}\n\ninterface ExtractFaiplayContentIdEvent extends NativeContentProtectionEvent {\n fairplaySkdUrl: string;\n}\n\nexport class NativeContentProtectionRegistry implements ContentProtectionAPI {\n private emitter: NativeEventEmitter;\n private registeredFactories: WrappedContentProtectionIntegrationFactory[] = [];\n private currentIntegration: WrappedContentProtectionIntegration | undefined = undefined;\n\n constructor() {\n this.emitter = new NativeEventEmitter(NativeModules.ContentProtectionModule);\n this.emitter.addListener('onBuildIntegration', this.onBuildIntegrationRequest);\n this.emitter.addListener('onCertificateRequest', this.onCertificateRequest);\n this.emitter.addListener('onCertificateResponse', this.onCertificateResponse);\n this.emitter.addListener('onLicenseRequest', this.onLicenseRequest);\n this.emitter.addListener('onLicenseResponse', this.onLicenseResponse);\n this.emitter.addListener('onExtractFairplayContentId', this.onExtractFairplayContentId);\n }\n\n registerContentProtectionIntegration(integrationId: string, keySystemId: KeySystemId, integrationFactory: ContentProtectionIntegrationFactory) {\n this.registeredFactories.push({\n integrationId,\n keySystemId,\n integrationFactory,\n });\n NativeModules.ContentProtectionModule.registerContentProtectionIntegration(integrationId, keySystemId);\n }\n\n private getFactory(integrationId: string, keySystemId: string): ContentProtectionIntegrationFactory | undefined {\n return this.registeredFactories.find((init) => init.integrationId === integrationId && init.keySystemId === keySystemId)?.integrationFactory;\n }\n\n private getIntegration(integrationId: string, keySystemId: string): ContentProtectionIntegration | undefined {\n return this.currentIntegration?.integrationId === integrationId && this.currentIntegration?.keySystemId === keySystemId\n ? this.currentIntegration?.integration\n : undefined;\n }\n\n private onBuildIntegrationRequest = (event: BuildEvent) => {\n const { requestId, integrationId, keySystemId, drmConfig } = event;\n console.log('ContentProtectionModule', `onBuildIntegrationRequest ${integrationId} ${keySystemId}`);\n const factory = this.getFactory(integrationId, keySystemId);\n if (factory) {\n this.currentIntegration = {\n integrationId,\n keySystemId,\n integration: factory.build(drmConfig),\n };\n NativeModules.ContentProtectionModule.onBuildProcessed({ requestId, resultString: 'success' });\n } else {\n NativeModules.ContentProtectionModule.onBuildProcessed({\n requestId,\n resultString: 'failed',\n });\n }\n };\n\n private onCertificateRequest = async (request: NativeCertificateRequest) => {\n const { requestId, integrationId, keySystemId } = request;\n console.log('ContentProtectionModule', `onCertificateRequest ${integrationId} ${keySystemId}`);\n const integration = this.getIntegration(integrationId, keySystemId);\n if (integration?.onCertificateRequest) {\n const result = await integration.onCertificateRequest(fromNativeCertificateRequest(request));\n // TODO: we also want to support ArrayBufferView results\n if (isBufferSource(result)) {\n const nativeResponse = toNativeCertificateResponseResult(requestId, integrationId, keySystemId, result as ArrayBuffer);\n NativeModules.ContentProtectionModule.onCertificateRequestProcessedAsCertificate(nativeResponse);\n } else if (result as CertificateRequest) {\n const modifiedNativeRequest = toNativeCertificateRequest(requestId, integrationId, keySystemId, result as CertificateRequest);\n NativeModules.ContentProtectionModule.onCertificateRequestProcessedAsRequest(modifiedNativeRequest);\n }\n } else {\n NativeModules.ContentProtectionModule.onCertificateRequestProcessedAsRequest(request);\n }\n };\n\n private onCertificateResponse = async (response: NativeCertificateResponse) => {\n const { requestId, integrationId, keySystemId } = response;\n console.log('ContentProtectionModule', `onCertificateResponse ${integrationId} ${keySystemId}`);\n const integration = this.getIntegration(integrationId, keySystemId);\n if (integration?.onCertificateResponse) {\n const responseResult = await integration.onCertificateResponse(fromNativeCertificateResponse(response));\n // TODO: we also want to support ArrayBufferView results\n const modifiedNativeResponse = toNativeCertificateResponseResult(requestId, integrationId, keySystemId, responseResult as ArrayBuffer);\n NativeModules.ContentProtectionModule.onCertificateResponseProcessed(modifiedNativeResponse);\n } else {\n NativeModules.ContentProtectionModule.onCertificateResponseProcessed(response);\n }\n };\n\n private onLicenseRequest = async (request: NativeLicenseRequest) => {\n const { requestId, integrationId, keySystemId } = request;\n console.log('ContentProtectionModule', `onLicenseRequest ${integrationId} ${keySystemId}`);\n const integration = this.getIntegration(integrationId, keySystemId);\n // Optionally let the custom integration modify the request.\n if (integration?.onLicenseRequest) {\n const result = await integration.onLicenseRequest(fromNativeLicenseRequest(request));\n // TODO: we also want to support ArrayBufferView results\n if (isBufferSource(result)) {\n const nativeResponse = toNativeLicenseResponseResult(requestId, integrationId, keySystemId, result as ArrayBuffer);\n NativeModules.ContentProtectionModule.onLicenseRequestProcessedAsLicense(nativeResponse);\n } else if (result as LicenseRequest) {\n const modifiedNativeRequest = toNativeLicenseRequest(requestId, integrationId, keySystemId, result as LicenseRequest);\n NativeModules.ContentProtectionModule.onLicenseRequestProcessedAsRequest(modifiedNativeRequest);\n }\n } else {\n NativeModules.ContentProtectionModule.onLicenseRequestProcessedAsRequest(request);\n }\n };\n\n private onLicenseResponse = async (response: NativeLicenseResponse) => {\n const { requestId, integrationId, keySystemId } = response;\n console.log('ContentProtectionModule', `onLicenseResponse ${integrationId} ${keySystemId}`);\n const integration = this.getIntegration(integrationId, keySystemId);\n if (integration?.onLicenseResponse) {\n const responseResult = await integration.onLicenseResponse(fromNativeLicenseResponse(response));\n // TODO: we also want to support ArrayBufferView results\n const modifiedNativeResponse = toNativeLicenseResponseResult(requestId, integrationId, keySystemId, responseResult as ArrayBuffer);\n NativeModules.ContentProtectionModule.onLicenseResponseProcessed(modifiedNativeResponse);\n } else {\n NativeModules.ContentProtectionModule.onLicenseResponseProcessed(response);\n }\n };\n\n private onExtractFairplayContentId = async (event: ExtractFaiplayContentIdEvent) => {\n const { integrationId, keySystemId, fairplaySkdUrl, requestId } = event;\n console.log('ContentProtectionModule', `onExtractFairplayContentId ${integrationId} ${keySystemId}`);\n const integration = this.getIntegration(integrationId, keySystemId);\n if (integration?.extractFairplayContentId) {\n const contentId = await integration.extractFairplayContentId(fairplaySkdUrl);\n NativeModules.ContentProtectionModule.onExtractFairplayContentIdProcessed({\n requestId,\n contentId,\n });\n } else {\n const contentId = fairplaySkdUrl;\n NativeModules.ContentProtectionModule.onExtractFairplayContentIdProcessed({\n requestId,\n contentId,\n });\n }\n };\n}\n\nexport const ContentProtectionRegistry = new NativeContentProtectionRegistry();\n"],"mappings":";;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAGA,IAAAC,qBAAA,GAAAD,OAAA;AACA,IAAAE,sBAAA,GAAAF,OAAA;AACA,IAAAG,yBAAA,GAAAH,OAAA;AACA,IAAAI,0BAAA,GAAAJ,OAAA;AACA,IAAAK,UAAA,GAAAL,OAAA;AAAoD,SAAAM,gBAAAC,GAAA,EAAAC,GAAA,EAAAC,KAAA,IAAAD,GAAA,GAAAE,cAAA,CAAAF,GAAA,OAAAA,GAAA,IAAAD,GAAA,IAAAI,MAAA,CAAAC,cAAA,CAAAL,GAAA,EAAAC,GAAA,IAAAC,KAAA,EAAAA,KAAA,EAAAI,UAAA,QAAAC,YAAA,QAAAC,QAAA,oBAAAR,GAAA,CAAAC,GAAA,IAAAC,KAAA,WAAAF,GAAA;AAAA,SAAAG,eAAAM,GAAA,QAAAR,GAAA,GAAAS,YAAA,CAAAD,GAAA,2BAAAR,GAAA,gBAAAA,GAAA,GAAAU,MAAA,CAAAV,GAAA;AAAA,SAAAS,aAAAE,KAAA,EAAAC,IAAA,eAAAD,KAAA,iBAAAA,KAAA,kBAAAA,KAAA,MAAAE,IAAA,GAAAF,KAAA,CAAAG,MAAA,CAAAC,WAAA,OAAAF,IAAA,KAAAG,SAAA,QAAAC,GAAA,GAAAJ,IAAA,CAAAK,IAAA,CAAAP,KAAA,EAAAC,IAAA,2BAAAK,GAAA,sBAAAA,GAAA,YAAAE,SAAA,4DAAAP,IAAA,gBAAAF,MAAA,GAAAU,MAAA,EAAAT,KAAA;AAsB7C,MAAMU,+BAA+B,CAAiC;EAK3EC,WAAWA,CAAA,EAAG;IAAAxB,eAAA;IAAAA,eAAA,8BAH8D,EAAE;IAAAA,eAAA,6BACAkB,SAAS;IAAAlB,eAAA,oCA+BlDyB,KAAiB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AvBA,sBAAA,CAAyBzD,WAAW,MAAKA,WAAW,IAAA0D,sBAAA,GACnH,IAAI,CAACpD,kBAAkB,cAAAoD,sBAAA,uBAAvBA,sBAAA,CAAyBnD,WAAW,GACpCjB,SAAS;EACf;AA0GF;AAACqE,OAAA,CAAAhE,+BAAA,GAAAA,+BAAA;AAEM,MAAMiE,yBAAyB,GAAG,IAAIjE,+BAA+B,EAAE;AAACgE,OAAA,CAAAC,yBAAA,GAAAA,yBAAA"}
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_NativeLicenseRequest","_NativeLicenseResponse","_NativeCertificateRequest","_NativeCertificateResponse","_TypeUtils","_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","arg","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","undefined","res","call","TypeError","Number","NativeContentProtectionRegistry","constructor","event","requestId","integrationId","keySystemId","drmConfig","console","log","factory","getFactory","currentIntegration","integration","build","NativeModules","ContentProtectionModule","onBuildProcessed","resultString","request","getIntegration","onCertificateRequest","result","fromNativeCertificateRequest","isBufferSource","nativeResponse","toNativeCertificateResponseResult","onCertificateRequestProcessedAsCertificate","modifiedNativeRequest","toNativeCertificateRequest","onCertificateRequestProcessedAsRequest","response","onCertificateResponse","responseResult","fromNativeCertificateResponse","modifiedNativeResponse","onCertificateResponseProcessed","onLicenseRequest","fromNativeLicenseRequest","toNativeLicenseResponseResult","onLicenseRequestProcessedAsLicense","toNativeLicenseRequest","onLicenseRequestProcessedAsRequest","onLicenseResponse","fromNativeLicenseResponse","onLicenseResponseProcessed","fairplaySkdUrl","extractFairplayContentId","contentId","onExtractFairplayContentIdProcessed","emitter","NativeEventEmitter","addListener","onBuildIntegrationRequest","onExtractFairplayContentId","registerContentProtectionIntegration","integrationFactory","registeredFactories","push","_this$registeredFacto","find","init","_this$currentIntegrat","_this$currentIntegrat2","_this$currentIntegrat3","exports","ContentProtectionRegistry"],"sources":["ContentProtectionRegistry.ts"],"sourcesContent":["import type { CertificateRequest, ContentProtectionAPI, DRMConfiguration, LicenseRequest } from 'react-native-theoplayer';\nimport type { KeySystemId } from 'react-native-theoplayer';\nimport type { ContentProtectionIntegrationFactory } from 'react-native-theoplayer';\nimport { NativeEventEmitter, NativeModules } from 'react-native';\nimport type { ContentProtectionIntegration } from 'react-native-theoplayer';\nimport type { NativeContentProtectionEvent } from './NativeContentProtectionEvent';\nimport { fromNativeLicenseRequest, NativeLicenseRequest, toNativeLicenseRequest } from './NativeLicenseRequest';\nimport { fromNativeLicenseResponse, NativeLicenseResponse, toNativeLicenseResponseResult } from './NativeLicenseResponse';\nimport { fromNativeCertificateRequest, NativeCertificateRequest, toNativeCertificateRequest } from './NativeCertificateRequest';\nimport { fromNativeCertificateResponse, NativeCertificateResponse, toNativeCertificateResponseResult } from './NativeCertificateResponse';\nimport { isBufferSource } from '../utils/TypeUtils';\n\ninterface WrappedContentProtectionIntegrationFactory {\n integrationId: string;\n keySystemId: string;\n integrationFactory: ContentProtectionIntegrationFactory;\n}\n\ninterface WrappedContentProtectionIntegration {\n integrationId: string;\n keySystemId: string;\n integration: ContentProtectionIntegration;\n}\n\ninterface BuildEvent extends NativeContentProtectionEvent {\n drmConfig: DRMConfiguration;\n}\n\ninterface ExtractFaiplayContentIdEvent extends NativeContentProtectionEvent {\n fairplaySkdUrl: string;\n}\n\nexport class NativeContentProtectionRegistry implements ContentProtectionAPI {\n private emitter: NativeEventEmitter;\n private registeredFactories: WrappedContentProtectionIntegrationFactory[] = [];\n private currentIntegration: WrappedContentProtectionIntegration | undefined = undefined;\n\n constructor() {\n this.emitter = new NativeEventEmitter(NativeModules.ContentProtectionModule);\n this.emitter.addListener('onBuildIntegration', this.onBuildIntegrationRequest);\n this.emitter.addListener('onCertificateRequest', this.onCertificateRequest);\n this.emitter.addListener('onCertificateResponse', this.onCertificateResponse);\n this.emitter.addListener('onLicenseRequest', this.onLicenseRequest);\n this.emitter.addListener('onLicenseResponse', this.onLicenseResponse);\n this.emitter.addListener('onExtractFairplayContentId', this.onExtractFairplayContentId);\n }\n\n registerContentProtectionIntegration(integrationId: string, keySystemId: KeySystemId, integrationFactory: ContentProtectionIntegrationFactory) {\n this.registeredFactories.push({\n integrationId,\n keySystemId,\n integrationFactory,\n });\n NativeModules.ContentProtectionModule.registerContentProtectionIntegration(integrationId, keySystemId);\n }\n\n private getFactory(integrationId: string, keySystemId: string): ContentProtectionIntegrationFactory | undefined {\n return this.registeredFactories.find((init) => init.integrationId === integrationId && init.keySystemId === keySystemId)?.integrationFactory;\n }\n\n private getIntegration(integrationId: string, keySystemId: string): ContentProtectionIntegration | undefined {\n return this.currentIntegration?.integrationId === integrationId && this.currentIntegration?.keySystemId === keySystemId\n ? this.currentIntegration?.integration\n : undefined;\n }\n\n private onBuildIntegrationRequest = (event: BuildEvent) => {\n const { requestId, integrationId, keySystemId, drmConfig } = event;\n console.log('ContentProtectionModule', `onBuildIntegrationRequest ${integrationId} ${keySystemId}`);\n const factory = this.getFactory(integrationId, keySystemId);\n if (factory) {\n this.currentIntegration = {\n integrationId,\n keySystemId,\n integration: factory.build(drmConfig),\n };\n NativeModules.ContentProtectionModule.onBuildProcessed({ requestId, resultString: 'success' });\n } else {\n NativeModules.ContentProtectionModule.onBuildProcessed({\n requestId,\n resultString: 'failed',\n });\n }\n };\n\n private onCertificateRequest = async (request: NativeCertificateRequest) => {\n const { requestId, integrationId, keySystemId } = request;\n console.log('ContentProtectionModule', `onCertificateRequest ${integrationId} ${keySystemId}`);\n const integration = this.getIntegration(integrationId, keySystemId);\n if (integration?.onCertificateRequest) {\n const result = await integration.onCertificateRequest(fromNativeCertificateRequest(request));\n // TODO: we also want to support ArrayBufferView results\n if (isBufferSource(result)) {\n const nativeResponse = toNativeCertificateResponseResult(requestId, integrationId, keySystemId, result as ArrayBuffer);\n NativeModules.ContentProtectionModule.onCertificateRequestProcessedAsCertificate(nativeResponse);\n } else if (result as CertificateRequest) {\n const modifiedNativeRequest = toNativeCertificateRequest(requestId, integrationId, keySystemId, result as CertificateRequest);\n NativeModules.ContentProtectionModule.onCertificateRequestProcessedAsRequest(modifiedNativeRequest);\n }\n } else {\n NativeModules.ContentProtectionModule.onCertificateRequestProcessedAsRequest(request);\n }\n };\n\n private onCertificateResponse = async (response: NativeCertificateResponse) => {\n const { requestId, integrationId, keySystemId } = response;\n console.log('ContentProtectionModule', `onCertificateResponse ${integrationId} ${keySystemId}`);\n const integration = this.getIntegration(integrationId, keySystemId);\n if (integration?.onCertificateResponse) {\n const responseResult = await integration.onCertificateResponse(fromNativeCertificateResponse(response));\n // TODO: we also want to support ArrayBufferView results\n const modifiedNativeResponse = toNativeCertificateResponseResult(requestId, integrationId, keySystemId, responseResult as ArrayBuffer);\n NativeModules.ContentProtectionModule.onCertificateResponseProcessed(modifiedNativeResponse);\n } else {\n NativeModules.ContentProtectionModule.onCertificateResponseProcessed(response);\n }\n };\n\n private onLicenseRequest = async (request: NativeLicenseRequest) => {\n const { requestId, integrationId, keySystemId } = request;\n console.log('ContentProtectionModule', `onLicenseRequest ${integrationId} ${keySystemId}`);\n const integration = this.getIntegration(integrationId, keySystemId);\n // Optionally let the custom integration modify the request.\n if (integration?.onLicenseRequest) {\n const result = await integration.onLicenseRequest(fromNativeLicenseRequest(request));\n // TODO: we also want to support ArrayBufferView results\n if (isBufferSource(result)) {\n const nativeResponse = toNativeLicenseResponseResult(requestId, integrationId, keySystemId, result as ArrayBuffer);\n NativeModules.ContentProtectionModule.onLicenseRequestProcessedAsLicense(nativeResponse);\n } else if (result as LicenseRequest) {\n const modifiedNativeRequest = toNativeLicenseRequest(requestId, integrationId, keySystemId, result as LicenseRequest);\n NativeModules.ContentProtectionModule.onLicenseRequestProcessedAsRequest(modifiedNativeRequest);\n }\n } else {\n NativeModules.ContentProtectionModule.onLicenseRequestProcessedAsRequest(request);\n }\n };\n\n private onLicenseResponse = async (response: NativeLicenseResponse) => {\n const { requestId, integrationId, keySystemId } = response;\n console.log('ContentProtectionModule', `onLicenseResponse ${integrationId} ${keySystemId}`);\n const integration = this.getIntegration(integrationId, keySystemId);\n if (integration?.onLicenseResponse) {\n const responseResult = await integration.onLicenseResponse(fromNativeLicenseResponse(response));\n // TODO: we also want to support ArrayBufferView results\n const modifiedNativeResponse = toNativeLicenseResponseResult(requestId, integrationId, keySystemId, responseResult as ArrayBuffer);\n NativeModules.ContentProtectionModule.onLicenseResponseProcessed(modifiedNativeResponse);\n } else {\n NativeModules.ContentProtectionModule.onLicenseResponseProcessed(response);\n }\n };\n\n private onExtractFairplayContentId = async (event: ExtractFaiplayContentIdEvent) => {\n const { integrationId, keySystemId, fairplaySkdUrl, requestId } = event;\n console.log('ContentProtectionModule', `onExtractFairplayContentId ${integrationId} ${keySystemId}`);\n const integration = this.getIntegration(integrationId, keySystemId);\n if (integration?.extractFairplayContentId) {\n const contentId = await integration.extractFairplayContentId(fairplaySkdUrl);\n NativeModules.ContentProtectionModule.onExtractFairplayContentIdProcessed({\n requestId,\n contentId,\n });\n } else {\n const contentId = fairplaySkdUrl;\n NativeModules.ContentProtectionModule.onExtractFairplayContentIdProcessed({\n requestId,\n contentId,\n });\n }\n };\n}\n\nexport const ContentProtectionRegistry = new NativeContentProtectionRegistry();\n"],"mappings":";;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAGA,IAAAC,qBAAA,GAAAD,OAAA;AACA,IAAAE,sBAAA,GAAAF,OAAA;AACA,IAAAG,yBAAA,GAAAH,OAAA;AACA,IAAAI,0BAAA,GAAAJ,OAAA;AACA,IAAAK,UAAA,GAAAL,OAAA;AAAoD,SAAAM,gBAAAC,GAAA,EAAAC,GAAA,EAAAC,KAAA,IAAAD,GAAA,GAAAE,cAAA,CAAAF,GAAA,OAAAA,GAAA,IAAAD,GAAA,IAAAI,MAAA,CAAAC,cAAA,CAAAL,GAAA,EAAAC,GAAA,IAAAC,KAAA,EAAAA,KAAA,EAAAI,UAAA,QAAAC,YAAA,QAAAC,QAAA,oBAAAR,GAAA,CAAAC,GAAA,IAAAC,KAAA,WAAAF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CAACuC,oCAAoC,CAAClD,aAAa,EAAEC,WAAW,CAAC;EACxG;EAEQK,UAAUA,CAACN,aAAqB,EAAEC,WAAmB,EAAmD;IAAA,IAAAqD,qBAAA;IAC9G,QAAAA,qBAAA,GAAO,IAAI,CAACF,mBAAmB,CAACG,IAAI,CAAEC,IAAI,IAAKA,IAAI,CAACxD,aAAa,KAAKA,aAAa,IAAIwD,IAAI,CAACvD,WAAW,KAAKA,WAAW,CAAC,cAAAqD,qBAAA,uBAAjHA,qBAAA,CAAmHH,kBAAkB;EAC9I;EAEQpC,cAAcA,CAACf,aAAqB,EAAEC,WAAmB,EAA4C;IAAA,IAAAwD,qBAAA,EAAAC,sBAAA,EAAAC,sBAAA;IAC3G,OAAO,EAAAF,qBAAA,OAAI,CAAClD,kBAAkB,cAAAkD,qBAAA,uBAAvBA,qBAAA,CAAyBzD,aAAa,MAAKA,aAAa,IAAI,EAAA0D,sBAAA,OAAI,CAACnD,kBAAkB,cAAAmD,sBAAA,uBAAvBA,sBAAA,CAAyBzD,WAAW,MAAKA,WAAW,IAAA0D,sBAAA,GACnH,IAAI,CAACpD,kBAAkB,cAAAoD,sBAAA,uBAAvBA,sBAAA,CAAyBnD,WAAW,GACpCjB,SAAS;EACf;AA0GF;AAACqE,OAAA,CAAAhE,+BAAA,GAAAA,+BAAA;AAEM,MAAMiE,yBAAyB,GAAAD,OAAA,CAAAC,yBAAA,GAAG,IAAIjE,+BAA+B,CAAC,CAAC"}
|
|
@@ -11,6 +11,5 @@ class WebContentProtectionRegistry {
|
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
13
|
exports.WebContentProtectionRegistry = WebContentProtectionRegistry;
|
|
14
|
-
const ContentProtectionRegistry = new WebContentProtectionRegistry();
|
|
15
|
-
exports.ContentProtectionRegistry = ContentProtectionRegistry;
|
|
14
|
+
const ContentProtectionRegistry = exports.ContentProtectionRegistry = new WebContentProtectionRegistry();
|
|
16
15
|
//# sourceMappingURL=ContentProtectionRegistry.web.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_theoplayer","require","WebContentProtectionRegistry","registerContentProtectionIntegration","integrationId","keySystem","integrationFactory","exports","ContentProtectionRegistry"],"sources":["ContentProtectionRegistry.web.ts"],"sourcesContent":["import type { ContentProtectionAPI, ContentProtectionIntegrationFactory, KeySystemId } from 'react-native-theoplayer';\nimport { registerContentProtectionIntegration } from 'theoplayer';\n\nexport class WebContentProtectionRegistry implements ContentProtectionAPI {\n registerContentProtectionIntegration(integrationId: string, keySystem: KeySystemId, integrationFactory: ContentProtectionIntegrationFactory): void {\n registerContentProtectionIntegration(integrationId, keySystem, integrationFactory);\n }\n}\n\nexport const ContentProtectionRegistry = new WebContentProtectionRegistry();\n"],"mappings":";;;;;;AACA,IAAAA,WAAA,GAAAC,OAAA;AAEO,MAAMC,4BAA4B,CAAiC;EACxEC,oCAAoCA,CAACC,aAAqB,EAAEC,SAAsB,EAAEC,kBAAuD,EAAQ;IACjJ,IAAAH,gDAAoC,EAACC,aAAa,EAAEC,SAAS,EAAEC,kBAAkB,CAAC;EACpF;AACF;AAACC,OAAA,CAAAL,4BAAA,GAAAA,4BAAA;AAEM,MAAMM,yBAAyB,
|
|
1
|
+
{"version":3,"names":["_theoplayer","require","WebContentProtectionRegistry","registerContentProtectionIntegration","integrationId","keySystem","integrationFactory","exports","ContentProtectionRegistry"],"sources":["ContentProtectionRegistry.web.ts"],"sourcesContent":["import type { ContentProtectionAPI, ContentProtectionIntegrationFactory, KeySystemId } from 'react-native-theoplayer';\nimport { registerContentProtectionIntegration } from 'theoplayer';\n\nexport class WebContentProtectionRegistry implements ContentProtectionAPI {\n registerContentProtectionIntegration(integrationId: string, keySystem: KeySystemId, integrationFactory: ContentProtectionIntegrationFactory): void {\n registerContentProtectionIntegration(integrationId, keySystem, integrationFactory);\n }\n}\n\nexport const ContentProtectionRegistry = new WebContentProtectionRegistry();\n"],"mappings":";;;;;;AACA,IAAAA,WAAA,GAAAC,OAAA;AAEO,MAAMC,4BAA4B,CAAiC;EACxEC,oCAAoCA,CAACC,aAAqB,EAAEC,SAAsB,EAAEC,kBAAuD,EAAQ;IACjJ,IAAAH,gDAAoC,EAACC,aAAa,EAAEC,SAAS,EAAEC,kBAAkB,CAAC;EACpF;AACF;AAACC,OAAA,CAAAL,4BAAA,GAAAA,4BAAA;AAEM,MAAMM,yBAAyB,GAAAD,OAAA,CAAAC,yBAAA,GAAG,IAAIN,4BAA4B,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_NativeCertificateRequest","require","_reactNativeTheoplayer","fromNativeCertificateResponse","response","url","status","statusText","headers","base64body","request","body","fromBase64StringToUint8Array","Uint8Array","fromNativeCertificateRequest","toNativeCertificateResponseResult","requestId","integrationId","keySystemId","fromUint8ArrayToBase64String"],"sources":["NativeCertificateResponse.ts"],"sourcesContent":["import type { NativeContentProtectionEvent } from './NativeContentProtectionEvent';\nimport type { CertificateResponse } from 'react-native-theoplayer';\nimport type { NativeCertificateRequest } from './NativeCertificateRequest';\nimport { fromNativeCertificateRequest } from './NativeCertificateRequest';\nimport { fromBase64StringToUint8Array, fromUint8ArrayToBase64String } from 'react-native-theoplayer';\n\nexport interface NativeCertificateResponse extends NativeContentProtectionEvent {\n url: string;\n status: number;\n statusText: string;\n headers: { [headerName: string]: string };\n base64body: string;\n request: NativeCertificateRequest;\n}\n\nexport interface NativeCertificateResponseResult extends NativeContentProtectionEvent {\n base64body: string;\n}\n\nexport function fromNativeCertificateResponse(response: NativeCertificateResponse): CertificateResponse {\n const { url, status, statusText, headers, base64body, request } = response;\n const body = base64body ? fromBase64StringToUint8Array(base64body) : new Uint8Array();\n return {\n url,\n status,\n statusText,\n headers,\n body,\n request: fromNativeCertificateRequest(request),\n };\n}\n\nexport function toNativeCertificateResponseResult(\n requestId: string,\n integrationId: string,\n keySystemId: string,\n response: ArrayBuffer,\n): NativeCertificateResponseResult {\n return {\n requestId,\n integrationId,\n keySystemId,\n base64body: response ? fromUint8ArrayToBase64String(new Uint8Array(response)) : '',\n };\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,yBAAA,GAAAC,OAAA;AACA,IAAAC,sBAAA,GAAAD,OAAA;AAeO,SAASE,6BAA6BA,CAACC,QAAmC,EAAuB;EACtG,MAAM;IAAEC,GAAG;IAAEC,MAAM;IAAEC,UAAU;IAAEC,OAAO;IAAEC,UAAU;IAAEC;EAAQ,CAAC,GAAGN,QAAQ;EAC1E,MAAMO,IAAI,GAAGF,UAAU,GAAG,IAAAG,mDAA4B,EAACH,UAAU,CAAC,GAAG,IAAII,UAAU,
|
|
1
|
+
{"version":3,"names":["_NativeCertificateRequest","require","_reactNativeTheoplayer","fromNativeCertificateResponse","response","url","status","statusText","headers","base64body","request","body","fromBase64StringToUint8Array","Uint8Array","fromNativeCertificateRequest","toNativeCertificateResponseResult","requestId","integrationId","keySystemId","fromUint8ArrayToBase64String"],"sources":["NativeCertificateResponse.ts"],"sourcesContent":["import type { NativeContentProtectionEvent } from './NativeContentProtectionEvent';\nimport type { CertificateResponse } from 'react-native-theoplayer';\nimport type { NativeCertificateRequest } from './NativeCertificateRequest';\nimport { fromNativeCertificateRequest } from './NativeCertificateRequest';\nimport { fromBase64StringToUint8Array, fromUint8ArrayToBase64String } from 'react-native-theoplayer';\n\nexport interface NativeCertificateResponse extends NativeContentProtectionEvent {\n url: string;\n status: number;\n statusText: string;\n headers: { [headerName: string]: string };\n base64body: string;\n request: NativeCertificateRequest;\n}\n\nexport interface NativeCertificateResponseResult extends NativeContentProtectionEvent {\n base64body: string;\n}\n\nexport function fromNativeCertificateResponse(response: NativeCertificateResponse): CertificateResponse {\n const { url, status, statusText, headers, base64body, request } = response;\n const body = base64body ? fromBase64StringToUint8Array(base64body) : new Uint8Array();\n return {\n url,\n status,\n statusText,\n headers,\n body,\n request: fromNativeCertificateRequest(request),\n };\n}\n\nexport function toNativeCertificateResponseResult(\n requestId: string,\n integrationId: string,\n keySystemId: string,\n response: ArrayBuffer,\n): NativeCertificateResponseResult {\n return {\n requestId,\n integrationId,\n keySystemId,\n base64body: response ? fromUint8ArrayToBase64String(new Uint8Array(response)) : '',\n };\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,yBAAA,GAAAC,OAAA;AACA,IAAAC,sBAAA,GAAAD,OAAA;AAeO,SAASE,6BAA6BA,CAACC,QAAmC,EAAuB;EACtG,MAAM;IAAEC,GAAG;IAAEC,MAAM;IAAEC,UAAU;IAAEC,OAAO;IAAEC,UAAU;IAAEC;EAAQ,CAAC,GAAGN,QAAQ;EAC1E,MAAMO,IAAI,GAAGF,UAAU,GAAG,IAAAG,mDAA4B,EAACH,UAAU,CAAC,GAAG,IAAII,UAAU,CAAC,CAAC;EACrF,OAAO;IACLR,GAAG;IACHC,MAAM;IACNC,UAAU;IACVC,OAAO;IACPG,IAAI;IACJD,OAAO,EAAE,IAAAI,sDAA4B,EAACJ,OAAO;EAC/C,CAAC;AACH;AAEO,SAASK,iCAAiCA,CAC/CC,SAAiB,EACjBC,aAAqB,EACrBC,WAAmB,EACnBd,QAAqB,EACY;EACjC,OAAO;IACLY,SAAS;IACTC,aAAa;IACbC,WAAW;IACXT,UAAU,EAAEL,QAAQ,GAAG,IAAAe,mDAA4B,EAAC,IAAIN,UAAU,CAACT,QAAQ,CAAC,CAAC,GAAG;EAClF,CAAC;AACH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_NativeLicenseRequest","require","_reactNativeTheoplayer","fromNativeLicenseResponse","response","url","status","statusText","headers","base64body","request","body","fromBase64StringToUint8Array","Uint8Array","fromNativeLicenseRequest","toNativeLicenseResponseResult","requestId","integrationId","keySystemId","fromUint8ArrayToBase64String"],"sources":["NativeLicenseResponse.ts"],"sourcesContent":["import type { NativeContentProtectionEvent } from './NativeContentProtectionEvent';\nimport type { LicenseResponse } from 'react-native-theoplayer';\nimport type { NativeLicenseRequest } from './NativeLicenseRequest';\nimport { fromNativeLicenseRequest } from './NativeLicenseRequest';\nimport { fromBase64StringToUint8Array, fromUint8ArrayToBase64String } from 'react-native-theoplayer';\n\nexport interface NativeLicenseResponse extends NativeContentProtectionEvent {\n url: string;\n status: number;\n statusText: string;\n headers: { [headerName: string]: string };\n base64body: string;\n request: NativeLicenseRequest;\n}\n\nexport interface NativeLicenseResponseResult extends NativeContentProtectionEvent {\n base64body: string;\n}\n\nexport function fromNativeLicenseResponse(response: NativeLicenseResponse): LicenseResponse {\n const { url, status, statusText, headers, base64body, request } = response;\n const body = base64body ? fromBase64StringToUint8Array(base64body) : new Uint8Array();\n return {\n url,\n status,\n statusText,\n headers,\n body,\n request: fromNativeLicenseRequest(request),\n };\n}\n\nexport function toNativeLicenseResponseResult(\n requestId: string,\n integrationId: string,\n keySystemId: string,\n response: ArrayBuffer,\n): NativeLicenseResponseResult {\n return {\n requestId,\n integrationId,\n keySystemId,\n base64body: response ? fromUint8ArrayToBase64String(new Uint8Array(response)) : '',\n };\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,qBAAA,GAAAC,OAAA;AACA,IAAAC,sBAAA,GAAAD,OAAA;AAeO,SAASE,yBAAyBA,CAACC,QAA+B,EAAmB;EAC1F,MAAM;IAAEC,GAAG;IAAEC,MAAM;IAAEC,UAAU;IAAEC,OAAO;IAAEC,UAAU;IAAEC;EAAQ,CAAC,GAAGN,QAAQ;EAC1E,MAAMO,IAAI,GAAGF,UAAU,GAAG,IAAAG,mDAA4B,EAACH,UAAU,CAAC,GAAG,IAAII,UAAU,
|
|
1
|
+
{"version":3,"names":["_NativeLicenseRequest","require","_reactNativeTheoplayer","fromNativeLicenseResponse","response","url","status","statusText","headers","base64body","request","body","fromBase64StringToUint8Array","Uint8Array","fromNativeLicenseRequest","toNativeLicenseResponseResult","requestId","integrationId","keySystemId","fromUint8ArrayToBase64String"],"sources":["NativeLicenseResponse.ts"],"sourcesContent":["import type { NativeContentProtectionEvent } from './NativeContentProtectionEvent';\nimport type { LicenseResponse } from 'react-native-theoplayer';\nimport type { NativeLicenseRequest } from './NativeLicenseRequest';\nimport { fromNativeLicenseRequest } from './NativeLicenseRequest';\nimport { fromBase64StringToUint8Array, fromUint8ArrayToBase64String } from 'react-native-theoplayer';\n\nexport interface NativeLicenseResponse extends NativeContentProtectionEvent {\n url: string;\n status: number;\n statusText: string;\n headers: { [headerName: string]: string };\n base64body: string;\n request: NativeLicenseRequest;\n}\n\nexport interface NativeLicenseResponseResult extends NativeContentProtectionEvent {\n base64body: string;\n}\n\nexport function fromNativeLicenseResponse(response: NativeLicenseResponse): LicenseResponse {\n const { url, status, statusText, headers, base64body, request } = response;\n const body = base64body ? fromBase64StringToUint8Array(base64body) : new Uint8Array();\n return {\n url,\n status,\n statusText,\n headers,\n body,\n request: fromNativeLicenseRequest(request),\n };\n}\n\nexport function toNativeLicenseResponseResult(\n requestId: string,\n integrationId: string,\n keySystemId: string,\n response: ArrayBuffer,\n): NativeLicenseResponseResult {\n return {\n requestId,\n integrationId,\n keySystemId,\n base64body: response ? fromUint8ArrayToBase64String(new Uint8Array(response)) : '',\n };\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,qBAAA,GAAAC,OAAA;AACA,IAAAC,sBAAA,GAAAD,OAAA;AAeO,SAASE,yBAAyBA,CAACC,QAA+B,EAAmB;EAC1F,MAAM;IAAEC,GAAG;IAAEC,MAAM;IAAEC,UAAU;IAAEC,OAAO;IAAEC,UAAU;IAAEC;EAAQ,CAAC,GAAGN,QAAQ;EAC1E,MAAMO,IAAI,GAAGF,UAAU,GAAG,IAAAG,mDAA4B,EAACH,UAAU,CAAC,GAAG,IAAII,UAAU,CAAC,CAAC;EACrF,OAAO;IACLR,GAAG;IACHC,MAAM;IACNC,UAAU;IACVC,OAAO;IACPG,IAAI;IACJD,OAAO,EAAE,IAAAI,8CAAwB,EAACJ,OAAO;EAC3C,CAAC;AACH;AAEO,SAASK,6BAA6BA,CAC3CC,SAAiB,EACjBC,aAAqB,EACrBC,WAAmB,EACnBd,QAAqB,EACQ;EAC7B,OAAO;IACLY,SAAS;IACTC,aAAa;IACbC,WAAW;IACXT,UAAU,EAAEL,QAAQ,GAAG,IAAAe,mDAA4B,EAAC,IAAIN,UAAU,CAACT,QAAQ,CAAC,CAAC,GAAG;EAClF,CAAC;AACH"}
|
|
@@ -21,14 +21,12 @@ function decodeNanInf(v) {
|
|
|
21
21
|
}
|
|
22
22
|
return v;
|
|
23
23
|
}
|
|
24
|
-
const objectToString = {}.toString;
|
|
25
|
-
exports.objectToString = objectToString;
|
|
24
|
+
const objectToString = exports.objectToString = {}.toString;
|
|
26
25
|
const viewClasses = ['[object Int8Array]', '[object Uint8Array]', '[object Uint8ClampedArray]', '[object Int16Array]', '[object Uint16Array]', '[object Int32Array]', '[object Uint32Array]', '[object Float32Array]', '[object Float64Array]', '[object DataView]'];
|
|
27
26
|
function arrayContainsElement_(array, element) {
|
|
28
27
|
return array.indexOf(element) !== -1;
|
|
29
28
|
}
|
|
30
|
-
const isArrayBufferView_ = ArrayBuffer.isView || (obj => obj && arrayContainsElement_(viewClasses, objectToString.call(obj)));
|
|
31
|
-
exports.isArrayBufferView_ = isArrayBufferView_;
|
|
29
|
+
const isArrayBufferView_ = exports.isArrayBufferView_ = ArrayBuffer.isView || (obj => obj && arrayContainsElement_(viewClasses, objectToString.call(obj)));
|
|
32
30
|
function isBufferSource(bufferSource) {
|
|
33
31
|
return bufferSource instanceof ArrayBuffer || isArrayBufferView_(bufferSource);
|
|
34
32
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["NAN_VALUE","POS_INF_VALUE","decodeNanInf","v","NaN","Infinity","objectToString","
|
|
1
|
+
{"version":3,"names":["NAN_VALUE","POS_INF_VALUE","decodeNanInf","v","NaN","Infinity","objectToString","exports","toString","viewClasses","arrayContainsElement_","array","element","indexOf","isArrayBufferView_","ArrayBuffer","isView","obj","call","isBufferSource","bufferSource"],"sources":["TypeUtils.ts"],"sourcesContent":["const NAN_VALUE = -1;\nconst POS_INF_VALUE = -2;\n\n// We can't send INF and NaN values over the bridge, so convert if necessary.\nexport function decodeNanInf(v: number): number {\n if (v === NAN_VALUE) {\n return NaN;\n }\n if (v === POS_INF_VALUE) {\n return Infinity;\n }\n return v;\n}\n\nexport const objectToString = {}.toString;\n\nconst viewClasses = [\n '[object Int8Array]',\n '[object Uint8Array]',\n '[object Uint8ClampedArray]',\n '[object Int16Array]',\n '[object Uint16Array]',\n '[object Int32Array]',\n '[object Uint32Array]',\n '[object Float32Array]',\n '[object Float64Array]',\n '[object DataView]',\n];\n\nexport function arrayContainsElement_<T>(array: ReadonlyArray<T>, element: T): boolean {\n return array.indexOf(element) !== -1;\n}\n\nexport const isArrayBufferView_: typeof ArrayBuffer.isView =\n ArrayBuffer.isView || ((obj) => obj && arrayContainsElement_(viewClasses, objectToString.call(obj)));\n\nexport function isBufferSource(bufferSource: any): bufferSource is BufferSource {\n return bufferSource instanceof ArrayBuffer || isArrayBufferView_(bufferSource);\n}\n"],"mappings":";;;;;;;;;;AAAA,MAAMA,SAAS,GAAG,CAAC,CAAC;AACpB,MAAMC,aAAa,GAAG,CAAC,CAAC;;AAExB;AACO,SAASC,YAAYA,CAACC,CAAS,EAAU;EAC9C,IAAIA,CAAC,KAAKH,SAAS,EAAE;IACnB,OAAOI,GAAG;EACZ;EACA,IAAID,CAAC,KAAKF,aAAa,EAAE;IACvB,OAAOI,QAAQ;EACjB;EACA,OAAOF,CAAC;AACV;AAEO,MAAMG,cAAc,GAAAC,OAAA,CAAAD,cAAA,GAAG,CAAC,CAAC,CAACE,QAAQ;AAEzC,MAAMC,WAAW,GAAG,CAClB,oBAAoB,EACpB,qBAAqB,EACrB,4BAA4B,EAC5B,qBAAqB,EACrB,sBAAsB,EACtB,qBAAqB,EACrB,sBAAsB,EACtB,uBAAuB,EACvB,uBAAuB,EACvB,mBAAmB,CACpB;AAEM,SAASC,qBAAqBA,CAAIC,KAAuB,EAAEC,OAAU,EAAW;EACrF,OAAOD,KAAK,CAACE,OAAO,CAACD,OAAO,CAAC,KAAK,CAAC,CAAC;AACtC;AAEO,MAAME,kBAA6C,GAAAP,OAAA,CAAAO,kBAAA,GACxDC,WAAW,CAACC,MAAM,KAAMC,GAAG,IAAKA,GAAG,IAAIP,qBAAqB,CAACD,WAAW,EAAEH,cAAc,CAACY,IAAI,CAACD,GAAG,CAAC,CAAC,CAAC;AAE/F,SAASE,cAAcA,CAACC,YAAiB,EAAgC;EAC9E,OAAOA,YAAY,YAAYL,WAAW,IAAID,kBAAkB,CAACM,YAAY,CAAC;AAChF"}
|
|
@@ -6,16 +6,34 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @public
|
|
8
8
|
*/
|
|
9
|
-
export let ABRStrategyType
|
|
9
|
+
export let ABRStrategyType = /*#__PURE__*/function (ABRStrategyType) {
|
|
10
|
+
ABRStrategyType["performance"] = "performance";
|
|
11
|
+
ABRStrategyType["quality"] = "quality";
|
|
12
|
+
ABRStrategyType["bandwidth"] = "bandwidth";
|
|
13
|
+
return ABRStrategyType;
|
|
14
|
+
}({});
|
|
10
15
|
|
|
11
16
|
/**
|
|
12
17
|
* Describes the metadata of the adaptive bitrate strategy.
|
|
13
18
|
*
|
|
14
19
|
* @public
|
|
15
20
|
*/
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Describes the configuration of the adaptive bitrate strategy.
|
|
24
|
+
*
|
|
25
|
+
* @public
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* The adaptive bitrate stratey.
|
|
30
|
+
*
|
|
31
|
+
* @public
|
|
32
|
+
*/
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Describes the adaptive bitrate configuration.
|
|
36
|
+
*
|
|
37
|
+
* @public
|
|
38
|
+
*/
|
|
21
39
|
//# sourceMappingURL=ABRConfiguration.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ABRStrategyType"],"sources":["ABRConfiguration.ts"],"sourcesContent":["/**\n * The adaptive bitrate strategy of the first segment, represented by a value from the following list:\n * <br/> - `'performance'`: The player will optimize ABR behavior to focus on the performance of the player. This strategy initiates playback with the lowest quality suitable for the device which means faster start-up time.\n * <br/> - `'quality'`: The player will optimize ABR behavior to focus displaying the best visual quality to the end-user. This strategy initiates playback with the highest bit rate suitable for the device.\n * <br/> - `'bandwidth'`: The player will optimize the ABR behavior to focus on displaying the most optimal quality based on historic data of available bandwidth and knowledge of the network conditions.\n *\n * @public\n */\nexport enum ABRStrategyType {\n performance = 'performance',\n quality = 'quality',\n bandwidth = 'bandwidth',\n}\n\n/**\n * Describes the metadata of the adaptive bitrate strategy.\n *\n * @public\n */\nexport interface ABRMetadata {\n /**\n * The initial bitrate, in bits per second.\n *\n * @defaultValue Bitrate available to the browser.\n */\n bitrate?: number;\n}\n\n/**\n * Describes the configuration of the adaptive bitrate strategy.\n *\n * @public\n */\nexport interface ABRStrategyConfiguration {\n /**\n * The strategy for initial playback.\n */\n type: ABRStrategyType;\n\n /**\n * The metadata for the initial playback strategy.\n *\n * @defaultValue A {@link ABRMetadata} object with default values.\n */\n metadata?: ABRMetadata;\n}\n\n/**\n * The adaptive bitrate stratey.\n *\n * @public\n */\nexport type ABRStrategy = ABRStrategyConfiguration | ABRStrategyType;\n\n/**\n * Describes the adaptive bitrate configuration.\n *\n * @public\n */\nexport interface ABRConfiguration {\n /**\n * The adaptive bitrate strategy.\n *\n * @defaultValue `'bandwidth'`\n */\n strategy?: ABRStrategy;\n\n /**\n * The amount which the player should buffer ahead of the current playback position, in seconds.\n *\n * @remarks\n * <br/> - Before v4.3.0: This duration has a maximum of 60 seconds.\n * <br/> - After v4.3.0: This duration has no maximum.\n * <br/> - The player might reduce or ignore the configured amount because of device or performance constraints.\n *\n * @defaultValue `20`\n */\n targetBuffer?: number;\n\n /**\n * The amount of data which the player should keep in its buffer before the current playback position, in seconds.\n * This configuration option can be used to reduce the memory footprint on memory restricted devices or on devices\n * which don't automatically prune decoder buffers.\n *\n * Note that the player can decide to keep less data in the decoder buffer in case memory is running low.\n * A value of 0 or lower is not accepted and will be treated as default.\n *\n * @defaultValue `30`\n *\n * @remarks\n * <br/> - This property is currently supported on Web platforms only.\n */\n bufferLookbackWindow?: number;\n\n /**\n * The maximum length of the player's buffer, in seconds.\n *\n * The player will initially buffer up to {@link ABRConfiguration.targetBuffer} seconds of media data.\n * If the player detects that the decoder is unable to hold so much data,\n * it will reduce `maxBufferLength` and restrict `targetBuffer` to be less than\n * this maximum.\n *\n * @remarks\n * <br/> - This property is currently supported on Web platforms only.\n */\n readonly maxBufferLength?: number;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAYA,eAAe
|
|
1
|
+
{"version":3,"names":["ABRStrategyType"],"sources":["ABRConfiguration.ts"],"sourcesContent":["/**\n * The adaptive bitrate strategy of the first segment, represented by a value from the following list:\n * <br/> - `'performance'`: The player will optimize ABR behavior to focus on the performance of the player. This strategy initiates playback with the lowest quality suitable for the device which means faster start-up time.\n * <br/> - `'quality'`: The player will optimize ABR behavior to focus displaying the best visual quality to the end-user. This strategy initiates playback with the highest bit rate suitable for the device.\n * <br/> - `'bandwidth'`: The player will optimize the ABR behavior to focus on displaying the most optimal quality based on historic data of available bandwidth and knowledge of the network conditions.\n *\n * @public\n */\nexport enum ABRStrategyType {\n performance = 'performance',\n quality = 'quality',\n bandwidth = 'bandwidth',\n}\n\n/**\n * Describes the metadata of the adaptive bitrate strategy.\n *\n * @public\n */\nexport interface ABRMetadata {\n /**\n * The initial bitrate, in bits per second.\n *\n * @defaultValue Bitrate available to the browser.\n */\n bitrate?: number;\n}\n\n/**\n * Describes the configuration of the adaptive bitrate strategy.\n *\n * @public\n */\nexport interface ABRStrategyConfiguration {\n /**\n * The strategy for initial playback.\n */\n type: ABRStrategyType;\n\n /**\n * The metadata for the initial playback strategy.\n *\n * @defaultValue A {@link ABRMetadata} object with default values.\n */\n metadata?: ABRMetadata;\n}\n\n/**\n * The adaptive bitrate stratey.\n *\n * @public\n */\nexport type ABRStrategy = ABRStrategyConfiguration | ABRStrategyType;\n\n/**\n * Describes the adaptive bitrate configuration.\n *\n * @public\n */\nexport interface ABRConfiguration {\n /**\n * The adaptive bitrate strategy.\n *\n * @defaultValue `'bandwidth'`\n */\n strategy?: ABRStrategy;\n\n /**\n * The amount which the player should buffer ahead of the current playback position, in seconds.\n *\n * @remarks\n * <br/> - Before v4.3.0: This duration has a maximum of 60 seconds.\n * <br/> - After v4.3.0: This duration has no maximum.\n * <br/> - The player might reduce or ignore the configured amount because of device or performance constraints.\n *\n * @defaultValue `20`\n */\n targetBuffer?: number;\n\n /**\n * The amount of data which the player should keep in its buffer before the current playback position, in seconds.\n * This configuration option can be used to reduce the memory footprint on memory restricted devices or on devices\n * which don't automatically prune decoder buffers.\n *\n * Note that the player can decide to keep less data in the decoder buffer in case memory is running low.\n * A value of 0 or lower is not accepted and will be treated as default.\n *\n * @defaultValue `30`\n *\n * @remarks\n * <br/> - This property is currently supported on Web platforms only.\n */\n bufferLookbackWindow?: number;\n\n /**\n * The maximum length of the player's buffer, in seconds.\n *\n * The player will initially buffer up to {@link ABRConfiguration.targetBuffer} seconds of media data.\n * If the player detects that the decoder is unable to hold so much data,\n * it will reduce `maxBufferLength` and restrict `targetBuffer` to be less than\n * this maximum.\n *\n * @remarks\n * <br/> - This property is currently supported on Web platforms only.\n */\n readonly maxBufferLength?: number;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAYA,eAAe,0BAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAA,OAAfA,eAAe;AAAA;;AAM3B;AACA;AACA;AACA;AACA;;AAUA;AACA;AACA;AACA;AACA;;AAeA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["GoogleImaConfiguration.ts"],"sourcesContent":["/**\n * Describes the configuration of Google IMA.\n *\n * @internal\n */\nexport interface GoogleImaConfiguration {\n /**\n * Whether the native (mobile) IMA implementation will be used.\n *\n * @internal\n */\n useNativeIma: boolean;\n}\n"],"mappings":""}
|
|
1
|
+
{"version":3,"names":[],"sources":["GoogleImaConfiguration.ts"],"sourcesContent":["/**\n * Describes the configuration of Google IMA.\n *\n * @internal\n */\nexport interface GoogleImaConfiguration {\n /**\n * Whether the native (mobile) IMA implementation will be used.\n *\n * @deprecated This property applies to native web-based player SDKs and will be removed.\n * @internal\n */\n useNativeIma: boolean;\n}\n"],"mappings":""}
|
package/lib/module/api/barrel.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["barrel.ts"],"sourcesContent":["export * from './abr/barrel';\nexport * from './ads/barrel';\nexport * from './cast/barrel';\nexport * from './pip/barrel';\nexport * from './config/barrel';\nexport * from './error/barrel';\nexport * from './event/barrel';\nexport * from './media/barrel';\nexport * from './drm/barrel';\nexport * from './source/barrel';\nexport * from './timeranges/barrel';\nexport * from './track/barrel';\nexport * from './utils/barrel';\nexport * from './THEOplayerView';\nexport * from './player/barrel';\nexport * from './presentation/barrel';\n"],"mappings":"AAAA,cAAc,cAAc;AAC5B,cAAc,cAAc;AAC5B,cAAc,eAAe;AAC7B,cAAc,cAAc;AAC5B,cAAc,iBAAiB;AAC/B,cAAc,gBAAgB;AAC9B,cAAc,gBAAgB;AAC9B,cAAc,gBAAgB;AAC9B,cAAc,cAAc;AAC5B,cAAc,iBAAiB;AAC/B,cAAc,qBAAqB;AACnC,cAAc,gBAAgB;AAC9B,cAAc,gBAAgB;AAC9B,cAAc,kBAAkB;AAChC,cAAc,iBAAiB;AAC/B,cAAc,uBAAuB"}
|
|
1
|
+
{"version":3,"names":[],"sources":["barrel.ts"],"sourcesContent":["export * from './abr/barrel';\nexport * from './ads/barrel';\nexport * from './cache/barrel';\nexport * from './cast/barrel';\nexport * from './pip/barrel';\nexport * from './config/barrel';\nexport * from './error/barrel';\nexport * from './event/barrel';\nexport * from './media/barrel';\nexport * from './drm/barrel';\nexport * from './source/barrel';\nexport * from './timeranges/barrel';\nexport * from './track/barrel';\nexport * from './utils/barrel';\nexport * from './THEOplayerView';\nexport * from './player/barrel';\nexport * from './presentation/barrel';\n"],"mappings":"AAAA,cAAc,cAAc;AAC5B,cAAc,cAAc;AAC5B,cAAc,gBAAgB;AAC9B,cAAc,eAAe;AAC7B,cAAc,cAAc;AAC5B,cAAc,iBAAiB;AAC/B,cAAc,gBAAgB;AAC9B,cAAc,gBAAgB;AAC9B,cAAc,gBAAgB;AAC9B,cAAc,cAAc;AAC5B,cAAc,iBAAiB;AAC/B,cAAc,qBAAqB;AACnC,cAAc,gBAAgB;AAC9B,cAAc,gBAAgB;AAC9B,cAAc,kBAAkB;AAChC,cAAc,iBAAiB;AAC/B,cAAc,uBAAuB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["CachingPreferredTrackSelection.ts"],"sourcesContent":["/**\n * The preferred track selection.\n *\n * @public\n */\nexport interface CachingPreferredTrackSelection {\n /**\n * The list of language tags that indicates the preferred audio tracks to be cached.\n *\n * An empty array will result to picking the first available track.\n */\n audioTrackSelection: string[];\n\n /**\n * The expiration date of the cached data.\n *\n * @remarks\n * <br/> - Must be a date in the future.\n * <br/> - Data might be removed by the browser if it runs out of disk space.\n *\n * @defaultValue 30 minutes after starting the caching task.\n */\n textTrackSelection?: string[];\n}\n"],"mappings":""}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The cache task status, represented by a value from the following list:
|
|
3
|
+
* <br/> - `'idle'`: The task has been created, but has not started downloading content.
|
|
4
|
+
* <br/> - `'loading'`: The task is currently downloading the content.
|
|
5
|
+
* <br/> - `'done'`: The task has finished downloading all content.
|
|
6
|
+
* <br/> - `'error'`: The task has encountered an error while downloading or evicting content.
|
|
7
|
+
* <br/> - `'evicted'`: All data associated with the task has been removed because the task expired or the user invoked the {@link CachingTask.remove|remove} method.
|
|
8
|
+
*
|
|
9
|
+
* @public
|
|
10
|
+
*/
|
|
11
|
+
export let CacheTaskStatus = /*#__PURE__*/function (CacheTaskStatus) {
|
|
12
|
+
CacheTaskStatus["idle"] = "idle";
|
|
13
|
+
CacheTaskStatus["loading"] = "loading";
|
|
14
|
+
CacheTaskStatus["done"] = "done";
|
|
15
|
+
CacheTaskStatus["error"] = "error";
|
|
16
|
+
CacheTaskStatus["evicted"] = "evicted";
|
|
17
|
+
return CacheTaskStatus;
|
|
18
|
+
}({});
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Represents a caching task.
|
|
22
|
+
*
|
|
23
|
+
* @public
|
|
24
|
+
*/
|
|
25
|
+
//# sourceMappingURL=CachingTask.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["CacheTaskStatus"],"sources":["CachingTask.ts"],"sourcesContent":["import type { SourceDescription } from 'react-native-theoplayer';\nimport type { EventDispatcher } from '../event/EventDispatcher';\nimport type { CachingTaskLicense } from './CachingTaskLicense';\nimport type { CachingTaskParameters } from './CachingTaskParameters';\nimport type { CachingTaskEventMap } from './events/CachingTaskEvent';\nimport type { TimeRange } from '../timeranges/TimeRange';\n/**\n * The cache task status, represented by a value from the following list:\n * <br/> - `'idle'`: The task has been created, but has not started downloading content.\n * <br/> - `'loading'`: The task is currently downloading the content.\n * <br/> - `'done'`: The task has finished downloading all content.\n * <br/> - `'error'`: The task has encountered an error while downloading or evicting content.\n * <br/> - `'evicted'`: All data associated with the task has been removed because the task expired or the user invoked the {@link CachingTask.remove|remove} method.\n *\n * @public\n */\nexport enum CacheTaskStatus {\n idle = 'idle',\n loading = 'loading',\n done = 'done',\n error = 'error',\n evicted = 'evicted',\n}\n\n/**\n * Represents a caching task.\n *\n * @public\n */\nexport interface CachingTask extends EventDispatcher<CachingTaskEventMap> {\n /**\n * The generated identifier for the task.\n */\n readonly id: string;\n\n /**\n * The current status of the task.\n */\n readonly status: CacheTaskStatus;\n\n /**\n * The media source associated with the task.\n */\n readonly source: SourceDescription;\n\n /**\n * The configuration of the task.\n */\n readonly parameters: CachingTaskParameters;\n\n /**\n * The requested cached duration of the media, in seconds.\n */\n readonly duration: number;\n\n /**\n * The time ranges cached, in milliseconds.\n */\n readonly cached: TimeRange[];\n\n /**\n * The duration cached, in seconds.\n */\n readonly secondsCached: number;\n\n /**\n * The percentage cached, a value between 0 and 1.\n */\n readonly percentageCached: number;\n\n /**\n * The estimation of the amount this task will download and store, in bytes.\n *\n * @remarks\n * <br/> - Available only on Web and Android.\n * <br/> - Returns -1 if the estimate is not available yet.\n */\n readonly bytes: number;\n\n /**\n * The amount downloaded and stored, in bytes.\n */\n readonly bytesCached: number;\n\n /**\n * The API for license related queries and operations\n */\n readonly license: CachingTaskLicense;\n\n /**\n * Start caching the media.\n */\n start(): void;\n\n /**\n * Remove the cached media.\n */\n remove(): void;\n\n /**\n * Pause caching the media.\n *\n * @remarks\n * <br/> - A paused task can be resumed with {@link CachingTask.start}.\n */\n pause(): void;\n}\n"],"mappings":"AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAYA,eAAe,0BAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAA,OAAfA,eAAe;AAAA;;AAQ3B;AACA;AACA;AACA;AACA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["CachingTaskLicense.ts"],"sourcesContent":["/**\n * The {@link CachingTask}'s license API.\n *\n * @public\n */\nimport type { DRMConfiguration } from 'react-native-theoplayer';\n\nexport interface CachingTaskLicense {\n /**\n * Renew all the licenses associated with this task.\n *\n * @param drmConfiguration - The DRM configuration used for license renewals. Defaults to the DRM configuration of the original sourceDescription when omitted.\n */\n renew(drmConfiguration?: DRMConfiguration): void;\n}\n"],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["CachingTaskList.ts"],"sourcesContent":["/**\n * List of caching tasks.\n *\n * @public\n */\nimport type { CachingTask } from './CachingTask';\n\nexport type CachingTaskList = CachingTask[];\n"],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["CachingTaskParameters.ts"],"sourcesContent":["import type { CachingPreferredTrackSelection } from \"./CachingPreferredTrackSelection\";\n\n/**\n * Describes the configuration of a caching task.\n *\n * @public\n */\nexport interface CachingTaskParameters {\n /**\n * The amount of data to cache for the given stream.\n *\n * @remarks\n * <br/> - Available only on Web and Android. On iOS this value we always be '100%'.\n *\n * Possible formats:\n * <br/> - A number in seconds.\n * <br/> - A percentage string (XX%) for a proportion of the content duration.\n *\n */\n readonly amount: number | string;\n\n /**\n * The expiration date of the cached data.\n *\n * @remarks\n * <br/> - Must be a date in the future.\n * <br/> - Data might be removed by the browser if it runs out of disk space.\n *\n * @defaultValue 30 minutes after starting the caching task.\n */\n readonly expirationDate?: Date;\n\n /**\n * Upper bandwidth limit of the quality to cache.\n *\n * @remarks\n * <br/> - This will take the quality with the highest bandwidth that is lower than the specified bandwidth.\n * <br/> - It should be a value between zero and infinity.\n *\n * @defaultValue Infinity\n */\n readonly bandwidth?: number;\n\n /**\n * The preferred audio/text tracks to cache.\n *\n * @remarks\n * <br/> - Available only on iOS and Android.\n * <br/> - By default, the first track will be picked.\n */\n readonly preferredTrackSelection?: CachingPreferredTrackSelection;\n\n /**\n * An indication of whether the data should be cached on a cellular network, or only on WIFI. Defaults to true.\n *\n * @remarks\n * <br/> - Available only on iOS.\n * <br/> - The value can not be changed on a scheduled asset.\n * <br/> - If the download is scheduled/started on WIFI-only mode, and suddenly we would like allow Cellular Network download too, the `CachingTask` has to be removed and scheduled again with the new `CachingParamaters`.\n */\n readonly allowsCellularAccess?: boolean;\n}\n"],"mappings":""}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The cache status, represented by a value from the following list:
|
|
3
|
+
* <br/> - `'uninitialised'`: Previously stored caching tasks are unavailable.
|
|
4
|
+
* <br/> - `'initialised'`: Previously stored caching tasks are now available.
|
|
5
|
+
*
|
|
6
|
+
* @public
|
|
7
|
+
*/
|
|
8
|
+
export let CacheStatus = /*#__PURE__*/function (CacheStatus) {
|
|
9
|
+
CacheStatus["uninitialised"] = "uninitialised";
|
|
10
|
+
CacheStatus["initialised"] = "initialised";
|
|
11
|
+
return CacheStatus;
|
|
12
|
+
}({});
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* The media cache API.
|
|
16
|
+
*
|
|
17
|
+
* @public
|
|
18
|
+
*/
|
|
19
|
+
//# sourceMappingURL=MediaCacheAPI.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["CacheStatus"],"sources":["MediaCacheAPI.ts"],"sourcesContent":["import type { EventDispatcher } from '../event/EventDispatcher';\nimport type { SourceDescription } from 'react-native-theoplayer';\nimport type { CachingTaskParameters } from './CachingTaskParameters';\nimport type { CachingTask } from './CachingTask';\nimport type { CacheEventMap } from './events/CacheEvent';\nimport type { CachingTaskList } from './CachingTaskList';\n\n/**\n * The cache status, represented by a value from the following list:\n * <br/> - `'uninitialised'`: Previously stored caching tasks are unavailable.\n * <br/> - `'initialised'`: Previously stored caching tasks are now available.\n *\n * @public\n */\nexport enum CacheStatus {\n uninitialised = 'uninitialised',\n initialised = 'initialised',\n}\n\n/**\n * The media cache API.\n *\n * @public\n */\nexport interface MediaCacheAPI extends EventDispatcher<CacheEventMap> {\n /**\n * List of caching tasks which control the caching of media.\n */\n readonly tasks: CachingTaskList;\n\n /**\n * The current status of the cache.\n */\n readonly status: CacheStatus;\n\n /**\n * Create a caching task which controls the caching of media.\n *\n * @param source - Describes the media source to be cached.\n * @param parameters - Contains caching task related options.\n */\n createTask(source: SourceDescription, parameters: CachingTaskParameters): Promise<CachingTask>;\n}\n"],"mappings":"AAOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAYA,WAAW,0BAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAA,OAAXA,WAAW;AAAA;;AAKvB;AACA;AACA;AACA;AACA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from './CachingTask';
|
|
2
|
+
export * from './CachingTaskLicense';
|
|
3
|
+
export * from './CachingTaskList';
|
|
4
|
+
export * from './CachingTaskParameters';
|
|
5
|
+
export * from './MediaCacheAPI';
|
|
6
|
+
export * from './events/barrel';
|
|
7
|
+
export * from './hooks/barrel';
|
|
8
|
+
//# sourceMappingURL=barrel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["barrel.ts"],"sourcesContent":["export * from './CachingTask';\nexport * from './CachingTaskLicense';\nexport * from './CachingTaskList';\nexport * from './CachingTaskParameters';\nexport * from './MediaCacheAPI';\nexport * from './events/barrel';\nexport * from './hooks/barrel';\n"],"mappings":"AAAA,cAAc,eAAe;AAC7B,cAAc,sBAAsB;AACpC,cAAc,mBAAmB;AACjC,cAAc,yBAAyB;AACvC,cAAc,iBAAiB;AAC/B,cAAc,iBAAiB;AAC/B,cAAc,gBAAgB"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export let CacheEventType = /*#__PURE__*/function (CacheEventType) {
|
|
2
|
+
CacheEventType["statechange"] = "statechange";
|
|
3
|
+
CacheEventType["addtask"] = "addtask";
|
|
4
|
+
CacheEventType["removetask"] = "removetask";
|
|
5
|
+
return CacheEventType;
|
|
6
|
+
}({});
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* The events dispatched by the {@link Cache | cache API}.
|
|
10
|
+
*
|
|
11
|
+
* @public
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Dispatched when a caching task is added.
|
|
16
|
+
*
|
|
17
|
+
* @public
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Dispatched when a caching task is removed.
|
|
22
|
+
*
|
|
23
|
+
* @public
|
|
24
|
+
*/
|
|
25
|
+
//# sourceMappingURL=CacheEvent.js.map
|