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
|
@@ -12,7 +12,7 @@ import type { PresentationMode } from '../presentation/PresentationMode';
|
|
|
12
12
|
import type { PiPConfiguration } from '../pip/PiPConfiguration';
|
|
13
13
|
import type { BackgroundAudioConfiguration } from '../backgroundAudio/BackgroundAudioConfiguration';
|
|
14
14
|
import type { PlayerVersion } from './PlayerVersion';
|
|
15
|
-
export
|
|
15
|
+
export type PreloadType = 'none' | 'metadata' | 'auto' | '';
|
|
16
16
|
/**
|
|
17
17
|
* Specifies an aspect ratio for the player.
|
|
18
18
|
*
|
|
@@ -28,7 +28,7 @@ export declare enum AspectRatio {
|
|
|
28
28
|
FILL = "fill",
|
|
29
29
|
ASPECT_FILL = "aspectFill"
|
|
30
30
|
}
|
|
31
|
-
export
|
|
31
|
+
export type NativeHandleType = unknown;
|
|
32
32
|
/**
|
|
33
33
|
* The THEOplayer API.
|
|
34
34
|
*/
|
|
@@ -13,7 +13,7 @@ import type { AdDescription } from './ads/Ads';
|
|
|
13
13
|
import type { MetadataDescription } from './metadata/MetadataDescription';
|
|
14
14
|
import type { ServerSideAdInsertionConfiguration } from "./ads/ssai/ServerSideAdInsertionConfiguration";
|
|
15
15
|
import type { AnalyticsDescription } from "./analytics/AnalyticsDescription";
|
|
16
|
-
export
|
|
16
|
+
export type Source = TypedSource;
|
|
17
17
|
/**
|
|
18
18
|
* A media resource or list of media resources.
|
|
19
19
|
*
|
|
@@ -22,7 +22,7 @@ export declare type Source = TypedSource;
|
|
|
22
22
|
*
|
|
23
23
|
* @public
|
|
24
24
|
*/
|
|
25
|
-
export
|
|
25
|
+
export type Sources = Source | Source[];
|
|
26
26
|
/**
|
|
27
27
|
* The cross-origin setting of a source, represented by a value from the following list:
|
|
28
28
|
* <br/> - `'anonymous'`: CORS requests will have the credentials flag set to 'same-origin'.
|
|
@@ -34,7 +34,7 @@ export declare type Sources = Source | Source[];
|
|
|
34
34
|
*
|
|
35
35
|
* @public
|
|
36
36
|
*/
|
|
37
|
-
export
|
|
37
|
+
export type CrossOriginSetting = '' | 'anonymous' | 'use-credentials';
|
|
38
38
|
/**
|
|
39
39
|
* Describes the configuration of a player's source.
|
|
40
40
|
*
|
|
@@ -8,7 +8,7 @@ import type { AdDescription, AdIntegrationKind } from "./Ads";
|
|
|
8
8
|
*
|
|
9
9
|
* @public
|
|
10
10
|
*/
|
|
11
|
-
export
|
|
11
|
+
export type FreeWheelAdUnitType = 'preroll' | 'midroll' | 'postroll' | 'overlay';
|
|
12
12
|
/**
|
|
13
13
|
* Represents a FreeWheel cue.
|
|
14
14
|
*
|
|
@@ -5,7 +5,7 @@ import type { ServerSideAdInsertionConfiguration } from './ServerSideAdInsertion
|
|
|
5
5
|
*
|
|
6
6
|
* @public
|
|
7
7
|
*/
|
|
8
|
-
export
|
|
8
|
+
export type GoogleDAISSAIIntegrationID = 'google-dai';
|
|
9
9
|
/**
|
|
10
10
|
* The type of the stream requested from Google DAI, represented by a value from the following list:
|
|
11
11
|
* <br/> - `'live'`: The requested stream is a live stream.
|
|
@@ -13,7 +13,7 @@ export declare type GoogleDAISSAIIntegrationID = 'google-dai';
|
|
|
13
13
|
*
|
|
14
14
|
* @public
|
|
15
15
|
*/
|
|
16
|
-
export
|
|
16
|
+
export type DAIAvailabilityType = 'vod' | 'live';
|
|
17
17
|
/**
|
|
18
18
|
* Represents a configuration for server-side ad insertion with the Google DAI pre-integration.
|
|
19
19
|
*
|
|
@@ -5,7 +5,7 @@ import type { ServerSideAdInsertionConfiguration } from './ServerSideAdInsertion
|
|
|
5
5
|
*
|
|
6
6
|
* @public
|
|
7
7
|
*/
|
|
8
|
-
export
|
|
8
|
+
export type ImagineSSAIIntegrationID = 'imagine';
|
|
9
9
|
/**
|
|
10
10
|
* Describes the SSAI configuration of the Imagine integration.
|
|
11
11
|
*
|
|
@@ -9,7 +9,7 @@ import type { ImagineSSAIIntegrationID } from './ImagineServerSideAdInsertionCon
|
|
|
9
9
|
*
|
|
10
10
|
* @public
|
|
11
11
|
*/
|
|
12
|
-
export
|
|
12
|
+
export type SSAIIntegrationId = YospaceSSAIIntegrationID | GoogleDAISSAIIntegrationID | ImagineSSAIIntegrationID;
|
|
13
13
|
/**
|
|
14
14
|
* Represents a configuration for server-side ad insertion (SSAI).
|
|
15
15
|
*
|
|
@@ -5,7 +5,7 @@ import type { TypedSource } from '../../SourceDescription';
|
|
|
5
5
|
*
|
|
6
6
|
* @public
|
|
7
7
|
*/
|
|
8
|
-
export
|
|
8
|
+
export type YospaceSSAIIntegrationID = 'yospace';
|
|
9
9
|
/**
|
|
10
10
|
* The type of the Yospace stream, represented by a value from the following list:
|
|
11
11
|
* <br/> - `'live'`: The stream is a live stream.
|
|
@@ -15,7 +15,7 @@ export declare type YospaceSSAIIntegrationID = 'yospace';
|
|
|
15
15
|
*
|
|
16
16
|
* @public
|
|
17
17
|
*/
|
|
18
|
-
export
|
|
18
|
+
export type YospaceStreamType = 'vod' | 'live' | 'livepause' | 'nonlinear';
|
|
19
19
|
/**
|
|
20
20
|
* Represents a configuration for server-side ad insertion with the Yospace pre-integration.
|
|
21
21
|
*
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
*
|
|
11
11
|
* @public
|
|
12
12
|
*/
|
|
13
|
-
export
|
|
13
|
+
export type SeamlessPeriodSwitchStrategy = 'auto' | 'always' | 'never';
|
|
14
14
|
/**
|
|
15
15
|
* Represents a configuration for controlling playback of an MPEG-DASH stream.
|
|
16
16
|
*
|
|
@@ -95,7 +95,7 @@ export interface KeySystemConfiguration {
|
|
|
95
95
|
*
|
|
96
96
|
* @public
|
|
97
97
|
*/
|
|
98
|
-
export
|
|
98
|
+
export type LicenseType = 'temporary' | 'persistent';
|
|
99
99
|
/**
|
|
100
100
|
* Describes the FairPlay key system configuration.
|
|
101
101
|
*
|
|
@@ -123,7 +123,7 @@ export interface PlayReadyKeySystemConfiguration extends KeySystemConfiguration
|
|
|
123
123
|
*
|
|
124
124
|
* @public
|
|
125
125
|
*/
|
|
126
|
-
export
|
|
126
|
+
export type WidevineKeySystemConfiguration = KeySystemConfiguration;
|
|
127
127
|
/**
|
|
128
128
|
* Describes the ClearKey key system configuration.
|
|
129
129
|
*
|
|
@@ -229,4 +229,4 @@ export interface DRMConfiguration {
|
|
|
229
229
|
*
|
|
230
230
|
* @public
|
|
231
231
|
*/
|
|
232
|
-
export
|
|
232
|
+
export type KeySystemId = 'widevine' | 'fairplay' | 'playready';
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
*
|
|
19
19
|
* @public
|
|
20
20
|
*/
|
|
21
|
-
export
|
|
21
|
+
export type HlsDiscontinuityAlignment = 'auto' | 'playlist' | 'media';
|
|
22
22
|
/**
|
|
23
23
|
* Represents a configuration for controlling playback of an MPEG-DASH stream.
|
|
24
24
|
*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Track } from './Track';
|
|
2
2
|
import type { Quality } from './Quality';
|
|
3
|
-
export
|
|
3
|
+
export type MediaTrackKind = 'main' | 'alternative';
|
|
4
4
|
/**
|
|
5
5
|
* Represents a media track (audio or video) of a media resource.
|
|
6
6
|
*
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { THEOplayerViewProps } from 'react-native-theoplayer';
|
|
3
|
-
export declare function THEOplayerView(props: React.PropsWithChildren<THEOplayerViewProps>): JSX.Element;
|
|
3
|
+
export declare function THEOplayerView(props: React.PropsWithChildren<THEOplayerViewProps>): React.JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DefaultEventDispatcher } from './event/DefaultEventDispatcher';
|
|
2
2
|
import type { AdsAPI, CastAPI, MediaTrack, NativeHandleType, PlayerConfiguration, PlayerEventMap, PlayerVersion, PreloadType, TextTrack, TextTrackStyle, THEOplayer } from 'react-native-theoplayer';
|
|
3
3
|
import { AspectRatio, PresentationMode } from 'react-native-theoplayer';
|
|
4
|
-
import
|
|
4
|
+
import { ChromelessPlayer as NativeChromelessPlayer } from 'theoplayer';
|
|
5
5
|
import type { ABRConfiguration, SourceDescription } from 'src/api/barrel';
|
|
6
6
|
import type { PiPConfiguration } from 'src/api/pip/PiPConfiguration';
|
|
7
7
|
import type { BackgroundAudioConfiguration } from 'src/api/backgroundAudio/BackgroundAudioConfiguration';
|
|
@@ -15,7 +15,7 @@ export declare class THEOplayerWebAdapter extends DefaultEventDispatcher<PlayerE
|
|
|
15
15
|
private _targetVideoQuality;
|
|
16
16
|
private _backgroundAudioConfiguration;
|
|
17
17
|
private _pipConfiguration;
|
|
18
|
-
constructor(player:
|
|
18
|
+
constructor(player: NativeChromelessPlayer, config?: PlayerConfiguration);
|
|
19
19
|
get abr(): ABRConfiguration | undefined;
|
|
20
20
|
get source(): SourceDescription | undefined;
|
|
21
21
|
set source(source: SourceDescription | undefined);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import type { ChromelessPlayer } from 'theoplayer';
|
|
2
2
|
import type { THEOplayerWebAdapter } from './THEOplayerWebAdapter';
|
|
3
3
|
export declare class WebEventForwarder {
|
|
4
4
|
private readonly _player;
|
|
5
5
|
private readonly _facade;
|
|
6
|
-
constructor(player:
|
|
6
|
+
constructor(player: ChromelessPlayer, facade: THEOplayerWebAdapter);
|
|
7
7
|
private addEventListeners;
|
|
8
8
|
unload(): void;
|
|
9
9
|
private removeEventListeners;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { Ad, AdBreak, AdDescription, AdsAPI, GoogleDAI } from 'react-native-theoplayer';
|
|
2
|
-
import type
|
|
2
|
+
import type { ChromelessPlayer } from 'theoplayer';
|
|
3
3
|
export declare class THEOplayerWebAdsAdapter implements AdsAPI {
|
|
4
4
|
private readonly _player;
|
|
5
5
|
private _dai;
|
|
6
|
-
constructor(player:
|
|
6
|
+
constructor(player: ChromelessPlayer);
|
|
7
7
|
currentAdBreak(): Promise<AdBreak>;
|
|
8
8
|
currentAds(): Promise<Ad[]>;
|
|
9
9
|
playing(): Promise<boolean>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { Airplay, CastAPI, Chromecast } from 'react-native-theoplayer';
|
|
2
|
-
import type
|
|
2
|
+
import type { ChromelessPlayer } from 'theoplayer';
|
|
3
3
|
export declare class THEOplayerWebCastAdapter implements CastAPI {
|
|
4
4
|
private readonly _player;
|
|
5
|
-
constructor(player:
|
|
5
|
+
constructor(player: ChromelessPlayer);
|
|
6
6
|
get casting(): boolean;
|
|
7
7
|
get chromecast(): Chromecast | undefined;
|
|
8
8
|
get airplay(): Airplay | undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { CastState, ChromecastError } from 'react-native-theoplayer';
|
|
2
2
|
import type { CastEventType } from 'react-native-theoplayer';
|
|
3
|
-
export
|
|
3
|
+
export type NativeCastEvent = NativeChromecastChangeEvent | NativeAirplayStateChangeEvent | NativeChromecastErrorEvent;
|
|
4
4
|
export interface NativeChromecastChangeEvent {
|
|
5
5
|
readonly type: CastEventType.CHROMECAST_STATE_CHANGE;
|
|
6
6
|
readonly state: CastState;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import type { PlayerEventMap } from 'react-native-theoplayer';
|
|
2
2
|
import { PresentationMode } from 'react-native-theoplayer';
|
|
3
|
-
import type
|
|
3
|
+
import type { ChromelessPlayer } from 'theoplayer';
|
|
4
4
|
import type { DefaultEventDispatcher } from '../event/DefaultEventDispatcher';
|
|
5
5
|
export declare class WebPresentationModeManager {
|
|
6
6
|
private readonly _player;
|
|
7
7
|
private _presentationMode;
|
|
8
8
|
private _element;
|
|
9
9
|
private _eventForwarder;
|
|
10
|
-
constructor(player:
|
|
10
|
+
constructor(player: ChromelessPlayer, eventForwarder: DefaultEventDispatcher<PlayerEventMap>);
|
|
11
11
|
get presentationMode(): PresentationMode;
|
|
12
12
|
set presentationMode(presentationMode: PresentationMode);
|
|
13
13
|
private prepareForPresentationModeChanges;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { CacheStatus, MediaCacheAPI } from '../../api/cache/MediaCacheAPI';
|
|
2
|
+
import type { CachingTaskList } from '../../api/cache/CachingTaskList';
|
|
3
|
+
import { DefaultEventDispatcher } from '../adapter/event/DefaultEventDispatcher';
|
|
4
|
+
import type { CacheEventMap } from '../../api/cache/events/CacheEvent';
|
|
5
|
+
import type { SourceDescription } from 'react-native-theoplayer';
|
|
6
|
+
import type { CachingTaskParameters } from '../../api/cache/CachingTaskParameters';
|
|
7
|
+
import type { CachingTask } from '../../api/cache/CachingTask';
|
|
8
|
+
export declare class NativeMediaCache extends DefaultEventDispatcher<CacheEventMap> implements MediaCacheAPI {
|
|
9
|
+
private _emitter;
|
|
10
|
+
private _status;
|
|
11
|
+
private _tasks;
|
|
12
|
+
constructor();
|
|
13
|
+
createTask(source: SourceDescription, parameters: CachingTaskParameters): Promise<CachingTask>;
|
|
14
|
+
get status(): CacheStatus;
|
|
15
|
+
get tasks(): CachingTaskList;
|
|
16
|
+
private initialize;
|
|
17
|
+
private getInitialState;
|
|
18
|
+
private onCacheStatusChange;
|
|
19
|
+
private onAddCachingTaskEvent;
|
|
20
|
+
private onRemoveCachingTaskEvent;
|
|
21
|
+
private onCachingTaskProgressEvent;
|
|
22
|
+
private onCachingTaskStatusChangeEvent;
|
|
23
|
+
private taskById;
|
|
24
|
+
}
|
|
25
|
+
export declare const MediaCache: NativeMediaCache;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { CacheStatus, MediaCacheAPI } from 'react-native-theoplayer';
|
|
2
|
+
import type { CachingTaskList } from 'react-native-theoplayer';
|
|
3
|
+
import { DefaultEventDispatcher } from '../adapter/event/DefaultEventDispatcher';
|
|
4
|
+
import type { CacheEventMap } from 'react-native-theoplayer';
|
|
5
|
+
import type { SourceDescription } from 'react-native-theoplayer';
|
|
6
|
+
import type { CachingTaskParameters } from 'react-native-theoplayer';
|
|
7
|
+
import type { CachingTask } from 'react-native-theoplayer';
|
|
8
|
+
export declare class WebMediaCache extends DefaultEventDispatcher<CacheEventMap> implements MediaCacheAPI {
|
|
9
|
+
constructor();
|
|
10
|
+
private onAddTask;
|
|
11
|
+
private onRemoveTask;
|
|
12
|
+
createTask(source: SourceDescription, parameters: CachingTaskParameters): Promise<CachingTask>;
|
|
13
|
+
get status(): CacheStatus;
|
|
14
|
+
get tasks(): CachingTaskList;
|
|
15
|
+
}
|
|
16
|
+
export declare const MediaCache: WebMediaCache;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { DefaultEventDispatcher } from '../adapter/event/DefaultEventDispatcher';
|
|
2
|
+
import type { CachingTask, CachingTaskEventMap, CachingTaskLicense, CachingTaskParameters, SourceDescription, TimeRange } from 'react-native-theoplayer';
|
|
3
|
+
import type { CacheTaskStatus } from 'react-native-theoplayer';
|
|
4
|
+
import { NativeCachingTaskParameters } from "./NativeCachingTaskParametersAdapter";
|
|
5
|
+
export interface NativeCachingTask {
|
|
6
|
+
readonly id: string;
|
|
7
|
+
readonly status: CacheTaskStatus;
|
|
8
|
+
readonly source: SourceDescription;
|
|
9
|
+
readonly parameters: NativeCachingTaskParameters;
|
|
10
|
+
readonly duration: number;
|
|
11
|
+
readonly cached: TimeRange[];
|
|
12
|
+
readonly secondsCached: number;
|
|
13
|
+
readonly percentageCached: number;
|
|
14
|
+
readonly bytes: number;
|
|
15
|
+
readonly bytesCached: number;
|
|
16
|
+
}
|
|
17
|
+
export declare class NativeCachingTaskAdapter extends DefaultEventDispatcher<CachingTaskEventMap> implements CachingTask {
|
|
18
|
+
readonly bytes: number;
|
|
19
|
+
readonly bytesCached: number;
|
|
20
|
+
readonly cached: TimeRange[];
|
|
21
|
+
readonly duration: number;
|
|
22
|
+
readonly id: string;
|
|
23
|
+
readonly license: CachingTaskLicense;
|
|
24
|
+
readonly parameters: CachingTaskParameters;
|
|
25
|
+
readonly percentageCached: number;
|
|
26
|
+
readonly secondsCached: number;
|
|
27
|
+
readonly source: SourceDescription;
|
|
28
|
+
readonly status: CacheTaskStatus;
|
|
29
|
+
constructor(task: NativeCachingTask);
|
|
30
|
+
pause(): void;
|
|
31
|
+
remove(): void;
|
|
32
|
+
start(): void;
|
|
33
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { CachingTaskParameters } from 'react-native-theoplayer';
|
|
2
|
+
import type { CachingPreferredTrackSelection } from "../../api/cache/CachingPreferredTrackSelection";
|
|
3
|
+
export interface NativeCachingTaskParameters {
|
|
4
|
+
readonly amount: number | string;
|
|
5
|
+
readonly expirationDate: number | undefined;
|
|
6
|
+
readonly bandwidth: number | undefined;
|
|
7
|
+
readonly preferredTrackSelection: CachingPreferredTrackSelection | undefined;
|
|
8
|
+
readonly allowsCellularAccess: boolean | undefined;
|
|
9
|
+
}
|
|
10
|
+
export declare function fromNativeCachingTaskParameters(parameters: NativeCachingTaskParameters): CachingTaskParameters;
|
|
11
|
+
export declare function toNativeCachingTaskParameters(parameters: CachingTaskParameters): NativeCachingTaskParameters;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { CachingTask, CachingTaskEventMap, CachingTaskLicense, CachingTaskParameters, SourceDescription, TimeRange } from 'react-native-theoplayer';
|
|
2
|
+
import type { CachingTask as WebCachingTask } from 'theoplayer';
|
|
3
|
+
import type { CacheTaskStatus } from 'react-native-theoplayer';
|
|
4
|
+
import type { StringKeyOf } from '../../api/event/EventDispatcher';
|
|
5
|
+
import type { EventListener } from '../../api/event/EventListener';
|
|
6
|
+
export declare class WebCachingTaskAdapter implements CachingTask {
|
|
7
|
+
private webCachingTask;
|
|
8
|
+
constructor(webCachingTask: WebCachingTask);
|
|
9
|
+
get bytes(): number;
|
|
10
|
+
get bytesCached(): number;
|
|
11
|
+
get cached(): TimeRange[];
|
|
12
|
+
get duration(): number;
|
|
13
|
+
get id(): string;
|
|
14
|
+
get license(): CachingTaskLicense;
|
|
15
|
+
get parameters(): CachingTaskParameters;
|
|
16
|
+
get percentageCached(): number;
|
|
17
|
+
get secondsCached(): number;
|
|
18
|
+
get source(): SourceDescription;
|
|
19
|
+
get status(): CacheTaskStatus;
|
|
20
|
+
start(): void;
|
|
21
|
+
pause(): void;
|
|
22
|
+
remove(): void;
|
|
23
|
+
addEventListener<TType extends StringKeyOf<CachingTaskEventMap>>(type: TType[] | TType, listener: EventListener<CachingTaskEventMap[TType]>): void;
|
|
24
|
+
removeEventListener<TType extends StringKeyOf<CachingTaskEventMap>>(type: TType[] | TType, listener: EventListener<CachingTaskEventMap[TType]>): void;
|
|
25
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-theoplayer",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0-pre1",
|
|
4
4
|
"description": "A THEOplayer video component for react-native.",
|
|
5
5
|
"main": "lib/commonjs/index",
|
|
6
6
|
"module": "lib/module/index",
|
|
@@ -48,22 +48,23 @@
|
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@commitlint/config-conventional": "^11.0.0",
|
|
50
50
|
"@react-native-community/eslint-config": "^2.0.0",
|
|
51
|
-
"@release-it/conventional-changelog": "^
|
|
52
|
-
"@types/react": "^18.
|
|
53
|
-
"@types/react-native": "^0.
|
|
54
|
-
"commitlint": "^
|
|
55
|
-
"eslint": "^7.
|
|
56
|
-
"eslint-config-prettier": "^7.
|
|
57
|
-
"eslint-plugin-prettier": "^3.1
|
|
58
|
-
"eslint-plugin-react-native": "^4.
|
|
51
|
+
"@release-it/conventional-changelog": "^7.0.2",
|
|
52
|
+
"@types/react": "^18.2.24",
|
|
53
|
+
"@types/react-native": "^0.72.3",
|
|
54
|
+
"commitlint": "^17.7.2",
|
|
55
|
+
"eslint": "^7.32.0",
|
|
56
|
+
"eslint-config-prettier": "^7.2.0",
|
|
57
|
+
"eslint-plugin-prettier": "^3.4.1",
|
|
58
|
+
"eslint-plugin-react-native": "^4.1.0",
|
|
59
59
|
"husky": "^6.0.0",
|
|
60
|
-
"pod-install": "^0.1.
|
|
61
|
-
"prettier": "^2.
|
|
60
|
+
"pod-install": "^0.1.39",
|
|
61
|
+
"prettier": "^2.8.8",
|
|
62
62
|
"react": "^18.2.0",
|
|
63
|
-
"react-native": "^0.
|
|
64
|
-
"react-native-builder-bob": "^0.18.
|
|
65
|
-
"release-it": "^
|
|
66
|
-
"
|
|
63
|
+
"react-native": "^0.72.5",
|
|
64
|
+
"react-native-builder-bob": "^0.18.3",
|
|
65
|
+
"release-it": "^16.2.1",
|
|
66
|
+
"theoplayer": "^6.1.0",
|
|
67
|
+
"typescript": "^4.9.5"
|
|
67
68
|
},
|
|
68
69
|
"peerDependencies": {
|
|
69
70
|
"react": "*",
|
|
@@ -20,7 +20,7 @@ Pod::Spec.new do |s|
|
|
|
20
20
|
s.platforms = { :ios => "12.0", :tvos => "12.0" }
|
|
21
21
|
s.source = { :git => "https://www.theoplayer.com/.git", :tag => "#{s.version}" }
|
|
22
22
|
|
|
23
|
-
s.source_files = 'ios/*.{h,m,swift}', 'ios/ads/*.swift', 'ios/casting/*.swift', 'ios/contentprotection/*.swift', 'ios/pip/*.swift', 'ios/backgroundAudio/*.swift'
|
|
23
|
+
s.source_files = 'ios/*.{h,m,swift}', 'ios/ads/*.swift', 'ios/casting/*.swift', 'ios/contentprotection/*.swift', 'ios/pip/*.swift', 'ios/backgroundAudio/*.swift', 'ios/cache/*.swift'
|
|
24
24
|
s.resources = ['ios/*.css']
|
|
25
25
|
|
|
26
26
|
# ReactNative Dependency
|
|
@@ -36,14 +36,14 @@ Pod::Spec.new do |s|
|
|
|
36
36
|
}
|
|
37
37
|
else
|
|
38
38
|
puts "Using THEOplayer-core SDK"
|
|
39
|
-
s.dependency "THEOplayerSDK-core", "~>
|
|
39
|
+
s.dependency "THEOplayerSDK-core", "~> 6.0"
|
|
40
40
|
if theofeatures.include?("GOOGLE_IMA")
|
|
41
41
|
puts "Adding THEOplayer-Integration-GoogleIMA"
|
|
42
|
-
s.dependency "THEOplayer-Integration-GoogleIMA", "~>
|
|
42
|
+
s.dependency "THEOplayer-Integration-GoogleIMA", "~> 6.0"
|
|
43
43
|
end
|
|
44
44
|
if theofeatures.include?("CHROMECAST")
|
|
45
45
|
puts "Adding THEOplayer-Integration-GoogleCast"
|
|
46
|
-
s.ios.dependency "THEOplayer-Integration-GoogleCast", "~>
|
|
46
|
+
s.ios.dependency "THEOplayer-Integration-GoogleCast", "~> 6.0"
|
|
47
47
|
end
|
|
48
48
|
if theofeatures.include?("SIDELOADED_TEXTTRACKS")
|
|
49
49
|
puts "Adding THEOplayer-Connector-SideloadedSubtitle"
|
package/src/api/barrel.ts
CHANGED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The preferred track selection.
|
|
3
|
+
*
|
|
4
|
+
* @public
|
|
5
|
+
*/
|
|
6
|
+
export interface CachingPreferredTrackSelection {
|
|
7
|
+
/**
|
|
8
|
+
* The list of language tags that indicates the preferred audio tracks to be cached.
|
|
9
|
+
*
|
|
10
|
+
* An empty array will result to picking the first available track.
|
|
11
|
+
*/
|
|
12
|
+
audioTrackSelection: string[];
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* The expiration date of the cached data.
|
|
16
|
+
*
|
|
17
|
+
* @remarks
|
|
18
|
+
* <br/> - Must be a date in the future.
|
|
19
|
+
* <br/> - Data might be removed by the browser if it runs out of disk space.
|
|
20
|
+
*
|
|
21
|
+
* @defaultValue 30 minutes after starting the caching task.
|
|
22
|
+
*/
|
|
23
|
+
textTrackSelection?: string[];
|
|
24
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import type { SourceDescription } from 'react-native-theoplayer';
|
|
2
|
+
import type { EventDispatcher } from '../event/EventDispatcher';
|
|
3
|
+
import type { CachingTaskLicense } from './CachingTaskLicense';
|
|
4
|
+
import type { CachingTaskParameters } from './CachingTaskParameters';
|
|
5
|
+
import type { CachingTaskEventMap } from './events/CachingTaskEvent';
|
|
6
|
+
import type { TimeRange } from '../timeranges/TimeRange';
|
|
7
|
+
/**
|
|
8
|
+
* The cache task status, represented by a value from the following list:
|
|
9
|
+
* <br/> - `'idle'`: The task has been created, but has not started downloading content.
|
|
10
|
+
* <br/> - `'loading'`: The task is currently downloading the content.
|
|
11
|
+
* <br/> - `'done'`: The task has finished downloading all content.
|
|
12
|
+
* <br/> - `'error'`: The task has encountered an error while downloading or evicting content.
|
|
13
|
+
* <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.
|
|
14
|
+
*
|
|
15
|
+
* @public
|
|
16
|
+
*/
|
|
17
|
+
export enum CacheTaskStatus {
|
|
18
|
+
idle = 'idle',
|
|
19
|
+
loading = 'loading',
|
|
20
|
+
done = 'done',
|
|
21
|
+
error = 'error',
|
|
22
|
+
evicted = 'evicted',
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Represents a caching task.
|
|
27
|
+
*
|
|
28
|
+
* @public
|
|
29
|
+
*/
|
|
30
|
+
export interface CachingTask extends EventDispatcher<CachingTaskEventMap> {
|
|
31
|
+
/**
|
|
32
|
+
* The generated identifier for the task.
|
|
33
|
+
*/
|
|
34
|
+
readonly id: string;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* The current status of the task.
|
|
38
|
+
*/
|
|
39
|
+
readonly status: CacheTaskStatus;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* The media source associated with the task.
|
|
43
|
+
*/
|
|
44
|
+
readonly source: SourceDescription;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* The configuration of the task.
|
|
48
|
+
*/
|
|
49
|
+
readonly parameters: CachingTaskParameters;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* The requested cached duration of the media, in seconds.
|
|
53
|
+
*/
|
|
54
|
+
readonly duration: number;
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* The time ranges cached, in milliseconds.
|
|
58
|
+
*/
|
|
59
|
+
readonly cached: TimeRange[];
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* The duration cached, in seconds.
|
|
63
|
+
*/
|
|
64
|
+
readonly secondsCached: number;
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* The percentage cached, a value between 0 and 1.
|
|
68
|
+
*/
|
|
69
|
+
readonly percentageCached: number;
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* The estimation of the amount this task will download and store, in bytes.
|
|
73
|
+
*
|
|
74
|
+
* @remarks
|
|
75
|
+
* <br/> - Available only on Web and Android.
|
|
76
|
+
* <br/> - Returns -1 if the estimate is not available yet.
|
|
77
|
+
*/
|
|
78
|
+
readonly bytes: number;
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* The amount downloaded and stored, in bytes.
|
|
82
|
+
*/
|
|
83
|
+
readonly bytesCached: number;
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* The API for license related queries and operations
|
|
87
|
+
*/
|
|
88
|
+
readonly license: CachingTaskLicense;
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Start caching the media.
|
|
92
|
+
*/
|
|
93
|
+
start(): void;
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Remove the cached media.
|
|
97
|
+
*/
|
|
98
|
+
remove(): void;
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Pause caching the media.
|
|
102
|
+
*
|
|
103
|
+
* @remarks
|
|
104
|
+
* <br/> - A paused task can be resumed with {@link CachingTask.start}.
|
|
105
|
+
*/
|
|
106
|
+
pause(): void;
|
|
107
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The {@link CachingTask}'s license API.
|
|
3
|
+
*
|
|
4
|
+
* @public
|
|
5
|
+
*/
|
|
6
|
+
import type { DRMConfiguration } from 'react-native-theoplayer';
|
|
7
|
+
|
|
8
|
+
export interface CachingTaskLicense {
|
|
9
|
+
/**
|
|
10
|
+
* Renew all the licenses associated with this task.
|
|
11
|
+
*
|
|
12
|
+
* @param drmConfiguration - The DRM configuration used for license renewals. Defaults to the DRM configuration of the original sourceDescription when omitted.
|
|
13
|
+
*/
|
|
14
|
+
renew(drmConfiguration?: DRMConfiguration): void;
|
|
15
|
+
}
|