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.
Files changed (316) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/README.md +1 -0
  3. package/android/build.gradle +19 -22
  4. package/android/src/main/java/com/theoplayer/PlayerConfigAdapter.kt +87 -101
  5. package/android/src/main/java/com/theoplayer/ReactTHEOplayerContext.kt +30 -30
  6. package/android/src/main/java/com/theoplayer/ReactTHEOplayerPackage.kt +3 -1
  7. package/android/src/main/java/com/theoplayer/ReactTHEOplayerView.kt +1 -1
  8. package/android/src/main/java/com/theoplayer/cache/CacheAdapter.kt +127 -0
  9. package/android/src/main/java/com/theoplayer/cache/CacheModule.kt +238 -0
  10. package/android/src/main/java/com/theoplayer/player/PlayerModule.kt +27 -12
  11. package/android/src/main/java/com/theoplayer/source/SourceAdapter.kt +16 -37
  12. package/android/src/main/java/com/theoplayer/util/BridgeUtils.kt +60 -0
  13. package/android/src/main/java/com/theoplayer/util/PayloadBuilder.kt +10 -10
  14. package/ios/THEOplayerRCTBridge.m +22 -0
  15. package/ios/THEOplayerRCTDebug.swift +7 -1
  16. package/ios/THEOplayerRCTMainEventHandler.swift +25 -27
  17. package/ios/THEOplayerRCTSourceDescriptionAggregator.swift +41 -0
  18. package/ios/THEOplayerRCTSourceDescriptionBuilder.swift +3 -2
  19. package/ios/THEOplayerRCTTypeUtils.swift +37 -0
  20. package/ios/THEOplayerRCTView.swift +1 -2
  21. package/ios/ads/THEOplayerRCTAdsAPI+DAI.swift +3 -13
  22. package/ios/ads/THEOplayerRCTAdsAPI.swift +14 -48
  23. package/ios/ads/THEOplayerRCTView+AdsConfig.swift +0 -13
  24. package/ios/backgroundAudio/THEOplayerRCTNowPlayingManager.swift +24 -36
  25. package/ios/backgroundAudio/THEOplayerRCTRemoteCommandsManager.swift +2 -10
  26. package/ios/cache/THEOplayerRCTCacheAPI.swift +202 -0
  27. package/ios/cache/THEOplayerRCTCacheAggregator.swift +87 -0
  28. package/ios/cache/THEOplayerRCTCachingParametersBuilder.swift +27 -0
  29. package/ios/pip/THEOplayerRCTPipControlsManager.swift +2 -4
  30. package/lib/commonjs/api/abr/ABRConfiguration.js +21 -7
  31. package/lib/commonjs/api/abr/ABRConfiguration.js.map +1 -1
  32. package/lib/commonjs/api/ads/GoogleImaConfiguration.js.map +1 -1
  33. package/lib/commonjs/api/barrel.js +30 -19
  34. package/lib/commonjs/api/barrel.js.map +1 -1
  35. package/lib/commonjs/api/cache/CachingPreferredTrackSelection.js +2 -0
  36. package/lib/commonjs/api/cache/CachingPreferredTrackSelection.js.map +1 -0
  37. package/lib/commonjs/api/cache/CachingTask.js +30 -0
  38. package/lib/commonjs/api/cache/CachingTask.js.map +1 -0
  39. package/lib/commonjs/api/cache/CachingTaskLicense.js +6 -0
  40. package/lib/commonjs/api/cache/CachingTaskLicense.js.map +1 -0
  41. package/lib/commonjs/api/cache/CachingTaskList.js +6 -0
  42. package/lib/commonjs/api/cache/CachingTaskList.js.map +1 -0
  43. package/lib/commonjs/api/cache/CachingTaskParameters.js +6 -0
  44. package/lib/commonjs/api/cache/CachingTaskParameters.js.map +1 -0
  45. package/lib/commonjs/api/cache/MediaCacheAPI.js +24 -0
  46. package/lib/commonjs/api/cache/MediaCacheAPI.js.map +1 -0
  47. package/lib/commonjs/api/cache/barrel.js +83 -0
  48. package/lib/commonjs/api/cache/barrel.js.map +1 -0
  49. package/lib/commonjs/api/cache/events/CacheEvent.js +28 -0
  50. package/lib/commonjs/api/cache/events/CacheEvent.js.map +1 -0
  51. package/lib/commonjs/api/cache/events/CachingTaskEvent.js +17 -0
  52. package/lib/commonjs/api/cache/events/CachingTaskEvent.js.map +1 -0
  53. package/lib/commonjs/api/cache/events/barrel.js +28 -0
  54. package/lib/commonjs/api/cache/events/barrel.js.map +1 -0
  55. package/lib/commonjs/api/cache/hooks/barrel.js +39 -0
  56. package/lib/commonjs/api/cache/hooks/barrel.js.map +1 -0
  57. package/lib/commonjs/api/cache/hooks/useCachingTaskList.js +31 -0
  58. package/lib/commonjs/api/cache/hooks/useCachingTaskList.js.map +1 -0
  59. package/lib/commonjs/api/cache/hooks/useCachingTaskProgress.js +28 -0
  60. package/lib/commonjs/api/cache/hooks/useCachingTaskProgress.js.map +1 -0
  61. package/lib/commonjs/api/cache/hooks/useCachingTaskStatus.js +28 -0
  62. package/lib/commonjs/api/cache/hooks/useCachingTaskStatus.js.map +1 -0
  63. package/lib/commonjs/api/cast/CastState.js +3 -4
  64. package/lib/commonjs/api/cast/CastState.js.map +1 -1
  65. package/lib/commonjs/api/config/PlayerConfiguration.js.map +1 -1
  66. package/lib/commonjs/api/event/AdEvent.js +3 -4
  67. package/lib/commonjs/api/event/AdEvent.js.map +1 -1
  68. package/lib/commonjs/api/event/CastEvent.js +3 -4
  69. package/lib/commonjs/api/event/CastEvent.js.map +1 -1
  70. package/lib/commonjs/api/event/PlayerEvent.js +3 -4
  71. package/lib/commonjs/api/event/PlayerEvent.js.map +1 -1
  72. package/lib/commonjs/api/event/TrackEvent.js +12 -16
  73. package/lib/commonjs/api/event/TrackEvent.js.map +1 -1
  74. package/lib/commonjs/api/player/PlayerEventMap.js +7 -8
  75. package/lib/commonjs/api/player/PlayerEventMap.js.map +1 -1
  76. package/lib/commonjs/api/player/THEOplayer.js +6 -4
  77. package/lib/commonjs/api/player/THEOplayer.js.map +1 -1
  78. package/lib/commonjs/api/presentation/PresentationMode.js +3 -4
  79. package/lib/commonjs/api/presentation/PresentationMode.js.map +1 -1
  80. package/lib/commonjs/api/source/ads/Ads.js +3 -4
  81. package/lib/commonjs/api/source/ads/Ads.js.map +1 -1
  82. package/lib/commonjs/api/track/TextTrack.js +9 -12
  83. package/lib/commonjs/api/track/TextTrack.js.map +1 -1
  84. package/lib/commonjs/api/track/TextTrackStyle.js +3 -4
  85. package/lib/commonjs/api/track/TextTrackStyle.js.map +1 -1
  86. package/lib/commonjs/index.js +9 -1
  87. package/lib/commonjs/index.js.map +1 -1
  88. package/lib/commonjs/internal/THEOplayerView.js +1 -1
  89. package/lib/commonjs/internal/THEOplayerView.js.map +1 -1
  90. package/lib/commonjs/internal/THEOplayerView.style.js +1 -2
  91. package/lib/commonjs/internal/THEOplayerView.style.js.map +1 -1
  92. package/lib/commonjs/internal/THEOplayerView.web.js +5 -5
  93. package/lib/commonjs/internal/THEOplayerView.web.js.map +1 -1
  94. package/lib/commonjs/internal/adapter/THEOplayerAdapter.js.map +1 -1
  95. package/lib/commonjs/internal/adapter/THEOplayerWebAdapter.js +12 -13
  96. package/lib/commonjs/internal/adapter/THEOplayerWebAdapter.js.map +1 -1
  97. package/lib/commonjs/internal/adapter/WebEventForwarder.js +10 -10
  98. package/lib/commonjs/internal/adapter/WebEventForwarder.js.map +1 -1
  99. package/lib/commonjs/internal/adapter/abr/AbrAdapter.js.map +1 -1
  100. package/lib/commonjs/internal/adapter/ads/THEOplayerWebAdsAdapter.js +2 -2
  101. package/lib/commonjs/internal/adapter/ads/THEOplayerWebAdsAdapter.js.map +1 -1
  102. package/lib/commonjs/internal/adapter/cast/THEOplayerNativeCastAdapter.js +1 -1
  103. package/lib/commonjs/internal/adapter/cast/THEOplayerNativeCastAdapter.js.map +1 -1
  104. package/lib/commonjs/internal/adapter/cast/THEOplayerWebCastAdapter.js.map +1 -1
  105. package/lib/commonjs/internal/adapter/event/BaseEvent.js.map +1 -1
  106. package/lib/commonjs/internal/adapter/event/DefaultEventDispatcher.js +1 -1
  107. package/lib/commonjs/internal/adapter/event/DefaultEventDispatcher.js.map +1 -1
  108. package/lib/commonjs/internal/adapter/event/native/NativeTrackEvent.js +12 -16
  109. package/lib/commonjs/internal/adapter/event/native/NativeTrackEvent.js.map +1 -1
  110. package/lib/commonjs/internal/adapter/track/TextTrackStyleAdapter.js.map +1 -1
  111. package/lib/commonjs/internal/adapter/web/FullscreenAPI.js +1 -2
  112. package/lib/commonjs/internal/adapter/web/FullscreenAPI.js.map +1 -1
  113. package/lib/commonjs/internal/adapter/web/WebMediaSession.js +9 -11
  114. package/lib/commonjs/internal/adapter/web/WebMediaSession.js.map +1 -1
  115. package/lib/commonjs/internal/adapter/web/WebPresentationModeManager.js +4 -4
  116. package/lib/commonjs/internal/adapter/web/WebPresentationModeManager.js.map +1 -1
  117. package/lib/commonjs/internal/cache/MediaCache.js +117 -0
  118. package/lib/commonjs/internal/cache/MediaCache.js.map +1 -0
  119. package/lib/commonjs/internal/cache/MediaCache.web.js +54 -0
  120. package/lib/commonjs/internal/cache/MediaCache.web.js.map +1 -0
  121. package/lib/commonjs/internal/cache/NativeCachingTaskAdapter.js +59 -0
  122. package/lib/commonjs/internal/cache/NativeCachingTaskAdapter.js.map +1 -0
  123. package/lib/commonjs/internal/cache/NativeCachingTaskParametersAdapter.js +27 -0
  124. package/lib/commonjs/internal/cache/NativeCachingTaskParametersAdapter.js.map +1 -0
  125. package/lib/commonjs/internal/cache/WebCachingTaskAdapter.js +71 -0
  126. package/lib/commonjs/internal/cache/WebCachingTaskAdapter.js.map +1 -0
  127. package/lib/commonjs/internal/drm/ContentProtectionRegistry.js +1 -2
  128. package/lib/commonjs/internal/drm/ContentProtectionRegistry.js.map +1 -1
  129. package/lib/commonjs/internal/drm/ContentProtectionRegistry.web.js +1 -2
  130. package/lib/commonjs/internal/drm/ContentProtectionRegistry.web.js.map +1 -1
  131. package/lib/commonjs/internal/drm/NativeCertificateResponse.js.map +1 -1
  132. package/lib/commonjs/internal/drm/NativeLicenseResponse.js.map +1 -1
  133. package/lib/commonjs/internal/utils/TypeUtils.js +2 -4
  134. package/lib/commonjs/internal/utils/TypeUtils.js.map +1 -1
  135. package/lib/module/api/abr/ABRConfiguration.js +24 -6
  136. package/lib/module/api/abr/ABRConfiguration.js.map +1 -1
  137. package/lib/module/api/ads/GoogleImaConfiguration.js.map +1 -1
  138. package/lib/module/api/barrel.js +1 -0
  139. package/lib/module/api/barrel.js.map +1 -1
  140. package/lib/module/api/cache/CachingPreferredTrackSelection.js +2 -0
  141. package/lib/module/api/cache/CachingPreferredTrackSelection.js.map +1 -0
  142. package/lib/module/api/cache/CachingTask.js +25 -0
  143. package/lib/module/api/cache/CachingTask.js.map +1 -0
  144. package/lib/module/api/cache/CachingTaskLicense.js +2 -0
  145. package/lib/module/api/cache/CachingTaskLicense.js.map +1 -0
  146. package/lib/module/api/cache/CachingTaskList.js +2 -0
  147. package/lib/module/api/cache/CachingTaskList.js.map +1 -0
  148. package/lib/module/api/cache/CachingTaskParameters.js +2 -0
  149. package/lib/module/api/cache/CachingTaskParameters.js.map +1 -0
  150. package/lib/module/api/cache/MediaCacheAPI.js +19 -0
  151. package/lib/module/api/cache/MediaCacheAPI.js.map +1 -0
  152. package/lib/module/api/cache/barrel.js +8 -0
  153. package/lib/module/api/cache/barrel.js.map +1 -0
  154. package/lib/module/api/cache/events/CacheEvent.js +25 -0
  155. package/lib/module/api/cache/events/CacheEvent.js.map +1 -0
  156. package/lib/module/api/cache/events/CachingTaskEvent.js +12 -0
  157. package/lib/module/api/cache/events/CachingTaskEvent.js.map +1 -0
  158. package/lib/module/api/cache/events/barrel.js +3 -0
  159. package/lib/module/api/cache/events/barrel.js.map +1 -0
  160. package/lib/module/api/cache/hooks/barrel.js +4 -0
  161. package/lib/module/api/cache/hooks/barrel.js.map +1 -0
  162. package/lib/module/api/cache/hooks/useCachingTaskList.js +24 -0
  163. package/lib/module/api/cache/hooks/useCachingTaskList.js.map +1 -0
  164. package/lib/module/api/cache/hooks/useCachingTaskProgress.js +21 -0
  165. package/lib/module/api/cache/hooks/useCachingTaskProgress.js.map +1 -0
  166. package/lib/module/api/cache/hooks/useCachingTaskStatus.js +21 -0
  167. package/lib/module/api/cache/hooks/useCachingTaskStatus.js.map +1 -0
  168. package/lib/module/api/cast/CastState.js +3 -3
  169. package/lib/module/api/cast/CastState.js.map +1 -1
  170. package/lib/module/api/config/PlayerConfiguration.js.map +1 -1
  171. package/lib/module/api/event/AdEvent.js +3 -3
  172. package/lib/module/api/event/AdEvent.js.map +1 -1
  173. package/lib/module/api/event/CastEvent.js +3 -3
  174. package/lib/module/api/event/CastEvent.js.map +1 -1
  175. package/lib/module/api/event/PlayerEvent.js +3 -3
  176. package/lib/module/api/event/PlayerEvent.js.map +1 -1
  177. package/lib/module/api/event/TrackEvent.js +12 -12
  178. package/lib/module/api/event/TrackEvent.js.map +1 -1
  179. package/lib/module/api/player/PlayerEventMap.js +8 -8
  180. package/lib/module/api/player/PlayerEventMap.js.map +1 -1
  181. package/lib/module/api/player/THEOplayer.js +7 -3
  182. package/lib/module/api/player/THEOplayer.js.map +1 -1
  183. package/lib/module/api/presentation/PresentationMode.js +3 -3
  184. package/lib/module/api/presentation/PresentationMode.js.map +1 -1
  185. package/lib/module/api/source/ads/Ads.js +3 -3
  186. package/lib/module/api/source/ads/Ads.js.map +1 -1
  187. package/lib/module/api/track/TextTrack.js +9 -9
  188. package/lib/module/api/track/TextTrack.js.map +1 -1
  189. package/lib/module/api/track/TextTrackStyle.js +3 -3
  190. package/lib/module/api/track/TextTrackStyle.js.map +1 -1
  191. package/lib/module/index.js +1 -0
  192. package/lib/module/index.js.map +1 -1
  193. package/lib/module/internal/THEOplayerView.js +1 -1
  194. package/lib/module/internal/THEOplayerView.js.map +1 -1
  195. package/lib/module/internal/THEOplayerView.web.js +5 -5
  196. package/lib/module/internal/THEOplayerView.web.js.map +1 -1
  197. package/lib/module/internal/adapter/THEOplayerAdapter.js.map +1 -1
  198. package/lib/module/internal/adapter/THEOplayerWebAdapter.js +12 -11
  199. package/lib/module/internal/adapter/THEOplayerWebAdapter.js.map +1 -1
  200. package/lib/module/internal/adapter/WebEventForwarder.js +10 -10
  201. package/lib/module/internal/adapter/WebEventForwarder.js.map +1 -1
  202. package/lib/module/internal/adapter/abr/AbrAdapter.js.map +1 -1
  203. package/lib/module/internal/adapter/ads/THEOplayerWebAdsAdapter.js +2 -2
  204. package/lib/module/internal/adapter/ads/THEOplayerWebAdsAdapter.js.map +1 -1
  205. package/lib/module/internal/adapter/cast/THEOplayerNativeCastAdapter.js +1 -1
  206. package/lib/module/internal/adapter/cast/THEOplayerNativeCastAdapter.js.map +1 -1
  207. package/lib/module/internal/adapter/cast/THEOplayerWebCastAdapter.js.map +1 -1
  208. package/lib/module/internal/adapter/event/BaseEvent.js.map +1 -1
  209. package/lib/module/internal/adapter/event/DefaultEventDispatcher.js +1 -1
  210. package/lib/module/internal/adapter/event/DefaultEventDispatcher.js.map +1 -1
  211. package/lib/module/internal/adapter/event/native/NativeTrackEvent.js +12 -12
  212. package/lib/module/internal/adapter/event/native/NativeTrackEvent.js.map +1 -1
  213. package/lib/module/internal/adapter/track/TextTrackStyleAdapter.js.map +1 -1
  214. package/lib/module/internal/adapter/web/FullscreenAPI.js.map +1 -1
  215. package/lib/module/internal/adapter/web/WebMediaSession.js +8 -9
  216. package/lib/module/internal/adapter/web/WebMediaSession.js.map +1 -1
  217. package/lib/module/internal/adapter/web/WebPresentationModeManager.js +4 -4
  218. package/lib/module/internal/adapter/web/WebPresentationModeManager.js.map +1 -1
  219. package/lib/module/internal/cache/MediaCache.js +110 -0
  220. package/lib/module/internal/cache/MediaCache.js.map +1 -0
  221. package/lib/module/internal/cache/MediaCache.web.js +45 -0
  222. package/lib/module/internal/cache/MediaCache.web.js.map +1 -0
  223. package/lib/module/internal/cache/NativeCachingTaskAdapter.js +52 -0
  224. package/lib/module/internal/cache/NativeCachingTaskAdapter.js.map +1 -0
  225. package/lib/module/internal/cache/NativeCachingTaskParametersAdapter.js +20 -0
  226. package/lib/module/internal/cache/NativeCachingTaskParametersAdapter.js.map +1 -0
  227. package/lib/module/internal/cache/WebCachingTaskAdapter.js +64 -0
  228. package/lib/module/internal/cache/WebCachingTaskAdapter.js.map +1 -0
  229. package/lib/module/internal/drm/ContentProtectionRegistry.js.map +1 -1
  230. package/lib/module/internal/drm/ContentProtectionRegistry.web.js.map +1 -1
  231. package/lib/module/internal/drm/NativeCertificateResponse.js.map +1 -1
  232. package/lib/module/internal/drm/NativeLicenseResponse.js.map +1 -1
  233. package/lib/typescript/api/abr/ABRConfiguration.d.ts +1 -1
  234. package/lib/typescript/api/ads/Ad.d.ts +2 -2
  235. package/lib/typescript/api/ads/AdsConfiguration.d.ts +2 -2
  236. package/lib/typescript/api/ads/GoogleImaConfiguration.d.ts +1 -0
  237. package/lib/typescript/api/barrel.d.ts +1 -0
  238. package/lib/typescript/api/cache/CachingPreferredTrackSelection.d.ts +23 -0
  239. package/lib/typescript/api/cache/CachingTask.d.ts +93 -0
  240. package/lib/typescript/api/cache/CachingTaskLicense.d.ts +14 -0
  241. package/lib/typescript/api/cache/CachingTaskList.d.ts +7 -0
  242. package/lib/typescript/api/cache/CachingTaskParameters.d.ts +57 -0
  243. package/lib/typescript/api/cache/MediaCacheAPI.d.ts +39 -0
  244. package/lib/typescript/api/cache/barrel.d.ts +7 -0
  245. package/lib/typescript/api/cache/events/CacheEvent.d.ts +55 -0
  246. package/lib/typescript/api/cache/events/CachingTaskEvent.d.ts +22 -0
  247. package/lib/typescript/api/cache/events/barrel.d.ts +2 -0
  248. package/lib/typescript/api/cache/hooks/barrel.d.ts +3 -0
  249. package/lib/typescript/api/cache/hooks/useCachingTaskList.d.ts +1 -0
  250. package/lib/typescript/api/cache/hooks/useCachingTaskProgress.d.ts +2 -0
  251. package/lib/typescript/api/cache/hooks/useCachingTaskStatus.d.ts +2 -0
  252. package/lib/typescript/api/cast/CastConfiguration.d.ts +1 -1
  253. package/lib/typescript/api/config/PlayerConfiguration.d.ts +4 -1
  254. package/lib/typescript/api/drm/ContentProtectionIntegration.d.ts +2 -2
  255. package/lib/typescript/api/drm/ContentProtectionRequest.d.ts +1 -1
  256. package/lib/typescript/api/error/ChromecastError.d.ts +1 -1
  257. package/lib/typescript/api/event/CastEvent.d.ts +1 -1
  258. package/lib/typescript/api/event/EventDispatcher.d.ts +2 -2
  259. package/lib/typescript/api/event/EventListener.d.ts +1 -1
  260. package/lib/typescript/api/player/THEOplayer.d.ts +2 -2
  261. package/lib/typescript/api/source/SourceDescription.d.ts +3 -3
  262. package/lib/typescript/api/source/ads/Ads.d.ts +1 -1
  263. package/lib/typescript/api/source/ads/FreeWheelAdDescription.d.ts +1 -1
  264. package/lib/typescript/api/source/ads/ssai/GoogleDAIConfiguration.d.ts +2 -2
  265. package/lib/typescript/api/source/ads/ssai/ImagineServerSideAdInsertionConfiguration.d.ts +1 -1
  266. package/lib/typescript/api/source/ads/ssai/ServerSideAdInsertionConfiguration.d.ts +1 -1
  267. package/lib/typescript/api/source/ads/ssai/YospaceServerSideAdInsertionConfiguration.d.ts +2 -2
  268. package/lib/typescript/api/source/dash/DashPlaybackConfiguration.d.ts +1 -1
  269. package/lib/typescript/api/source/drm/DRMConfiguration.d.ts +3 -3
  270. package/lib/typescript/api/source/hls/HlsPlaybackConfiguration.d.ts +1 -1
  271. package/lib/typescript/api/track/MediaTrack.d.ts +1 -1
  272. package/lib/typescript/index.d.ts +1 -0
  273. package/lib/typescript/internal/THEOplayerView.web.d.ts +1 -1
  274. package/lib/typescript/internal/adapter/THEOplayerWebAdapter.d.ts +2 -2
  275. package/lib/typescript/internal/adapter/WebEventForwarder.d.ts +2 -2
  276. package/lib/typescript/internal/adapter/ads/THEOplayerWebAdsAdapter.d.ts +2 -2
  277. package/lib/typescript/internal/adapter/cast/THEOplayerWebCastAdapter.d.ts +2 -2
  278. package/lib/typescript/internal/adapter/event/native/NativeCastEvent.d.ts +1 -1
  279. package/lib/typescript/internal/adapter/web/WebPresentationModeManager.d.ts +2 -2
  280. package/lib/typescript/internal/cache/MediaCache.d.ts +25 -0
  281. package/lib/typescript/internal/cache/MediaCache.web.d.ts +16 -0
  282. package/lib/typescript/internal/cache/NativeCachingTaskAdapter.d.ts +33 -0
  283. package/lib/typescript/internal/cache/NativeCachingTaskParametersAdapter.d.ts +11 -0
  284. package/lib/typescript/internal/cache/WebCachingTaskAdapter.d.ts +25 -0
  285. package/package.json +16 -15
  286. package/react-native-theoplayer.podspec +4 -4
  287. package/src/api/ads/GoogleImaConfiguration.ts +1 -0
  288. package/src/api/barrel.ts +1 -0
  289. package/src/api/cache/CachingPreferredTrackSelection.ts +24 -0
  290. package/src/api/cache/CachingTask.ts +107 -0
  291. package/src/api/cache/CachingTaskLicense.ts +15 -0
  292. package/src/api/cache/CachingTaskList.ts +8 -0
  293. package/src/api/cache/CachingTaskParameters.ts +62 -0
  294. package/src/api/cache/MediaCacheAPI.ts +43 -0
  295. package/src/api/cache/barrel.ts +7 -0
  296. package/src/api/cache/events/CacheEvent.ts +62 -0
  297. package/src/api/cache/events/CachingTaskEvent.ts +27 -0
  298. package/src/api/cache/events/barrel.ts +2 -0
  299. package/src/api/cache/hooks/barrel.ts +3 -0
  300. package/src/api/cache/hooks/useCachingTaskList.ts +23 -0
  301. package/src/api/cache/hooks/useCachingTaskProgress.ts +20 -0
  302. package/src/api/cache/hooks/useCachingTaskStatus.ts +20 -0
  303. package/src/api/config/PlayerConfiguration.ts +3 -0
  304. package/src/index.tsx +1 -0
  305. package/src/internal/THEOplayerView.web.tsx +5 -5
  306. package/src/internal/adapter/THEOplayerWebAdapter.ts +6 -6
  307. package/src/internal/adapter/WebEventForwarder.ts +3 -3
  308. package/src/internal/adapter/ads/THEOplayerWebAdsAdapter.ts +3 -3
  309. package/src/internal/adapter/cast/THEOplayerWebCastAdapter.ts +3 -3
  310. package/src/internal/adapter/web/WebPresentationModeManager.ts +3 -3
  311. package/src/internal/cache/MediaCache.ts +151 -0
  312. package/src/internal/cache/MediaCache.web.ts +54 -0
  313. package/src/internal/cache/NativeCachingTaskAdapter.ts +81 -0
  314. package/src/internal/cache/NativeCachingTaskParametersAdapter.ts +32 -0
  315. package/src/internal/cache/WebCachingTaskAdapter.ts +95 -0
  316. package/android/src/main/java/com/theoplayer/track/QualityListFilter.kt +0 -28
