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
@@ -4,4 +4,4 @@ import type { Event } from './Event';
4
4
  *
5
5
  * @public
6
6
  */
7
- export declare type EventListener<TEvent extends Event> = (event: TEvent) => void;
7
+ export type EventListener<TEvent extends Event> = (event: TEvent) => void;
@@ -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 declare type PreloadType = 'none' | 'metadata' | 'auto' | '';
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 declare type NativeHandleType = unknown;
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 declare type Source = TypedSource;
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 declare type Sources = Source | Source[];
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 declare type CrossOriginSetting = '' | 'anonymous' | 'use-credentials';
37
+ export type CrossOriginSetting = '' | 'anonymous' | 'use-credentials';
38
38
  /**
39
39
  * Describes the configuration of a player's source.
40
40
  *
@@ -9,7 +9,7 @@
9
9
  *
10
10
  * @public
11
11
  */
12
- export declare type AdSourceType = 'vast' | 'vmap' | 'adrule';
12
+ export type AdSourceType = 'vast' | 'vmap' | 'adrule';
13
13
  /**
14
14
  * Describes the source of the ad.
15
15
  *
@@ -8,7 +8,7 @@ import type { AdDescription, AdIntegrationKind } from "./Ads";
8
8
  *
9
9
  * @public
10
10
  */
11
- export declare type FreeWheelAdUnitType = 'preroll' | 'midroll' | 'postroll' | 'overlay';
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 declare type GoogleDAISSAIIntegrationID = 'google-dai';
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 declare type DAIAvailabilityType = 'vod' | 'live';
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 declare type ImagineSSAIIntegrationID = 'imagine';
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 declare type SSAIIntegrationId = YospaceSSAIIntegrationID | GoogleDAISSAIIntegrationID | ImagineSSAIIntegrationID;
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 declare type YospaceSSAIIntegrationID = 'yospace';
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 declare type YospaceStreamType = 'vod' | 'live' | 'livepause' | 'nonlinear';
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 declare type SeamlessPeriodSwitchStrategy = 'auto' | 'always' | 'never';
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 declare type LicenseType = 'temporary' | 'persistent';
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 declare type WidevineKeySystemConfiguration = KeySystemConfiguration;
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 declare type KeySystemId = 'widevine' | 'fairplay' | 'playready';
232
+ export type KeySystemId = 'widevine' | 'fairplay' | 'playready';
@@ -18,7 +18,7 @@
18
18
  *
19
19
  * @public
20
20
  */
21
- export declare type HlsDiscontinuityAlignment = 'auto' | 'playlist' | 'media';
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 declare type MediaTrackKind = 'main' | 'alternative';
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,4 @@
1
1
  export * from './api/barrel';
2
2
  export { THEOplayerView } from './internal/THEOplayerView';
3
3
  export { ContentProtectionRegistry } from './internal/drm/ContentProtectionRegistry';
4
+ export { MediaCache } from './internal/cache/MediaCache';
@@ -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 * as THEOplayerWeb from 'theoplayer';
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: THEOplayerWeb.ChromelessPlayer, config?: PlayerConfiguration);
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 * as THEOplayer from 'theoplayer';
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: THEOplayer.ChromelessPlayer, facade: THEOplayerWebAdapter);
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 * as THEOplayer from 'theoplayer';
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: THEOplayer.ChromelessPlayer);
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 * as THEOplayer from 'theoplayer';
2
+ import type { ChromelessPlayer } from 'theoplayer';
3
3
  export declare class THEOplayerWebCastAdapter implements CastAPI {
4
4
  private readonly _player;
5
- constructor(player: THEOplayer.ChromelessPlayer);
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 declare type NativeCastEvent = NativeChromecastChangeEvent | NativeAirplayStateChangeEvent | NativeChromecastErrorEvent;
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 * as THEOplayerWeb from 'theoplayer';
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: THEOplayerWeb.ChromelessPlayer, eventForwarder: DefaultEventDispatcher<PlayerEventMap>);
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": "2.16.1",
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": "^5.1.1",
52
- "@types/react": "^18.0.31",
53
- "@types/react-native": "^0.71.5",
54
- "commitlint": "^11.0.0",
55
- "eslint": "^7.2.0",
56
- "eslint-config-prettier": "^7.0.0",
57
- "eslint-plugin-prettier": "^3.1.3",
58
- "eslint-plugin-react-native": "^4.0.0",
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.0",
61
- "prettier": "^2.0.5",
60
+ "pod-install": "^0.1.39",
61
+ "prettier": "^2.8.8",
62
62
  "react": "^18.2.0",
63
- "react-native": "^0.71.5",
64
- "react-native-builder-bob": "^0.18.0",
65
- "release-it": "^15.5.0",
66
- "typescript": "^4.1.3"
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", "~> 5.11"
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", "~> 5.11"
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", "~> 5.11"
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"
@@ -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;
package/src/api/barrel.ts CHANGED
@@ -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,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
+ }