@@ -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","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":"AAcA,OAAO,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;EAClC;EAEA,IAAIC,WAAWA,CAAA,EAAW;IACxB,OAAO,IAAI,CAACF,cAAc,CAACE,WAAW;EACxC;EAEA,IAAIC,MAAMA,CAAA,EAAgB;IACxB,OAAOC,cAAc,CAAC,IAAI,CAACJ,cAAc,CAACG,MAAM,CAAC;EACnD;EAEA,IAAIE,QAAQA,CAAA,EAAW;IACrB,OAAO,IAAI,CAACL,cAAc,CAACK,QAAQ;EACrC;EAEA,IAAIC,EAAEA,CAAA,EAAW;IACf,OAAO,IAAI,CAACN,cAAc,CAACM,EAAE;EAC/B;EAEA,IAAIC,OAAOA,CAAA,EAAuB;IAChC,OAAO,IAAI,CAACP,cAAc,CAACO,OAAO;EACpC;EAEA,IAAIC,UAAUA,CAAA,EAA0B;IACtC,OAAO,IAAI,CAACR,cAAc,CAACQ,UAAU;EACvC;EAEA,IAAIC,gBAAgBA,CAAA,EAAW;IAC7B,OAAO,IAAI,CAACT,cAAc,CAACS,gBAAgB;EAC7C;EAEA,IAAIC,aAAaA,CAAA,EAAW;IAC1B,OAAO,IAAI,CAACV,cAAc,CAACU,aAAa;EAC1C;EAEA,IAAIC,MAAMA,CAAA,EAAsB;IAC9B,OAAO,IAAI,CAACX,cAAc,CAACW,MAAM;EACnC;EAEA,IAAIC,MAAMA,CAAA,EAAoB;IAC5B,OAAO,IAAI,CAACZ,cAAc,CAACY,MAAM;EACnC;EAEAC,KAAKA,CAAA,EAAS;IACZ,IAAI,CAACb,cAAc,CAACa,KAAK,CAAC,CAAC;EAC7B;EAEAC,KAAKA,CAAA,EAAS;IACZ,IAAI,CAACd,cAAc,CAACc,KAAK,CAAC,CAAC;EAC7B;EAEAC,MAAMA,CAAA,EAAS;IACb,IAAI,CAACf,cAAc,CAACe,MAAM,CAAC,CAAC;EAC9B;EAEAC,gBAAgBA,CAAiDC,IAAqB,EAAEC,QAAmD,EAAE;IAC3I,IAAI,CAAClB,cAAc,CAACgB,gBAAgB,CAACC,IAAI,EAAEC,QAAwD,CAAC;EACtG;EAEAC,mBAAmBA,CACjBF,IAAqB,EACrBC,QAAmD,EAC7C;IACN,IAAI,CAAClB,cAAc,CAACmB,mBAAmB,CAACF,IAAI,EAAEC,QAAwD,CAAC;EACzG;AACF;AAEA,SAASd,cAAcA,CAACgB,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;MACVX,KAAK,EAAEO,UAAU,CAACP,KAAK,CAACS,CAAC,CAAC,GAAG,GAAG;MAChCG,GAAG,EAAEL,UAAU,CAACK,GAAG,CAACH,CAAC,CAAC,GAAG;IAC3B,CAAC,CAAC;EACJ;EACA,OAAOD,MAAM;AACf"}
@@ -1 +1 @@
1
- {"version":3,"names":["NativeEventEmitter","NativeModules","fromNativeLicenseRequest","toNativeLicenseRequest","fromNativeLicenseResponse","toNativeLicenseResponseResult","fromNativeCertificateRequest","toNativeCertificateRequest","fromNativeCertificateResponse","toNativeCertificateResponseResult","isBufferSource","NativeContentProtectionRegistry","constructor","_defineProperty","undefined","event","requestId","integrationId","keySystemId","drmConfig","console","log","factory","getFactory","currentIntegration","integration","build","ContentProtectionModule","onBuildProcessed","resultString","request","getIntegration","onCertificateRequest","result","nativeResponse","onCertificateRequestProcessedAsCertificate","modifiedNativeRequest","onCertificateRequestProcessedAsRequest","response","onCertificateResponse","responseResult","modifiedNativeResponse","onCertificateResponseProcessed","onLicenseRequest","onLicenseRequestProcessedAsLicense","onLicenseRequestProcessedAsRequest","onLicenseResponse","onLicenseResponseProcessed","fairplaySkdUrl","extractFairplayContentId","contentId","onExtractFairplayContentIdProcessed","emitter","addListener","onBuildIntegrationRequest","onExtractFairplayContentId","registerContentProtectionIntegration","integrationFactory","registeredFactories","push","_this$registeredFacto","find","init","_this$currentIntegrat","_this$currentIntegrat2","_this$currentIntegrat3","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,SAASA,kBAAkB,EAAEC,aAAa,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,IAAI,CAAC5C,WAAW,KAAKA,WAAW,CAAC,cAAA0C,qBAAA,uBAAjHA,qBAAA,CAAmHH,kBAAkB;EAC9I;EAEQ1B,cAAcA,CAACd,aAAqB,EAAEC,WAAmB,EAA4C;IAAA,IAAA6C,qBAAA,EAAAC,sBAAA,EAAAC,sBAAA;IAC3G,OAAO,EAAAF,qBAAA,OAAI,CAACvC,kBAAkB,cAAAuC,qBAAA,uBAAvBA,qBAAA,CAAyB9C,aAAa,MAAKA,aAAa,IAAI,EAAA+C,sBAAA,OAAI,CAACxC,kBAAkB,cAAAwC,sBAAA,uBAAvBA,sBAAA,CAAyB9C,WAAW,MAAKA,WAAW,IAAA+C,sBAAA,GACnH,IAAI,CAACzC,kBAAkB,cAAAyC,sBAAA,uBAAvBA,sBAAA,CAAyBxC,WAAW,GACpCX,SAAS;EACf;AA0GF;AAEA,OAAO,MAAMoD,yBAAyB,GAAG,IAAIvD,+BAA+B,EAAE"}
1
+ {"version":3,"names":["NativeEventEmitter","NativeModules","fromNativeLicenseRequest","toNativeLicenseRequest","fromNativeLicenseResponse","toNativeLicenseResponseResult","fromNativeCertificateRequest","toNativeCertificateRequest","fromNativeCertificateResponse","toNativeCertificateResponseResult","isBufferSource","NativeContentProtectionRegistry","constructor","_defineProperty","undefined","event","requestId","integrationId","keySystemId","drmConfig","console","log","factory","getFactory","currentIntegration","integration","build","ContentProtectionModule","onBuildProcessed","resultString","request","getIntegration","onCertificateRequest","result","nativeResponse","onCertificateRequestProcessedAsCertificate","modifiedNativeRequest","onCertificateRequestProcessedAsRequest","response","onCertificateResponse","responseResult","modifiedNativeResponse","onCertificateResponseProcessed","onLicenseRequest","onLicenseRequestProcessedAsLicense","onLicenseRequestProcessedAsRequest","onLicenseResponse","onLicenseResponseProcessed","fairplaySkdUrl","extractFairplayContentId","contentId","onExtractFairplayContentIdProcessed","emitter","addListener","onBuildIntegrationRequest","onExtractFairplayContentId","registerContentProtectionIntegration","integrationFactory","registeredFactories","push","_this$registeredFacto","find","init","_this$currentIntegrat","_this$currentIntegrat2","_this$currentIntegrat3","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,SAASA,kBAAkB,EAAEC,aAAa,QAAQ,cAAc;AAGhE,SAASC,wBAAwB,EAAwBC,sBAAsB,QAAQ,wBAAwB;AAC/G,SAASC,yBAAyB,EAAyBC,6BAA6B,QAAQ,yBAAyB;AACzH,SAASC,4BAA4B,EAA4BC,0BAA0B,QAAQ,4BAA4B;AAC/H,SAASC,6BAA6B,EAA6BC,iCAAiC,QAAQ,6BAA6B;AACzI,SAASC,cAAc,QAAQ,oBAAoB;AAsBnD,OAAO,MAAMC,+BAA+B,CAAiC;EAK3EC,WAAWA,CAAA,EAAG;IAAAC,eAAA;IAAAA,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AAkB,cAAAwC,sBAAA,uBAAvBA,sBAAA,CAAyB9C,WAAW,MAAKA,WAAW,IAAA+C,sBAAA,GACnH,IAAI,CAACzC,kBAAkB,cAAAyC,sBAAA,uBAAvBA,sBAAA,CAAyBxC,WAAW,GACpCX,SAAS;EACf;AA0GF;AAEA,OAAO,MAAMoD,yBAAyB,GAAG,IAAIvD,+BAA+B,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"names":["registerContentProtectionIntegration","WebContentProtectionRegistry","integrationId","keySystem","integrationFactory","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,SAASA,oCAAoC,QAAQ,YAAY;AAEjE,OAAO,MAAMC,4BAA4B,CAAiC;EACxED,oCAAoCA,CAACE,aAAqB,EAAEC,SAAsB,EAAEC,kBAAuD,EAAQ;IACjJJ,oCAAoC,CAACE,aAAa,EAAEC,SAAS,EAAEC,kBAAkB,CAAC;EACpF;AACF;AAEA,OAAO,MAAMC,yBAAyB,GAAG,IAAIJ,4BAA4B,EAAE"}
1
+ {"version":3,"names":["registerContentProtectionIntegration","WebContentProtectionRegistry","integrationId","keySystem","integrationFactory","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,SAASA,oCAAoC,QAAQ,YAAY;AAEjE,OAAO,MAAMC,4BAA4B,CAAiC;EACxED,oCAAoCA,CAACE,aAAqB,EAAEC,SAAsB,EAAEC,kBAAuD,EAAQ;IACjJJ,oCAAoC,CAACE,aAAa,EAAEC,SAAS,EAAEC,kBAAkB,CAAC;EACpF;AACF;AAEA,OAAO,MAAMC,yBAAyB,GAAG,IAAIJ,4BAA4B,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"names":["fromNativeCertificateRequest","fromBase64StringToUint8Array","fromUint8ArrayToBase64String","fromNativeCertificateResponse","response","url","status","statusText","headers","base64body","request","body","Uint8Array","toNativeCertificateResponseResult","requestId","integrationId","keySystemId"],"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,SAASA,4BAA4B,QAAQ,4BAA4B;AACzE,SAASC,4BAA4B,EAAEC,4BAA4B,QAAQ,yBAAyB;AAepG,OAAO,SAASC,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,GAAGR,4BAA4B,CAACQ,UAAU,CAAC,GAAG,IAAIG,UAAU,EAAE;EACrF,OAAO;IACLP,GAAG;IACHC,MAAM;IACNC,UAAU;IACVC,OAAO;IACPG,IAAI;IACJD,OAAO,EAAEV,4BAA4B,CAACU,OAAO;EAC/C,CAAC;AACH;AAEA,OAAO,SAASG,iCAAiCA,CAC/CC,SAAiB,EACjBC,aAAqB,EACrBC,WAAmB,EACnBZ,QAAqB,EACY;EACjC,OAAO;IACLU,SAAS;IACTC,aAAa;IACbC,WAAW;IACXP,UAAU,EAAEL,QAAQ,GAAGF,4BAA4B,CAAC,IAAIU,UAAU,CAACR,QAAQ,CAAC,CAAC,GAAG;EAClF,CAAC;AACH"}
1
+ {"version":3,"names":["fromNativeCertificateRequest","fromBase64StringToUint8Array","fromUint8ArrayToBase64String","fromNativeCertificateResponse","response","url","status","statusText","headers","base64body","request","body","Uint8Array","toNativeCertificateResponseResult","requestId","integrationId","keySystemId"],"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,SAASA,4BAA4B,QAAQ,4BAA4B;AACzE,SAASC,4BAA4B,EAAEC,4BAA4B,QAAQ,yBAAyB;AAepG,OAAO,SAASC,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,GAAGR,4BAA4B,CAACQ,UAAU,CAAC,GAAG,IAAIG,UAAU,CAAC,CAAC;EACrF,OAAO;IACLP,GAAG;IACHC,MAAM;IACNC,UAAU;IACVC,OAAO;IACPG,IAAI;IACJD,OAAO,EAAEV,4BAA4B,CAACU,OAAO;EAC/C,CAAC;AACH;AAEA,OAAO,SAASG,iCAAiCA,CAC/CC,SAAiB,EACjBC,aAAqB,EACrBC,WAAmB,EACnBZ,QAAqB,EACY;EACjC,OAAO;IACLU,SAAS;IACTC,aAAa;IACbC,WAAW;IACXP,UAAU,EAAEL,QAAQ,GAAGF,4BAA4B,CAAC,IAAIU,UAAU,CAACR,QAAQ,CAAC,CAAC,GAAG;EAClF,CAAC;AACH"}
@@ -1 +1 @@
1
- {"version":3,"names":["fromNativeLicenseRequest","fromBase64StringToUint8Array","fromUint8ArrayToBase64String","fromNativeLicenseResponse","response","url","status","statusText","headers","base64body","request","body","Uint8Array","toNativeLicenseResponseResult","requestId","integrationId","keySystemId"],"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,SAASA,wBAAwB,QAAQ,wBAAwB;AACjE,SAASC,4BAA4B,EAAEC,4BAA4B,QAAQ,yBAAyB;AAepG,OAAO,SAASC,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,GAAGR,4BAA4B,CAACQ,UAAU,CAAC,GAAG,IAAIG,UAAU,EAAE;EACrF,OAAO;IACLP,GAAG;IACHC,MAAM;IACNC,UAAU;IACVC,OAAO;IACPG,IAAI;IACJD,OAAO,EAAEV,wBAAwB,CAACU,OAAO;EAC3C,CAAC;AACH;AAEA,OAAO,SAASG,6BAA6BA,CAC3CC,SAAiB,EACjBC,aAAqB,EACrBC,WAAmB,EACnBZ,QAAqB,EACQ;EAC7B,OAAO;IACLU,SAAS;IACTC,aAAa;IACbC,WAAW;IACXP,UAAU,EAAEL,QAAQ,GAAGF,4BAA4B,CAAC,IAAIU,UAAU,CAACR,QAAQ,CAAC,CAAC,GAAG;EAClF,CAAC;AACH"}
1
+ {"version":3,"names":["fromNativeLicenseRequest","fromBase64StringToUint8Array","fromUint8ArrayToBase64String","fromNativeLicenseResponse","response","url","status","statusText","headers","base64body","request","body","Uint8Array","toNativeLicenseResponseResult","requestId","integrationId","keySystemId"],"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,SAASA,wBAAwB,QAAQ,wBAAwB;AACjE,SAASC,4BAA4B,EAAEC,4BAA4B,QAAQ,yBAAyB;AAepG,OAAO,SAASC,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,GAAGR,4BAA4B,CAACQ,UAAU,CAAC,GAAG,IAAIG,UAAU,CAAC,CAAC;EACrF,OAAO;IACLP,GAAG;IACHC,MAAM;IACNC,UAAU;IACVC,OAAO;IACPG,IAAI;IACJD,OAAO,EAAEV,wBAAwB,CAACU,OAAO;EAC3C,CAAC;AACH;AAEA,OAAO,SAASG,6BAA6BA,CAC3CC,SAAiB,EACjBC,aAAqB,EACrBC,WAAmB,EACnBZ,QAAqB,EACQ;EAC7B,OAAO;IACLU,SAAS;IACTC,aAAa;IACbC,WAAW;IACXP,UAAU,EAAEL,QAAQ,GAAGF,4BAA4B,CAAC,IAAIU,UAAU,CAACR,QAAQ,CAAC,CAAC,GAAG;EAClF,CAAC;AACH"}
@@ -46,7 +46,7 @@ export interface ABRStrategyConfiguration {
46
46
  *
47
47
  * @public
48
48
  */
49
- export declare type ABRStrategy = ABRStrategyConfiguration | ABRStrategyType;
49
+ export type ABRStrategy = ABRStrategyConfiguration | ABRStrategyType;
50
50
  /**
51
51
  * Describes the adaptive bitrate configuration.
52
52
  *
@@ -127,7 +127,7 @@ export interface Ad {
127
127
  *
128
128
  * @public
129
129
  */
130
- export declare type AdReadyState = 'none' | 'ready';
130
+ export type AdReadyState = 'none' | 'ready';
131
131
  /**
132
132
  * Represents the information regarding the universal identifier of an ad.
133
133
  *
@@ -187,7 +187,7 @@ export interface NonLinearAd extends Ad {
187
187
  *
188
188
  * @public
189
189
  */
190
- export declare type DeliveryType = 'progressive' | 'streaming';
190
+ export type DeliveryType = 'progressive' | 'streaming';
191
191
  /**
192
192
  * Represents metadata of an media file with ad content.
193
193
  *
@@ -57,7 +57,7 @@ export interface AdsConfiguration {
57
57
  *
58
58
  * @public
59
59
  */
60
- export declare type AdPreloadType = 'none' | 'midroll-and-postroll';
60
+ export type AdPreloadType = 'none' | 'midroll-and-postroll';
61
61
  /**
62
62
  * The iframe policies for VPAID ads, represented by a value from the following list:
63
63
  * <br/> - `'enabled'`: Ads will load in a cross domain iframe. This disables access to the site via JavaScript. Ads that require a friendly iframe will fail to play.
@@ -66,4 +66,4 @@ export declare type AdPreloadType = 'none' | 'midroll-and-postroll';
66
66
  *
67
67
  * @public
68
68
  */
69
- export declare type VPAIDMode = 'enabled' | 'insecure' | 'disabled';
69
+ export type VPAIDMode = 'enabled' | 'insecure' | 'disabled';
@@ -7,6 +7,7 @@ export interface GoogleImaConfiguration {
7
7
  /**
8
8
  * Whether the native (mobile) IMA implementation will be used.
9
9
  *
10
+ * @deprecated This property applies to native web-based player SDKs and will be removed.
10
11
  * @internal
11
12
  */
12
13
  useNativeIma: boolean;
@@ -1,5 +1,6 @@
1
1
  export * from './abr/barrel';
2
2
  export * from './ads/barrel';
3
+ export * from './cache/barrel';
3
4
  export * from './cast/barrel';
4
5
  export * from './pip/barrel';
5
6
  export * from './config/barrel';
@@ -0,0 +1,23 @@
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
+ * The expiration date of the cached data.
15
+ *
16
+ * @remarks
17
+ * <br/> - Must be a date in the future.
18
+ * <br/> - Data might be removed by the browser if it runs out of disk space.
19
+ *
20
+ * @defaultValue 30 minutes after starting the caching task.
21
+ */
22
+ textTrackSelection?: string[];
23
+ }
@@ -0,0 +1,93 @@
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 declare enum CacheTaskStatus {
18
+ idle = "idle",
19
+ loading = "loading",
20
+ done = "done",
21
+ error = "error",
22
+ evicted = "evicted"
23
+ }
24
+ /**
25
+ * Represents a caching task.
26
+ *
27
+ * @public
28
+ */
29
+ export interface CachingTask extends EventDispatcher<CachingTaskEventMap> {
30
+ /**
31
+ * The generated identifier for the task.
32
+ */
33
+ readonly id: string;
34
+ /**
35
+ * The current status of the task.
36
+ */
37
+ readonly status: CacheTaskStatus;
38
+ /**
39
+ * The media source associated with the task.
40
+ */
41
+ readonly source: SourceDescription;
42
+ /**
43
+ * The configuration of the task.
44
+ */
45
+ readonly parameters: CachingTaskParameters;
46
+ /**
47
+ * The requested cached duration of the media, in seconds.
48
+ */
49
+ readonly duration: number;
50
+ /**
51
+ * The time ranges cached, in milliseconds.
52
+ */
53
+ readonly cached: TimeRange[];
54
+ /**
55
+ * The duration cached, in seconds.
56
+ */
57
+ readonly secondsCached: number;
58
+ /**
59
+ * The percentage cached, a value between 0 and 1.
60
+ */
61
+ readonly percentageCached: number;
62
+ /**
63
+ * The estimation of the amount this task will download and store, in bytes.
64
+ *
65
+ * @remarks
66
+ * <br/> - Available only on Web and Android.
67
+ * <br/> - Returns -1 if the estimate is not available yet.
68
+ */
69
+ readonly bytes: number;
70
+ /**
71
+ * The amount downloaded and stored, in bytes.
72
+ */
73
+ readonly bytesCached: number;
74
+ /**
75
+ * The API for license related queries and operations
76
+ */
77
+ readonly license: CachingTaskLicense;
78
+ /**
79
+ * Start caching the media.
80
+ */
81
+ start(): void;
82
+ /**
83
+ * Remove the cached media.
84
+ */
85
+ remove(): void;
86
+ /**
87
+ * Pause caching the media.
88
+ *
89
+ * @remarks
90
+ * <br/> - A paused task can be resumed with {@link CachingTask.start}.
91
+ */
92
+ pause(): void;
93
+ }
@@ -0,0 +1,14 @@
1
+ /**
2
+ * The {@link CachingTask}'s license API.
3
+ *
4
+ * @public
5
+ */
6
+ import type { DRMConfiguration } from 'react-native-theoplayer';
7
+ export interface CachingTaskLicense {
8
+ /**
9
+ * Renew all the licenses associated with this task.
10
+ *
11
+ * @param drmConfiguration - The DRM configuration used for license renewals. Defaults to the DRM configuration of the original sourceDescription when omitted.
12
+ */
13
+ renew(drmConfiguration?: DRMConfiguration): void;
14
+ }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * List of caching tasks.
3
+ *
4
+ * @public
5
+ */
6
+ import type { CachingTask } from './CachingTask';
7
+ export type CachingTaskList = CachingTask[];
@@ -0,0 +1,57 @@
1
+ import type { CachingPreferredTrackSelection } from "./CachingPreferredTrackSelection";
2
+ /**
3
+ * Describes the configuration of a caching task.
4
+ *
5
+ * @public
6
+ */
7
+ export interface CachingTaskParameters {
8
+ /**
9
+ * The amount of data to cache for the given stream.
10
+ *
11
+ * @remarks
12
+ * <br/> - Available only on Web and Android. On iOS this value we always be '100%'.
13
+ *
14
+ * Possible formats:
15
+ * <br/> - A number in seconds.
16
+ * <br/> - A percentage string (XX%) for a proportion of the content duration.
17
+ *
18
+ */
19
+ readonly amount: number | string;
20
+ /**
21
+ * The expiration date of the cached data.
22
+ *
23
+ * @remarks
24
+ * <br/> - Must be a date in the future.
25
+ * <br/> - Data might be removed by the browser if it runs out of disk space.
26
+ *
27
+ * @defaultValue 30 minutes after starting the caching task.
28
+ */
29
+ readonly expirationDate?: Date;
30
+ /**
31
+ * Upper bandwidth limit of the quality to cache.
32
+ *
33
+ * @remarks
34
+ * <br/> - This will take the quality with the highest bandwidth that is lower than the specified bandwidth.
35
+ * <br/> - It should be a value between zero and infinity.
36
+ *
37
+ * @defaultValue Infinity
38
+ */
39
+ readonly bandwidth?: number;
40
+ /**
41
+ * The preferred audio/text tracks to cache.
42
+ *
43
+ * @remarks
44
+ * <br/> - Available only on iOS and Android.
45
+ * <br/> - By default, the first track will be picked.
46
+ */
47
+ readonly preferredTrackSelection?: CachingPreferredTrackSelection;
48
+ /**
49
+ * An indication of whether the data should be cached on a cellular network, or only on WIFI. Defaults to true.
50
+ *
51
+ * @remarks
52
+ * <br/> - Available only on iOS.
53
+ * <br/> - The value can not be changed on a scheduled asset.
54
+ * <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`.
55
+ */
56
+ readonly allowsCellularAccess?: boolean;
57
+ }
@@ -0,0 +1,39 @@
1
+ import type { EventDispatcher } from '../event/EventDispatcher';
2
+ import type { SourceDescription } from 'react-native-theoplayer';
3
+ import type { CachingTaskParameters } from './CachingTaskParameters';
4
+ import type { CachingTask } from './CachingTask';
5
+ import type { CacheEventMap } from './events/CacheEvent';
6
+ import type { CachingTaskList } from './CachingTaskList';
7
+ /**
8
+ * The cache status, represented by a value from the following list:
9
+ * <br/> - `'uninitialised'`: Previously stored caching tasks are unavailable.
10
+ * <br/> - `'initialised'`: Previously stored caching tasks are now available.
11
+ *
12
+ * @public
13
+ */
14
+ export declare enum CacheStatus {
15
+ uninitialised = "uninitialised",
16
+ initialised = "initialised"
17
+ }
18
+ /**
19
+ * The media cache API.
20
+ *
21
+ * @public
22
+ */
23
+ export interface MediaCacheAPI extends EventDispatcher<CacheEventMap> {
24
+ /**
25
+ * List of caching tasks which control the caching of media.
26
+ */
27
+ readonly tasks: CachingTaskList;
28
+ /**
29
+ * The current status of the cache.
30
+ */
31
+ readonly status: CacheStatus;
32
+ /**
33
+ * Create a caching task which controls the caching of media.
34
+ *
35
+ * @param source - Describes the media source to be cached.
36
+ * @param parameters - Contains caching task related options.
37
+ */
38
+ createTask(source: SourceDescription, parameters: CachingTaskParameters): Promise<CachingTask>;
39
+ }
@@ -0,0 +1,7 @@
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';
@@ -0,0 +1,55 @@
1
+ import type { Event } from '../../event/Event';
2
+ import type { CacheStatus } from '../MediaCacheAPI';
3
+ import type { CachingTask } from '../CachingTask';
4
+ export declare enum CacheEventType {
5
+ statechange = "statechange",
6
+ addtask = "addtask",
7
+ removetask = "removetask"
8
+ }
9
+ /**
10
+ * The events dispatched by the {@link Cache | cache API}.
11
+ *
12
+ * @public
13
+ */
14
+ export interface CacheEventMap {
15
+ /**
16
+ * Dispatched when {@link Cache.status} changes.
17
+ */
18
+ [CacheEventType.statechange]: Event<CacheEventType.statechange>;
19
+ /**
20
+ * {@inheritDoc AddCachingTaskEvent}
21
+ */
22
+ [CacheEventType.addtask]: AddCachingTaskEvent;
23
+ /**
24
+ * {@inheritDoc AddCachingTaskEvent}
25
+ */
26
+ [CacheEventType.removetask]: RemoveCachingTaskEvent;
27
+ }
28
+ export interface CacheStatusChangeEvent extends Event<CacheEventType.statechange> {
29
+ /**
30
+ * The cache's new status.
31
+ */
32
+ readonly status: CacheStatus;
33
+ }
34
+ /**
35
+ * Dispatched when a caching task is added.
36
+ *
37
+ * @public
38
+ */
39
+ export interface AddCachingTaskEvent extends Event<CacheEventType.addtask> {
40
+ /**
41
+ * The task which has been added.
42
+ */
43
+ readonly task: CachingTask;
44
+ }
45
+ /**
46
+ * Dispatched when a caching task is removed.
47
+ *
48
+ * @public
49
+ */
50
+ export interface RemoveCachingTaskEvent extends Event<CacheEventType.removetask> {
51
+ /**
52
+ * The task which has been removed.
53
+ */
54
+ readonly task: CachingTask;
55
+ }
@@ -0,0 +1,22 @@
1
+ import type { Event } from '../../event/Event';
2
+ export declare enum CachingTaskEventType {
3
+ progress = "progress",
4
+ statechange = "statechange"
5
+ }
6
+ /**
7
+ * The events dispatched by the {@link CachingTask}.
8
+ *
9
+ * @public
10
+ */
11
+ export interface CachingTaskEventMap {
12
+ /**
13
+ * Dispatched when a segment is added to the cache.
14
+ */
15
+ [CachingTaskEventType.progress]: Event<CachingTaskEventType.progress>;
16
+ /**
17
+ * Dispatched when {@link CachingTask.status} changes.
18
+ */
19
+ [CachingTaskEventType.statechange]: Event<CachingTaskEventType.statechange>;
20
+ }
21
+ export type CachingTaskProgressEvent = Event<CachingTaskEventType.progress>;
22
+ export type CachingTaskStatusChangeEvent = Event<CachingTaskEventType.statechange>;
@@ -0,0 +1,2 @@
1
+ export * from './CacheEvent';
2
+ export * from './CachingTaskEvent';
@@ -0,0 +1,3 @@
1
+ export * from './useCachingTaskList';
2
+ export * from './useCachingTaskProgress';
3
+ export * from './useCachingTaskStatus';
@@ -0,0 +1 @@
1
+ export declare const useCachingTaskList: (debug?: boolean) => import("react-native-theoplayer").CachingTask[];
@@ -0,0 +1,2 @@
1
+ import { CachingTask } from 'react-native-theoplayer';
2
+ export declare const useCachingTaskProgress: (task: CachingTask, debug?: boolean) => number | undefined;
@@ -0,0 +1,2 @@
1
+ import { CacheTaskStatus, CachingTask } from 'react-native-theoplayer';
2
+ export declare const useCachingTaskStatus: (task: CachingTask, debug?: boolean) => CacheTaskStatus | undefined;
@@ -25,7 +25,7 @@ export interface CastConfiguration {
25
25
  *
26
26
  * @public
27
27
  */
28
- export declare type JoinStrategy = 'auto' | 'manual' | 'disabled';
28
+ export type JoinStrategy = 'auto' | 'manual' | 'disabled';
29
29
  /**
30
30
  * Describes the configuration of the Chromecast integration.
31
31
  *
@@ -45,6 +45,9 @@ export interface PlayerConfiguration {
45
45
  readonly licenseUrl?: string;
46
46
  /**
47
47
  * Sets whether the native player is chromeless (without UI).
48
+ *
49
+ * @remarks
50
+ * <br/> - This parameter only applies to Web platforms.
48
51
  */
49
52
  readonly chromeless?: boolean;
50
53
  /**
@@ -63,4 +66,4 @@ export interface PlayerConfiguration {
63
66
  *
64
67
  * @public
65
68
  */
66
- export declare type MutedAutoplayConfiguration = 'none' | 'all' | 'content';
69
+ export type MutedAutoplayConfiguration = 'none' | 'all' | 'content';
@@ -5,8 +5,8 @@ import type { CertificateResponse, LicenseResponse } from './ContentProtectionRe
5
5
  *
6
6
  * @public
7
7
  */
8
- export declare type MaybeAsync<T> = T | PromiseLike<T>;
9
- export declare type BufferSource = ArrayBufferView | ArrayBuffer;
8
+ export type MaybeAsync<T> = T | PromiseLike<T>;
9
+ export type BufferSource = ArrayBufferView | ArrayBuffer;
10
10
  /**
11
11
  * This ContentProtectionIntegration defines some methods to alter license and certificate requests and responses.
12
12
  *
@@ -40,7 +40,7 @@ export interface ContentProtectionRequest {
40
40
  *
41
41
  * @public
42
42
  */
43
- export declare type CertificateRequest = ContentProtectionRequest;
43
+ export type CertificateRequest = ContentProtectionRequest;
44
44
  /**
45
45
  * A request for a license.
46
46
  * @public
@@ -16,7 +16,7 @@
16
16
  *
17
17
  * @public
18
18
  */
19
- export declare type ChromecastErrorCode = 'CANCEL' | 'TIMEOUT' | 'API_NOT_INITIALIZED' | 'INVALID_PARAMETER' | 'EXTENSION_NOT_COMPATIBLE' | 'EXTENSION_MISSING' | 'RECEIVER_UNAVAILABLE' | 'SESSION_ERROR' | 'CHANNEL_ERROR' | 'LOAD_MEDIA_FAILED';
19
+ export type ChromecastErrorCode = 'CANCEL' | 'TIMEOUT' | 'API_NOT_INITIALIZED' | 'INVALID_PARAMETER' | 'EXTENSION_NOT_COMPATIBLE' | 'EXTENSION_MISSING' | 'RECEIVER_UNAVAILABLE' | 'SESSION_ERROR' | 'CHANNEL_ERROR' | 'LOAD_MEDIA_FAILED';
20
20
  /**
21
21
  * An error that occurred while casting or attempting to cast to Chromecast.
22
22
  *
@@ -14,7 +14,7 @@ export declare enum CastEventType {
14
14
  */
15
15
  CHROMECAST_ERROR = "chromecasterror"
16
16
  }
17
- export declare type CastEvent = ChromecastChangeEvent | AirplayStateChangeEvent | ChromecastErrorEvent;
17
+ export type CastEvent = ChromecastChangeEvent | AirplayStateChangeEvent | ChromecastErrorEvent;
18
18
  export interface ChromecastChangeEvent extends Event<PlayerEventType.CAST_EVENT> {
19
19
  readonly subType: CastEventType.CHROMECAST_STATE_CHANGE;
20
20
  readonly state: CastState;
@@ -14,13 +14,13 @@ import type { EventListener } from './EventListener';
14
14
  *
15
15
  * @public
16
16
  */
17
- export declare type EventMap<TType extends string> = Record<TType, Event<TType>>;
17
+ export type EventMap<TType extends string> = Record<TType, Event<TType>>;
18
18
  /**
19
19
  * Helper type to extract string keys from type objects.
20
20
  *
21
21
  * @public
22
22
  */
23
- export declare type StringKeyOf<T> = Extract<keyof T, string>;
23
+ export type StringKeyOf<T> = Extract<keyof T, string>;
24
24
  /**
25
25
  * Dispatches events that are fired.
26
26
  *