react-native-theoplayer 1.6.1 → 1.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (465) hide show
  1. package/README.md +4 -0
  2. package/android/build.gradle +70 -25
  3. package/android/local/com/theoplayer/theoplayer-sdk-android/ads-wrapper/4.3.0/ads-wrapper-4.3.0.aar +0 -0
  4. package/android/local/com/theoplayer/theoplayer-sdk-android/ads-wrapper/4.3.0/ads-wrapper-4.3.0.pom +9 -0
  5. package/android/local/com/theoplayer/theoplayer-sdk-android/ads-wrapper/maven-metadata-local.xml +13 -0
  6. package/android/src/main/java/com/theoplayer/PlayerConfigHelper.java +40 -0
  7. package/android/src/main/java/com/theoplayer/ReactTHEOplayerPackage.java +8 -3
  8. package/android/src/main/java/com/theoplayer/ReactTHEOplayerView.java +131 -28
  9. package/android/src/main/java/com/theoplayer/ReactTHEOplayerViewManager.java +14 -1
  10. package/android/src/main/java/com/theoplayer/SourceHelper.java +137 -86
  11. package/android/src/main/java/com/theoplayer/VideoEventEmitter.java +44 -12
  12. package/android/src/main/java/com/theoplayer/abr/ABRConfigurationAdapter.kt +72 -0
  13. package/android/src/main/java/com/theoplayer/ads/AdEventAdapter.java +92 -0
  14. package/android/src/main/java/com/theoplayer/ads/AdInfo.java +168 -0
  15. package/android/src/main/java/com/theoplayer/ads/AdsModule.java +152 -0
  16. package/android/src/main/java/com/theoplayer/drm/ContentProtectionAdapter.kt +143 -0
  17. package/android/src/main/java/com/theoplayer/drm/ContentProtectionModule.kt +269 -0
  18. package/android/src/main/java/com/theoplayer/drm/KeySystemAdapter.kt +22 -0
  19. package/android/src/main/java/com/theoplayer/drm/ProxyContentProtectionIntegration.kt +33 -0
  20. package/android/src/main/java/com/theoplayer/drm/ProxyContentProtectionIntegrationFactory.kt +19 -0
  21. package/android/src/main/java/com/theoplayer/drm/RequestMethodAdapter.kt +28 -0
  22. package/android/src/main/java/com/theoplayer/track/QualityListAdapter.java +54 -0
  23. package/android/src/main/java/com/theoplayer/track/QualityListFilter.java +40 -0
  24. package/android/src/main/java/com/theoplayer/track/TrackListInfo.java +10 -2
  25. package/android/src/main/java/com/theoplayer/util/TypeUtils.kt +17 -0
  26. package/android/src/main/java/com/theoplayer/util/ViewResolver.java +42 -0
  27. package/ios/THEOplayerRCTAdAggregator.swift +158 -0
  28. package/ios/THEOplayerRCTAdsAPI.swift +296 -0
  29. package/ios/THEOplayerRCTBridge.m +65 -0
  30. package/ios/THEOplayerRCTContentProtectionAPI.swift +359 -0
  31. package/ios/THEOplayerRCTContentProtectionAggregator.swift +119 -0
  32. package/ios/THEOplayerRCTDebug.swift +11 -5
  33. package/ios/THEOplayerRCTMetadataAggregator.swift +1 -1
  34. package/ios/THEOplayerRCTNetworkUtils.swift +54 -0
  35. package/ios/THEOplayerRCTProxyContentProtectionIntegration.swift +155 -0
  36. package/ios/THEOplayerRCTProxyContentProtectionIntegrationFactory.swift +32 -0
  37. package/ios/THEOplayerRCTSourceDescriptionBuilder.swift +223 -30
  38. package/ios/THEOplayerRCTTypeUtils.swift +18 -0
  39. package/ios/THEOplayerRCTView.swift +109 -49
  40. package/ios/THEOplayerRCTViewAdEventHandler.swift +238 -0
  41. package/ios/{THEOplayerRCTViewEventHandler.swift → THEOplayerRCTViewMainEventHandler.swift} +7 -119
  42. package/ios/THEOplayerRCTViewTextTrackEventHandler.swift +134 -0
  43. package/ios/Theoplayer-Bridging-Header.h +3 -1
  44. package/ios/custom/Frameworks/ios/put_custom_ios_xcframework_here.txt +2 -0
  45. package/ios/custom/react-native-theoplayer_custom_ios.podspec +36 -0
  46. package/ios/custom/theofeatures.sh +14 -0
  47. package/lib/commonjs/api/THEOplayerView.js.map +1 -1
  48. package/lib/commonjs/api/abr/ABRConfiguration.js +2 -0
  49. package/lib/commonjs/api/abr/ABRConfiguration.js.map +1 -0
  50. package/lib/commonjs/api/abr/barrel.js +19 -0
  51. package/lib/commonjs/api/abr/barrel.js.map +1 -0
  52. package/lib/commonjs/api/ads/Ad.js +6 -0
  53. package/lib/commonjs/api/ads/Ad.js.map +1 -0
  54. package/lib/commonjs/api/ads/AdBreak.js +6 -0
  55. package/lib/commonjs/api/ads/AdBreak.js.map +1 -0
  56. package/lib/commonjs/api/ads/AdsAPI.js +6 -0
  57. package/lib/commonjs/api/ads/AdsAPI.js.map +1 -0
  58. package/lib/commonjs/api/ads/AdsConfiguration.js +6 -0
  59. package/lib/commonjs/api/ads/AdsConfiguration.js.map +1 -0
  60. package/lib/commonjs/api/ads/CompanionAd.js +2 -0
  61. package/lib/commonjs/api/ads/CompanionAd.js.map +1 -0
  62. package/lib/commonjs/api/ads/GoogleDai.js +2 -0
  63. package/lib/commonjs/api/ads/GoogleDai.js.map +1 -0
  64. package/lib/commonjs/api/ads/GoogleImaAd.js +6 -0
  65. package/lib/commonjs/api/ads/GoogleImaAd.js.map +1 -0
  66. package/lib/commonjs/api/ads/GoogleImaConfiguration.js +2 -0
  67. package/lib/commonjs/api/ads/GoogleImaConfiguration.js.map +1 -0
  68. package/lib/commonjs/api/ads/barrel.js +110 -0
  69. package/lib/commonjs/api/ads/barrel.js.map +1 -0
  70. package/lib/commonjs/api/barrel.js +58 -6
  71. package/lib/commonjs/api/barrel.js.map +1 -1
  72. package/lib/commonjs/api/config/PlayerConfiguration.js +4 -0
  73. package/lib/commonjs/api/config/PlayerConfiguration.js.map +1 -1
  74. package/lib/commonjs/api/drm/ContentProtectionAPI.js +6 -0
  75. package/lib/commonjs/api/drm/ContentProtectionAPI.js.map +1 -0
  76. package/lib/commonjs/api/drm/ContentProtectionIntegration.js +6 -0
  77. package/lib/commonjs/api/drm/ContentProtectionIntegration.js.map +1 -0
  78. package/lib/commonjs/api/drm/ContentProtectionIntegrationFactory.js +6 -0
  79. package/lib/commonjs/api/drm/ContentProtectionIntegrationFactory.js.map +1 -0
  80. package/lib/commonjs/api/drm/ContentProtectionRequest.js +2 -0
  81. package/lib/commonjs/api/drm/ContentProtectionRequest.js.map +1 -0
  82. package/lib/commonjs/api/drm/ContentProtectionResponse.js +6 -0
  83. package/lib/commonjs/api/drm/ContentProtectionResponse.js.map +1 -0
  84. package/lib/commonjs/api/drm/barrel.js +71 -0
  85. package/lib/commonjs/api/drm/barrel.js.map +1 -0
  86. package/lib/commonjs/api/event/AdEvent.js +89 -0
  87. package/lib/commonjs/api/event/AdEvent.js.map +1 -0
  88. package/lib/commonjs/api/event/barrel.js +13 -0
  89. package/lib/commonjs/api/event/barrel.js.map +1 -1
  90. package/lib/commonjs/api/source/SourceDescription.js.map +1 -1
  91. package/lib/commonjs/api/source/ads/FreeWheelAdDescription.js +6 -0
  92. package/lib/commonjs/api/source/ads/FreeWheelAdDescription.js.map +1 -0
  93. package/lib/commonjs/api/source/ads/IMAAdDescription.js +6 -0
  94. package/lib/commonjs/api/source/ads/IMAAdDescription.js.map +1 -0
  95. package/lib/commonjs/api/source/ads/SpotXAdDescription.js +6 -0
  96. package/lib/commonjs/api/source/ads/SpotXAdDescription.js.map +1 -0
  97. package/lib/commonjs/api/source/ads/THEOplayerAdDescription.js +6 -0
  98. package/lib/commonjs/api/source/ads/THEOplayerAdDescription.js.map +1 -0
  99. package/lib/commonjs/api/source/ads/barrel.js +84 -0
  100. package/lib/commonjs/api/source/ads/barrel.js.map +1 -0
  101. package/lib/commonjs/api/source/ads/ssai/GoogleDAIConfiguration.js +6 -0
  102. package/lib/commonjs/api/source/ads/ssai/GoogleDAIConfiguration.js.map +1 -0
  103. package/lib/commonjs/api/source/ads/ssai/ImagineServerSideAdInsertionConfiguration.js +6 -0
  104. package/lib/commonjs/api/source/ads/ssai/ImagineServerSideAdInsertionConfiguration.js.map +1 -0
  105. package/lib/commonjs/api/source/ads/ssai/ServerSideAdInsertionConfiguration.js +6 -0
  106. package/lib/commonjs/api/source/ads/ssai/ServerSideAdInsertionConfiguration.js.map +1 -0
  107. package/lib/commonjs/api/source/ads/ssai/YospaceServerSideAdInsertionConfiguration.js +6 -0
  108. package/lib/commonjs/api/source/ads/ssai/YospaceServerSideAdInsertionConfiguration.js.map +1 -0
  109. package/lib/commonjs/api/source/ads/ssai/barrel.js +58 -0
  110. package/lib/commonjs/api/source/ads/ssai/barrel.js.map +1 -0
  111. package/lib/commonjs/api/source/barrel.js +16 -3
  112. package/lib/commonjs/api/source/barrel.js.map +1 -1
  113. package/lib/commonjs/api/source/drm/DRMConfiguration.js.map +1 -1
  114. package/lib/commonjs/api/track/MediaTrack.js +29 -0
  115. package/lib/commonjs/api/track/MediaTrack.js.map +1 -1
  116. package/lib/commonjs/api/utils/TypeUtils.js +62 -0
  117. package/lib/commonjs/api/utils/TypeUtils.js.map +1 -0
  118. package/lib/commonjs/api/utils/barrel.js +19 -0
  119. package/lib/commonjs/api/utils/barrel.js.map +1 -0
  120. package/lib/commonjs/index.js +10 -1
  121. package/lib/commonjs/index.js.map +1 -1
  122. package/lib/commonjs/internal/THEOplayerView.js +42 -3
  123. package/lib/commonjs/internal/THEOplayerView.js.map +1 -1
  124. package/lib/commonjs/internal/THEOplayerView.web.js +41 -2
  125. package/lib/commonjs/internal/THEOplayerView.web.js.map +1 -1
  126. package/lib/commonjs/internal/ads/THEOplayerNativeAdsAPI.js +54 -0
  127. package/lib/commonjs/internal/ads/THEOplayerNativeAdsAPI.js.map +1 -0
  128. package/lib/commonjs/internal/ads/THEOplayerNativeGoogleDAI.js +34 -0
  129. package/lib/commonjs/internal/ads/THEOplayerNativeGoogleDAI.js.map +1 -0
  130. package/lib/commonjs/internal/ads/THEOplayerWebAdsAPI.js +78 -0
  131. package/lib/commonjs/internal/ads/THEOplayerWebAdsAPI.js.map +1 -0
  132. package/lib/commonjs/internal/ads/THEOplayerWebGoogleDAI.js +32 -0
  133. package/lib/commonjs/internal/ads/THEOplayerWebGoogleDAI.js.map +1 -0
  134. package/lib/commonjs/internal/drm/ContentProtectionRegistry.js +214 -0
  135. package/lib/commonjs/internal/drm/ContentProtectionRegistry.js.map +1 -0
  136. package/lib/commonjs/internal/drm/ContentProtectionRegistry.web.js +20 -0
  137. package/lib/commonjs/internal/drm/ContentProtectionRegistry.web.js.map +1 -0
  138. package/lib/commonjs/internal/drm/NativeCertificateRequest.js +41 -0
  139. package/lib/commonjs/internal/drm/NativeCertificateRequest.js.map +1 -0
  140. package/lib/commonjs/internal/drm/NativeCertificateResponse.js +41 -0
  141. package/lib/commonjs/internal/drm/NativeCertificateResponse.js.map +1 -0
  142. package/lib/commonjs/internal/drm/NativeContentProtectionEvent.js +2 -0
  143. package/lib/commonjs/internal/drm/NativeContentProtectionEvent.js.map +1 -0
  144. package/lib/commonjs/internal/drm/NativeLicenseRequest.js +44 -0
  145. package/lib/commonjs/internal/drm/NativeLicenseRequest.js.map +1 -0
  146. package/lib/commonjs/internal/drm/NativeLicenseResponse.js +41 -0
  147. package/lib/commonjs/internal/drm/NativeLicenseResponse.js.map +1 -0
  148. package/lib/commonjs/internal/utils/TypeUtils.js +41 -0
  149. package/lib/commonjs/internal/utils/TypeUtils.js.map +1 -0
  150. package/lib/commonjs/internal/web/TrackUtils.js +19 -0
  151. package/lib/commonjs/internal/web/TrackUtils.js.map +1 -1
  152. package/lib/module/api/THEOplayerView.js.map +1 -1
  153. package/lib/module/api/abr/ABRConfiguration.js +2 -0
  154. package/lib/module/api/abr/ABRConfiguration.js.map +1 -0
  155. package/lib/module/api/abr/barrel.js +2 -0
  156. package/lib/module/api/abr/barrel.js.map +1 -0
  157. package/lib/module/api/ads/Ad.js +2 -0
  158. package/lib/module/api/ads/Ad.js.map +1 -0
  159. package/lib/module/api/ads/AdBreak.js +2 -0
  160. package/lib/module/api/ads/AdBreak.js.map +1 -0
  161. package/lib/module/api/ads/AdsAPI.js +2 -0
  162. package/lib/module/api/ads/AdsAPI.js.map +1 -0
  163. package/lib/module/api/ads/AdsConfiguration.js +2 -0
  164. package/lib/module/api/ads/AdsConfiguration.js.map +1 -0
  165. package/lib/module/api/ads/CompanionAd.js +2 -0
  166. package/lib/module/api/ads/CompanionAd.js.map +1 -0
  167. package/lib/module/api/ads/GoogleDai.js +2 -0
  168. package/lib/module/api/ads/GoogleDai.js.map +1 -0
  169. package/lib/module/api/ads/GoogleImaAd.js +2 -0
  170. package/lib/module/api/ads/GoogleImaAd.js.map +1 -0
  171. package/lib/module/api/ads/GoogleImaConfiguration.js +2 -0
  172. package/lib/module/api/ads/GoogleImaConfiguration.js.map +1 -0
  173. package/lib/module/api/ads/barrel.js +9 -0
  174. package/lib/module/api/ads/barrel.js.map +1 -0
  175. package/lib/module/api/barrel.js +5 -1
  176. package/lib/module/api/barrel.js.map +1 -1
  177. package/lib/module/api/config/PlayerConfiguration.js +1 -1
  178. package/lib/module/api/config/PlayerConfiguration.js.map +1 -1
  179. package/lib/module/api/drm/ContentProtectionAPI.js +2 -0
  180. package/lib/module/api/drm/ContentProtectionAPI.js.map +1 -0
  181. package/lib/module/api/drm/ContentProtectionIntegration.js +2 -0
  182. package/lib/module/api/drm/ContentProtectionIntegration.js.map +1 -0
  183. package/lib/module/api/drm/ContentProtectionIntegrationFactory.js +2 -0
  184. package/lib/module/api/drm/ContentProtectionIntegrationFactory.js.map +1 -0
  185. package/lib/module/api/drm/ContentProtectionRequest.js +2 -0
  186. package/lib/module/api/drm/ContentProtectionRequest.js.map +1 -0
  187. package/lib/module/api/drm/ContentProtectionResponse.js +2 -0
  188. package/lib/module/api/drm/ContentProtectionResponse.js.map +1 -0
  189. package/lib/module/api/drm/barrel.js +6 -0
  190. package/lib/module/api/drm/barrel.js.map +1 -0
  191. package/lib/module/api/event/AdEvent.js +82 -0
  192. package/lib/module/api/event/AdEvent.js.map +1 -0
  193. package/lib/module/api/event/barrel.js +1 -0
  194. package/lib/module/api/event/barrel.js.map +1 -1
  195. package/lib/module/api/source/SourceDescription.js.map +1 -1
  196. package/lib/module/api/source/ads/FreeWheelAdDescription.js +2 -0
  197. package/lib/module/api/source/ads/FreeWheelAdDescription.js.map +1 -0
  198. package/lib/module/api/source/ads/IMAAdDescription.js +2 -0
  199. package/lib/module/api/source/ads/IMAAdDescription.js.map +1 -0
  200. package/lib/module/api/source/ads/SpotXAdDescription.js +2 -0
  201. package/lib/module/api/source/ads/SpotXAdDescription.js.map +1 -0
  202. package/lib/module/api/source/ads/THEOplayerAdDescription.js +2 -0
  203. package/lib/module/api/source/ads/THEOplayerAdDescription.js.map +1 -0
  204. package/lib/module/api/source/ads/barrel.js +7 -0
  205. package/lib/module/api/source/ads/barrel.js.map +1 -0
  206. package/lib/module/api/source/ads/ssai/GoogleDAIConfiguration.js +2 -0
  207. package/lib/module/api/source/ads/ssai/GoogleDAIConfiguration.js.map +1 -0
  208. package/lib/module/api/source/ads/ssai/ImagineServerSideAdInsertionConfiguration.js +2 -0
  209. package/lib/module/api/source/ads/ssai/ImagineServerSideAdInsertionConfiguration.js.map +1 -0
  210. package/lib/module/api/source/ads/ssai/ServerSideAdInsertionConfiguration.js +2 -0
  211. package/lib/module/api/source/ads/ssai/ServerSideAdInsertionConfiguration.js.map +1 -0
  212. package/lib/module/api/source/ads/ssai/YospaceServerSideAdInsertionConfiguration.js +2 -0
  213. package/lib/module/api/source/ads/ssai/YospaceServerSideAdInsertionConfiguration.js.map +1 -0
  214. package/lib/module/api/source/ads/ssai/barrel.js +5 -0
  215. package/lib/module/api/source/ads/ssai/barrel.js.map +1 -0
  216. package/lib/module/api/source/barrel.js +1 -0
  217. package/lib/module/api/source/barrel.js.map +1 -1
  218. package/lib/module/api/source/drm/DRMConfiguration.js.map +1 -1
  219. package/lib/module/api/track/MediaTrack.js +23 -1
  220. package/lib/module/api/track/MediaTrack.js.map +1 -1
  221. package/lib/module/api/utils/TypeUtils.js +36 -0
  222. package/lib/module/api/utils/TypeUtils.js.map +1 -0
  223. package/lib/module/api/utils/barrel.js +2 -0
  224. package/lib/module/api/utils/barrel.js.map +1 -0
  225. package/lib/module/index.js +1 -0
  226. package/lib/module/index.js.map +1 -1
  227. package/lib/module/internal/THEOplayerView.js +40 -3
  228. package/lib/module/internal/THEOplayerView.js.map +1 -1
  229. package/lib/module/internal/THEOplayerView.web.js +42 -4
  230. package/lib/module/internal/THEOplayerView.web.js.map +1 -1
  231. package/lib/module/internal/ads/THEOplayerNativeAdsAPI.js +43 -0
  232. package/lib/module/internal/ads/THEOplayerNativeAdsAPI.js.map +1 -0
  233. package/lib/module/internal/ads/THEOplayerNativeGoogleDAI.js +24 -0
  234. package/lib/module/internal/ads/THEOplayerNativeGoogleDAI.js.map +1 -0
  235. package/lib/module/internal/ads/THEOplayerWebAdsAPI.js +68 -0
  236. package/lib/module/internal/ads/THEOplayerWebAdsAPI.js.map +1 -0
  237. package/lib/module/internal/ads/THEOplayerWebGoogleDAI.js +23 -0
  238. package/lib/module/internal/ads/THEOplayerWebGoogleDAI.js.map +1 -0
  239. package/lib/module/internal/drm/ContentProtectionRegistry.js +188 -0
  240. package/lib/module/internal/drm/ContentProtectionRegistry.js.map +1 -0
  241. package/lib/module/internal/drm/ContentProtectionRegistry.web.js +9 -0
  242. package/lib/module/internal/drm/ContentProtectionRegistry.web.js.map +1 -0
  243. package/lib/module/internal/drm/NativeCertificateRequest.js +31 -0
  244. package/lib/module/internal/drm/NativeCertificateRequest.js.map +1 -0
  245. package/lib/module/internal/drm/NativeCertificateResponse.js +30 -0
  246. package/lib/module/internal/drm/NativeCertificateResponse.js.map +1 -0
  247. package/lib/module/internal/drm/NativeContentProtectionEvent.js +2 -0
  248. package/lib/module/internal/drm/NativeContentProtectionEvent.js.map +1 -0
  249. package/lib/module/internal/drm/NativeLicenseRequest.js +34 -0
  250. package/lib/module/internal/drm/NativeLicenseRequest.js.map +1 -0
  251. package/lib/module/internal/drm/NativeLicenseResponse.js +30 -0
  252. package/lib/module/internal/drm/NativeLicenseResponse.js.map +1 -0
  253. package/lib/module/internal/utils/TypeUtils.js +24 -0
  254. package/lib/module/internal/utils/TypeUtils.js.map +1 -0
  255. package/lib/module/internal/web/TrackUtils.js +15 -0
  256. package/lib/module/internal/web/TrackUtils.js.map +1 -1
  257. package/lib/typescript/lib/commonjs/api/abr/ABRConfiguration.d.ts +0 -0
  258. package/lib/typescript/lib/commonjs/api/abr/barrel.d.ts +1 -0
  259. package/lib/typescript/lib/commonjs/api/ads/Ad.d.ts +1 -0
  260. package/lib/typescript/lib/commonjs/api/ads/AdBreak.d.ts +1 -0
  261. package/lib/typescript/lib/commonjs/api/ads/AdsAPI.d.ts +1 -0
  262. package/lib/typescript/lib/commonjs/api/ads/AdsConfiguration.d.ts +1 -0
  263. package/lib/typescript/lib/commonjs/api/ads/CompanionAd.d.ts +0 -0
  264. package/lib/typescript/lib/commonjs/api/ads/GoogleDai.d.ts +0 -0
  265. package/lib/typescript/lib/commonjs/api/ads/GoogleImaAd.d.ts +1 -0
  266. package/lib/typescript/lib/commonjs/api/ads/GoogleImaConfiguration.d.ts +0 -0
  267. package/lib/typescript/lib/commonjs/api/ads/barrel.d.ts +1 -0
  268. package/lib/typescript/lib/commonjs/api/config/PlayerConfiguration.d.ts +1 -0
  269. package/lib/typescript/lib/commonjs/api/drm/ContentProtectionAPI.d.ts +1 -0
  270. package/lib/typescript/lib/commonjs/api/drm/ContentProtectionIntegration.d.ts +1 -0
  271. package/lib/typescript/lib/commonjs/api/drm/ContentProtectionIntegrationFactory.d.ts +1 -0
  272. package/lib/typescript/lib/commonjs/api/drm/ContentProtectionRequest.d.ts +0 -0
  273. package/lib/typescript/lib/commonjs/api/drm/ContentProtectionResponse.d.ts +1 -0
  274. package/lib/typescript/lib/commonjs/api/drm/barrel.d.ts +1 -0
  275. package/lib/typescript/lib/commonjs/api/event/AdEvent.d.ts +2 -0
  276. package/lib/typescript/lib/commonjs/api/source/ads/FreeWheelAdDescription.d.ts +1 -0
  277. package/lib/typescript/lib/commonjs/api/source/ads/IMAAdDescription.d.ts +1 -0
  278. package/lib/typescript/lib/commonjs/api/source/ads/SpotXAdDescription.d.ts +1 -0
  279. package/lib/typescript/lib/commonjs/api/source/ads/THEOplayerAdDescription.d.ts +1 -0
  280. package/lib/typescript/lib/commonjs/api/source/ads/barrel.d.ts +1 -0
  281. package/lib/typescript/lib/commonjs/api/source/ads/ssai/GoogleDAIConfiguration.d.ts +1 -0
  282. package/lib/typescript/lib/commonjs/api/source/ads/ssai/ImagineServerSideAdInsertionConfiguration.d.ts +1 -0
  283. package/lib/typescript/lib/commonjs/api/source/ads/ssai/ServerSideAdInsertionConfiguration.d.ts +1 -0
  284. package/lib/typescript/lib/commonjs/api/source/ads/ssai/YospaceServerSideAdInsertionConfiguration.d.ts +1 -0
  285. package/lib/typescript/lib/commonjs/api/source/ads/ssai/barrel.d.ts +1 -0
  286. package/lib/typescript/lib/commonjs/api/track/MediaTrack.d.ts +8 -0
  287. package/lib/typescript/lib/commonjs/api/utils/TypeUtils.d.ts +13 -0
  288. package/lib/typescript/lib/commonjs/api/utils/barrel.d.ts +1 -0
  289. package/lib/typescript/lib/commonjs/index.d.ts +2 -0
  290. package/lib/typescript/lib/commonjs/internal/THEOplayerView.d.ts +5 -0
  291. package/lib/typescript/lib/commonjs/internal/THEOplayerView.web.d.ts +4 -0
  292. package/lib/typescript/lib/commonjs/internal/ads/THEOplayerNativeAdsAPI.d.ts +14 -0
  293. package/lib/typescript/lib/commonjs/internal/ads/THEOplayerNativeGoogleDAI.d.ts +9 -0
  294. package/lib/typescript/lib/commonjs/internal/ads/THEOplayerWebAdsAPI.d.ts +14 -0
  295. package/lib/typescript/lib/commonjs/internal/ads/THEOplayerWebGoogleDAI.d.ts +9 -0
  296. package/lib/typescript/lib/commonjs/internal/drm/ContentProtectionRegistry.d.ts +14 -0
  297. package/lib/typescript/lib/commonjs/internal/drm/ContentProtectionRegistry.web.d.ts +5 -0
  298. package/lib/typescript/lib/commonjs/internal/drm/NativeCertificateRequest.d.ts +18 -0
  299. package/lib/typescript/lib/commonjs/internal/drm/NativeCertificateResponse.d.ts +21 -0
  300. package/lib/typescript/lib/commonjs/internal/drm/NativeContentProtectionEvent.d.ts +0 -0
  301. package/lib/typescript/lib/commonjs/internal/drm/NativeLicenseRequest.d.ts +20 -0
  302. package/lib/typescript/lib/commonjs/internal/drm/NativeLicenseResponse.d.ts +22 -0
  303. package/lib/typescript/lib/commonjs/internal/utils/TypeUtils.d.ts +6 -0
  304. package/lib/typescript/lib/commonjs/internal/web/TrackUtils.d.ts +2 -0
  305. package/lib/typescript/lib/module/api/abr/ABRConfiguration.d.ts +0 -0
  306. package/lib/typescript/lib/module/api/abr/barrel.d.ts +1 -0
  307. package/lib/typescript/lib/module/api/ads/Ad.d.ts +1 -0
  308. package/lib/typescript/lib/module/api/ads/AdBreak.d.ts +1 -0
  309. package/lib/typescript/lib/module/api/ads/AdsAPI.d.ts +1 -0
  310. package/lib/typescript/lib/module/api/ads/AdsConfiguration.d.ts +1 -0
  311. package/lib/typescript/lib/module/api/ads/CompanionAd.d.ts +0 -0
  312. package/lib/typescript/lib/module/api/ads/GoogleDai.d.ts +0 -0
  313. package/lib/typescript/lib/module/api/ads/GoogleImaAd.d.ts +1 -0
  314. package/lib/typescript/lib/module/api/ads/GoogleImaConfiguration.d.ts +0 -0
  315. package/lib/typescript/lib/module/api/ads/barrel.d.ts +5 -0
  316. package/lib/typescript/lib/module/api/barrel.d.ts +5 -1
  317. package/lib/typescript/lib/module/api/config/PlayerConfiguration.d.ts +1 -0
  318. package/lib/typescript/lib/module/api/config/barrel.d.ts +1 -1
  319. package/lib/typescript/lib/module/api/drm/ContentProtectionAPI.d.ts +1 -0
  320. package/lib/typescript/lib/module/api/drm/ContentProtectionIntegration.d.ts +1 -0
  321. package/lib/typescript/lib/module/api/drm/ContentProtectionIntegrationFactory.d.ts +1 -0
  322. package/lib/typescript/lib/module/api/drm/ContentProtectionRequest.d.ts +0 -0
  323. package/lib/typescript/lib/module/api/drm/ContentProtectionResponse.d.ts +1 -0
  324. package/lib/typescript/lib/module/api/drm/barrel.d.ts +4 -0
  325. package/lib/typescript/lib/module/api/event/AdEvent.d.ts +1 -0
  326. package/lib/typescript/lib/module/api/event/barrel.d.ts +1 -0
  327. package/lib/typescript/lib/module/api/source/ads/FreeWheelAdDescription.d.ts +1 -0
  328. package/lib/typescript/lib/module/api/source/ads/IMAAdDescription.d.ts +1 -0
  329. package/lib/typescript/lib/module/api/source/ads/SpotXAdDescription.d.ts +1 -0
  330. package/lib/typescript/lib/module/api/source/ads/THEOplayerAdDescription.d.ts +1 -0
  331. package/lib/typescript/lib/module/api/source/ads/barrel.d.ts +5 -0
  332. package/lib/typescript/lib/module/api/source/ads/ssai/GoogleDAIConfiguration.d.ts +1 -0
  333. package/lib/typescript/lib/module/api/source/ads/ssai/ImagineServerSideAdInsertionConfiguration.d.ts +1 -0
  334. package/lib/typescript/lib/module/api/source/ads/ssai/ServerSideAdInsertionConfiguration.d.ts +1 -0
  335. package/lib/typescript/lib/module/api/source/ads/ssai/YospaceServerSideAdInsertionConfiguration.d.ts +1 -0
  336. package/lib/typescript/lib/module/api/source/ads/ssai/barrel.d.ts +4 -0
  337. package/lib/typescript/lib/module/api/source/barrel.d.ts +1 -0
  338. package/lib/typescript/lib/module/api/track/MediaTrack.d.ts +8 -1
  339. package/lib/typescript/lib/module/api/utils/TypeUtils.d.ts +12 -0
  340. package/lib/typescript/lib/module/api/utils/barrel.d.ts +1 -0
  341. package/lib/typescript/lib/module/index.d.ts +1 -0
  342. package/lib/typescript/lib/module/internal/THEOplayerView.d.ts +8 -0
  343. package/lib/typescript/lib/module/internal/THEOplayerView.web.d.ts +4 -0
  344. package/lib/typescript/lib/module/internal/ads/THEOplayerNativeAdsAPI.d.ts +13 -0
  345. package/lib/typescript/lib/module/internal/ads/THEOplayerNativeGoogleDAI.d.ts +8 -0
  346. package/lib/typescript/lib/module/internal/ads/THEOplayerWebAdsAPI.d.ts +13 -0
  347. package/lib/typescript/lib/module/internal/ads/THEOplayerWebGoogleDAI.d.ts +8 -0
  348. package/lib/typescript/lib/module/internal/drm/ContentProtectionRegistry.d.ts +13 -0
  349. package/lib/typescript/lib/module/internal/drm/ContentProtectionRegistry.web.d.ts +4 -0
  350. package/lib/typescript/lib/module/internal/drm/NativeCertificateRequest.d.ts +17 -0
  351. package/lib/typescript/lib/module/internal/drm/NativeCertificateResponse.d.ts +20 -0
  352. package/lib/typescript/lib/module/internal/drm/NativeContentProtectionEvent.d.ts +0 -0
  353. package/lib/typescript/lib/module/internal/drm/NativeLicenseRequest.d.ts +19 -0
  354. package/lib/typescript/lib/module/internal/drm/NativeLicenseResponse.d.ts +21 -0
  355. package/lib/typescript/lib/module/internal/utils/TypeUtils.d.ts +5 -0
  356. package/lib/typescript/lib/module/internal/web/TrackUtils.d.ts +2 -0
  357. package/lib/typescript/src/api/THEOplayerView.d.ts +25 -4
  358. package/lib/typescript/src/api/abr/ABRConfiguration.d.ts +95 -0
  359. package/lib/typescript/src/api/abr/barrel.d.ts +1 -0
  360. package/lib/typescript/src/api/ads/Ad.d.ts +238 -0
  361. package/lib/typescript/src/api/ads/AdBreak.d.ts +39 -0
  362. package/lib/typescript/src/api/ads/AdsAPI.d.ts +46 -0
  363. package/lib/typescript/src/api/ads/AdsConfiguration.d.ts +69 -0
  364. package/lib/typescript/src/api/ads/CompanionAd.d.ts +59 -0
  365. package/lib/typescript/src/api/ads/GoogleDai.d.ts +29 -0
  366. package/lib/typescript/src/api/ads/GoogleImaAd.d.ts +78 -0
  367. package/lib/typescript/src/api/ads/GoogleImaConfiguration.d.ts +13 -0
  368. package/lib/typescript/src/api/ads/barrel.d.ts +8 -0
  369. package/lib/typescript/src/api/barrel.d.ts +5 -1
  370. package/lib/typescript/src/api/config/PlayerConfiguration.d.ts +5 -0
  371. package/lib/typescript/src/api/drm/ContentProtectionAPI.d.ts +5 -0
  372. package/lib/typescript/src/api/drm/ContentProtectionIntegration.d.ts +86 -0
  373. package/lib/typescript/src/api/drm/ContentProtectionIntegrationFactory.d.ts +15 -0
  374. package/lib/typescript/src/api/drm/ContentProtectionRequest.d.ts +56 -0
  375. package/lib/typescript/src/api/drm/ContentProtectionResponse.d.ts +56 -0
  376. package/lib/typescript/src/api/drm/barrel.d.ts +5 -0
  377. package/lib/typescript/src/api/event/AdEvent.d.ts +13 -0
  378. package/lib/typescript/src/api/event/barrel.d.ts +1 -0
  379. package/lib/typescript/src/api/source/SourceDescription.d.ts +8 -0
  380. package/lib/typescript/src/api/source/ads/FreeWheelAdDescription.d.ts +85 -0
  381. package/lib/typescript/src/api/source/ads/IMAAdDescription.d.ts +25 -0
  382. package/lib/typescript/src/api/source/ads/SpotXAdDescription.d.ts +115 -0
  383. package/lib/typescript/src/api/source/ads/THEOplayerAdDescription.d.ts +32 -0
  384. package/lib/typescript/src/api/source/ads/barrel.d.ts +6 -0
  385. package/lib/typescript/src/api/source/ads/ssai/GoogleDAIConfiguration.d.ts +130 -0
  386. package/lib/typescript/src/api/source/ads/ssai/ImagineServerSideAdInsertionConfiguration.d.ts +27 -0
  387. package/lib/typescript/src/api/source/ads/ssai/ServerSideAdInsertionConfiguration.d.ts +26 -0
  388. package/lib/typescript/src/api/source/ads/ssai/YospaceServerSideAdInsertionConfiguration.d.ts +46 -0
  389. package/lib/typescript/src/api/source/ads/ssai/barrel.d.ts +4 -0
  390. package/lib/typescript/src/api/source/barrel.d.ts +1 -0
  391. package/lib/typescript/src/api/source/drm/DRMConfiguration.d.ts +0 -30
  392. package/lib/typescript/src/api/track/MediaTrack.d.ts +5 -2
  393. package/lib/typescript/src/api/utils/TypeUtils.d.ts +20 -0
  394. package/lib/typescript/src/api/utils/barrel.d.ts +1 -0
  395. package/lib/typescript/src/index.d.ts +1 -0
  396. package/lib/typescript/src/internal/THEOplayerView.d.ts +10 -4
  397. package/lib/typescript/src/internal/THEOplayerView.web.d.ts +7 -2
  398. package/lib/typescript/src/internal/ads/THEOplayerNativeAdsAPI.d.ts +17 -0
  399. package/lib/typescript/src/internal/ads/THEOplayerNativeGoogleDAI.d.ts +10 -0
  400. package/lib/typescript/src/internal/ads/THEOplayerWebAdsAPI.d.ts +15 -0
  401. package/lib/typescript/src/internal/ads/THEOplayerWebGoogleDAI.d.ts +10 -0
  402. package/lib/typescript/src/internal/drm/ContentProtectionRegistry.d.ts +19 -0
  403. package/lib/typescript/src/internal/drm/ContentProtectionRegistry.web.d.ts +5 -0
  404. package/lib/typescript/src/internal/drm/NativeCertificateRequest.d.ts +13 -0
  405. package/lib/typescript/src/internal/drm/NativeCertificateResponse.d.ts +18 -0
  406. package/lib/typescript/src/internal/drm/NativeContentProtectionEvent.d.ts +5 -0
  407. package/lib/typescript/src/internal/drm/NativeLicenseRequest.d.ts +14 -0
  408. package/lib/typescript/src/internal/drm/NativeLicenseResponse.d.ts +18 -0
  409. package/lib/typescript/src/internal/utils/TypeUtils.d.ts +5 -0
  410. package/lib/typescript/src/internal/web/TrackUtils.d.ts +3 -1
  411. package/package.json +4 -3
  412. package/src/api/THEOplayerView.ts +29 -4
  413. package/src/api/abr/ABRConfiguration.ts +103 -0
  414. package/src/api/abr/barrel.ts +1 -0
  415. package/src/api/ads/Ad.ts +267 -0
  416. package/src/api/ads/AdBreak.ts +44 -0
  417. package/src/api/ads/AdsAPI.ts +53 -0
  418. package/src/api/ads/AdsConfiguration.ts +76 -0
  419. package/src/api/ads/CompanionAd.ts +65 -0
  420. package/src/api/ads/GoogleDai.ts +32 -0
  421. package/src/api/ads/GoogleImaAd.ts +86 -0
  422. package/src/api/ads/GoogleImaConfiguration.ts +13 -0
  423. package/src/api/ads/barrel.ts +8 -0
  424. package/src/api/barrel.ts +5 -1
  425. package/src/api/config/PlayerConfiguration.ts +7 -0
  426. package/src/api/drm/ContentProtectionAPI.ts +6 -0
  427. package/src/api/drm/ContentProtectionIntegration.ts +93 -0
  428. package/src/api/drm/ContentProtectionIntegrationFactory.ts +16 -0
  429. package/src/api/drm/ContentProtectionRequest.ts +60 -0
  430. package/src/api/drm/ContentProtectionResponse.ts +62 -0
  431. package/src/api/drm/barrel.ts +5 -0
  432. package/src/api/event/AdEvent.ts +117 -0
  433. package/src/api/event/barrel.ts +1 -0
  434. package/src/api/source/SourceDescription.ts +9 -0
  435. package/src/api/source/ads/FreeWheelAdDescription.ts +97 -0
  436. package/src/api/source/ads/IMAAdDescription.ts +26 -0
  437. package/src/api/source/ads/SpotXAdDescription.ts +126 -0
  438. package/src/api/source/ads/THEOplayerAdDescription.ts +34 -0
  439. package/src/api/source/ads/barrel.ts +6 -0
  440. package/src/api/source/ads/ssai/GoogleDAIConfiguration.ts +145 -0
  441. package/src/api/source/ads/ssai/ImagineServerSideAdInsertionConfiguration.ts +30 -0
  442. package/src/api/source/ads/ssai/ServerSideAdInsertionConfiguration.ts +28 -0
  443. package/src/api/source/ads/ssai/YospaceServerSideAdInsertionConfiguration.ts +51 -0
  444. package/src/api/source/ads/ssai/barrel.ts +4 -0
  445. package/src/api/source/barrel.ts +1 -0
  446. package/src/api/source/drm/DRMConfiguration.ts +0 -35
  447. package/src/api/track/MediaTrack.ts +22 -2
  448. package/src/api/utils/TypeUtils.ts +39 -0
  449. package/src/api/utils/barrel.ts +1 -0
  450. package/src/index.tsx +1 -0
  451. package/src/internal/THEOplayerView.tsx +49 -8
  452. package/src/internal/THEOplayerView.web.tsx +37 -7
  453. package/src/internal/ads/THEOplayerNativeAdsAPI.ts +44 -0
  454. package/src/internal/ads/THEOplayerNativeGoogleDAI.ts +23 -0
  455. package/src/internal/ads/THEOplayerWebAdsAPI.ts +51 -0
  456. package/src/internal/ads/THEOplayerWebGoogleDAI.ts +22 -0
  457. package/src/internal/drm/ContentProtectionRegistry.ts +173 -0
  458. package/src/internal/drm/ContentProtectionRegistry.web.ts +10 -0
  459. package/src/internal/drm/NativeCertificateRequest.ts +41 -0
  460. package/src/internal/drm/NativeCertificateResponse.ts +45 -0
  461. package/src/internal/drm/NativeContentProtectionEvent.ts +5 -0
  462. package/src/internal/drm/NativeLicenseRequest.ts +39 -0
  463. package/src/internal/drm/NativeLicenseResponse.ts +45 -0
  464. package/src/internal/utils/TypeUtils.ts +39 -0
  465. package/src/internal/web/TrackUtils.ts +22 -1
@@ -0,0 +1,214 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.NativeContentProtectionRegistry = exports.ContentProtectionRegistry = void 0;
7
+
8
+ var _reactNative = require("react-native");
9
+
10
+ var _NativeLicenseRequest = require("./NativeLicenseRequest");
11
+
12
+ var _NativeLicenseResponse = require("./NativeLicenseResponse");
13
+
14
+ var _NativeCertificateRequest = require("./NativeCertificateRequest");
15
+
16
+ var _NativeCertificateResponse = require("./NativeCertificateResponse");
17
+
18
+ var _TypeUtils = require("../utils/TypeUtils");
19
+
20
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
21
+
22
+ class NativeContentProtectionRegistry {
23
+ constructor() {
24
+ _defineProperty(this, "emitter", void 0);
25
+
26
+ _defineProperty(this, "registeredFactories", []);
27
+
28
+ _defineProperty(this, "currentIntegration", undefined);
29
+
30
+ _defineProperty(this, "onBuildIntegrationRequest", event => {
31
+ const {
32
+ requestId,
33
+ integrationId,
34
+ keySystemId,
35
+ drmConfig
36
+ } = event;
37
+ console.log('ContentProtectionModule', `onBuildIntegrationRequest ${integrationId} ${keySystemId}`);
38
+ const factory = this.getFactory(integrationId, keySystemId);
39
+
40
+ if (factory) {
41
+ this.currentIntegration = {
42
+ integrationId,
43
+ keySystemId,
44
+ integration: factory.build(drmConfig)
45
+ };
46
+
47
+ _reactNative.NativeModules.ContentProtectionModule.onBuildProcessed({
48
+ requestId,
49
+ resultString: 'success'
50
+ });
51
+ } else {
52
+ _reactNative.NativeModules.ContentProtectionModule.onBuildProcessed({
53
+ requestId,
54
+ resultString: 'failed'
55
+ });
56
+ }
57
+ });
58
+
59
+ _defineProperty(this, "onCertificateRequest", async request => {
60
+ const {
61
+ requestId,
62
+ integrationId,
63
+ keySystemId
64
+ } = request;
65
+ console.log('ContentProtectionModule', `onCertificateRequest ${integrationId} ${keySystemId}`);
66
+ const integration = this.getIntegration(integrationId, keySystemId);
67
+
68
+ if (integration !== null && integration !== void 0 && integration.onCertificateRequest) {
69
+ const result = await integration.onCertificateRequest((0, _NativeCertificateRequest.fromNativeCertificateRequest)(request)); // TODO: we also want to support ArrayBufferView results
70
+
71
+ if ((0, _TypeUtils.isBufferSource)(result)) {
72
+ const nativeResponse = (0, _NativeCertificateResponse.toNativeCertificateResponseResult)(requestId, integrationId, keySystemId, result);
73
+
74
+ _reactNative.NativeModules.ContentProtectionModule.onCertificateRequestProcessedAsCertificate(nativeResponse);
75
+ } else if (result) {
76
+ const modifiedNativeRequest = (0, _NativeCertificateRequest.toNativeCertificateRequest)(requestId, integrationId, keySystemId, result);
77
+
78
+ _reactNative.NativeModules.ContentProtectionModule.onCertificateRequestProcessedAsRequest(modifiedNativeRequest);
79
+ }
80
+ } else {
81
+ _reactNative.NativeModules.ContentProtectionModule.onCertificateRequestProcessedAsRequest(request);
82
+ }
83
+ });
84
+
85
+ _defineProperty(this, "onCertificateResponse", async response => {
86
+ const {
87
+ requestId,
88
+ integrationId,
89
+ keySystemId
90
+ } = response;
91
+ console.log('ContentProtectionModule', `onCertificateResponse ${integrationId} ${keySystemId}`);
92
+ const integration = this.getIntegration(integrationId, keySystemId);
93
+
94
+ if (integration !== null && integration !== void 0 && integration.onCertificateResponse) {
95
+ const responseResult = await integration.onCertificateResponse((0, _NativeCertificateResponse.fromNativeCertificateResponse)(response)); // TODO: we also want to support ArrayBufferView results
96
+
97
+ const modifiedNativeResponse = (0, _NativeCertificateResponse.toNativeCertificateResponseResult)(requestId, integrationId, keySystemId, responseResult);
98
+
99
+ _reactNative.NativeModules.ContentProtectionModule.onCertificateResponseProcessed(modifiedNativeResponse);
100
+ } else {
101
+ _reactNative.NativeModules.ContentProtectionModule.onCertificateResponseProcessed(response);
102
+ }
103
+ });
104
+
105
+ _defineProperty(this, "onLicenseRequest", async request => {
106
+ const {
107
+ requestId,
108
+ integrationId,
109
+ keySystemId
110
+ } = request;
111
+ console.log('ContentProtectionModule', `onLicenseRequest ${integrationId} ${keySystemId}`);
112
+ const integration = this.getIntegration(integrationId, keySystemId); // Optionally let the custom integration modify the request.
113
+
114
+ if (integration !== null && integration !== void 0 && integration.onLicenseRequest) {
115
+ const result = await integration.onLicenseRequest((0, _NativeLicenseRequest.fromNativeLicenseRequest)(request)); // TODO: we also want to support ArrayBufferView results
116
+
117
+ if ((0, _TypeUtils.isBufferSource)(result)) {
118
+ const nativeResponse = (0, _NativeLicenseResponse.toNativeLicenseResponseResult)(requestId, integrationId, keySystemId, result);
119
+
120
+ _reactNative.NativeModules.ContentProtectionModule.onLicenseRequestProcessedAsLicense(nativeResponse);
121
+ } else if (result) {
122
+ const modifiedNativeRequest = (0, _NativeLicenseRequest.toNativeLicenseRequest)(requestId, integrationId, keySystemId, result);
123
+
124
+ _reactNative.NativeModules.ContentProtectionModule.onLicenseRequestProcessedAsRequest(modifiedNativeRequest);
125
+ }
126
+ } else {
127
+ _reactNative.NativeModules.ContentProtectionModule.onLicenseRequestProcessedAsRequest(request);
128
+ }
129
+ });
130
+
131
+ _defineProperty(this, "onLicenseResponse", async response => {
132
+ const {
133
+ requestId,
134
+ integrationId,
135
+ keySystemId
136
+ } = response;
137
+ console.log('ContentProtectionModule', `onLicenseResponse ${integrationId} ${keySystemId}`);
138
+ const integration = this.getIntegration(integrationId, keySystemId);
139
+
140
+ if (integration !== null && integration !== void 0 && integration.onLicenseResponse) {
141
+ const responseResult = await integration.onLicenseResponse((0, _NativeLicenseResponse.fromNativeLicenseResponse)(response)); // TODO: we also want to support ArrayBufferView results
142
+
143
+ const modifiedNativeResponse = (0, _NativeLicenseResponse.toNativeLicenseResponseResult)(requestId, integrationId, keySystemId, responseResult);
144
+
145
+ _reactNative.NativeModules.ContentProtectionModule.onLicenseResponseProcessed(modifiedNativeResponse);
146
+ } else {
147
+ _reactNative.NativeModules.ContentProtectionModule.onLicenseResponseProcessed(response);
148
+ }
149
+ });
150
+
151
+ _defineProperty(this, "onExtractFairplayContentId", async event => {
152
+ const {
153
+ integrationId,
154
+ keySystemId,
155
+ fairplaySkdUrl,
156
+ requestId
157
+ } = event;
158
+ console.log('ContentProtectionModule', `onExtractFairplayContentId ${integrationId} ${keySystemId}`);
159
+ const integration = this.getIntegration(integrationId, keySystemId);
160
+
161
+ if (integration !== null && integration !== void 0 && integration.extractFairplayContentId) {
162
+ const contentId = await integration.extractFairplayContentId(fairplaySkdUrl);
163
+
164
+ _reactNative.NativeModules.ContentProtectionModule.onExtractFairplayContentIdProcessed({
165
+ requestId,
166
+ contentId
167
+ });
168
+ } else {
169
+ const contentId = fairplaySkdUrl;
170
+
171
+ _reactNative.NativeModules.ContentProtectionModule.onExtractFairplayContentIdProcessed({
172
+ requestId,
173
+ contentId
174
+ });
175
+ }
176
+ });
177
+
178
+ this.emitter = new _reactNative.NativeEventEmitter(_reactNative.NativeModules.ContentProtectionModule);
179
+ this.emitter.addListener('onBuildIntegration', this.onBuildIntegrationRequest);
180
+ this.emitter.addListener('onCertificateRequest', this.onCertificateRequest);
181
+ this.emitter.addListener('onCertificateResponse', this.onCertificateResponse);
182
+ this.emitter.addListener('onLicenseRequest', this.onLicenseRequest);
183
+ this.emitter.addListener('onLicenseResponse', this.onLicenseResponse);
184
+ this.emitter.addListener('onExtractFairplayContentId', this.onExtractFairplayContentId);
185
+ }
186
+
187
+ registerContentProtectionIntegration(integrationId, keySystemId, integrationFactory) {
188
+ this.registeredFactories.push({
189
+ integrationId,
190
+ keySystemId,
191
+ integrationFactory
192
+ });
193
+
194
+ _reactNative.NativeModules.ContentProtectionModule.registerContentProtectionIntegration(integrationId, keySystemId);
195
+ }
196
+
197
+ getFactory(integrationId, keySystemId) {
198
+ var _this$registeredFacto;
199
+
200
+ return (_this$registeredFacto = this.registeredFactories.find(init => init.integrationId === integrationId && init.keySystemId === keySystemId)) === null || _this$registeredFacto === void 0 ? void 0 : _this$registeredFacto.integrationFactory;
201
+ }
202
+
203
+ getIntegration(integrationId, keySystemId) {
204
+ var _this$currentIntegrat, _this$currentIntegrat2, _this$currentIntegrat3;
205
+
206
+ return ((_this$currentIntegrat = this.currentIntegration) === null || _this$currentIntegrat === void 0 ? void 0 : _this$currentIntegrat.integrationId) === integrationId && ((_this$currentIntegrat2 = this.currentIntegration) === null || _this$currentIntegrat2 === void 0 ? void 0 : _this$currentIntegrat2.keySystemId) === keySystemId ? (_this$currentIntegrat3 = this.currentIntegration) === null || _this$currentIntegrat3 === void 0 ? void 0 : _this$currentIntegrat3.integration : undefined;
207
+ }
208
+
209
+ }
210
+
211
+ exports.NativeContentProtectionRegistry = NativeContentProtectionRegistry;
212
+ const ContentProtectionRegistry = new NativeContentProtectionRegistry();
213
+ exports.ContentProtectionRegistry = ContentProtectionRegistry;
214
+ //# sourceMappingURL=ContentProtectionRegistry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["NativeContentProtectionRegistry","constructor","undefined","event","requestId","integrationId","keySystemId","drmConfig","console","log","factory","getFactory","currentIntegration","integration","build","NativeModules","ContentProtectionModule","onBuildProcessed","resultString","request","getIntegration","onCertificateRequest","result","fromNativeCertificateRequest","isBufferSource","nativeResponse","toNativeCertificateResponseResult","onCertificateRequestProcessedAsCertificate","modifiedNativeRequest","toNativeCertificateRequest","onCertificateRequestProcessedAsRequest","response","onCertificateResponse","responseResult","fromNativeCertificateResponse","modifiedNativeResponse","onCertificateResponseProcessed","onLicenseRequest","fromNativeLicenseRequest","toNativeLicenseResponseResult","onLicenseRequestProcessedAsLicense","toNativeLicenseRequest","onLicenseRequestProcessedAsRequest","onLicenseResponse","fromNativeLicenseResponse","onLicenseResponseProcessed","fairplaySkdUrl","extractFairplayContentId","contentId","onExtractFairplayContentIdProcessed","emitter","NativeEventEmitter","addListener","onBuildIntegrationRequest","onExtractFairplayContentId","registerContentProtectionIntegration","integrationFactory","registeredFactories","push","find","init","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":"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"}
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.WebContentProtectionRegistry = exports.ContentProtectionRegistry = void 0;
7
+
8
+ var _theoplayer = require("theoplayer");
9
+
10
+ class WebContentProtectionRegistry {
11
+ registerContentProtectionIntegration(integrationId, keySystem, integrationFactory) {
12
+ (0, _theoplayer.registerContentProtectionIntegration)(integrationId, keySystem, integrationFactory);
13
+ }
14
+
15
+ }
16
+
17
+ exports.WebContentProtectionRegistry = WebContentProtectionRegistry;
18
+ const ContentProtectionRegistry = new WebContentProtectionRegistry();
19
+ exports.ContentProtectionRegistry = ContentProtectionRegistry;
20
+ //# sourceMappingURL=ContentProtectionRegistry.web.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["WebContentProtectionRegistry","registerContentProtectionIntegration","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;;AAEO,MAAMA,4BAAN,CAAmE;EACxEC,oCAAoC,CAACC,aAAD,EAAwBC,SAAxB,EAAgDC,kBAAhD,EAA+G;IACjJ,IAAAH,gDAAA,EAAqCC,aAArC,EAAoDC,SAApD,EAA+DC,kBAA/D;EACD;;AAHuE;;;AAMnE,MAAMC,yBAAyB,GAAG,IAAIL,4BAAJ,EAAlC"}
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.fromNativeCertificateRequest = fromNativeCertificateRequest;
7
+ exports.toNativeCertificateRequest = toNativeCertificateRequest;
8
+
9
+ var _reactNativeTheoplayer = require("react-native-theoplayer");
10
+
11
+ function fromNativeCertificateRequest(request) {
12
+ const {
13
+ url,
14
+ method,
15
+ headers,
16
+ useCredentials,
17
+ base64body
18
+ } = request;
19
+ const body = base64body ? (0, _reactNativeTheoplayer.fromBase64StringToUint8Array)(base64body) : null;
20
+ return {
21
+ url,
22
+ method,
23
+ headers,
24
+ useCredentials,
25
+ body
26
+ };
27
+ }
28
+
29
+ function toNativeCertificateRequest(requestId, integrationId, keySystemId, request) {
30
+ return {
31
+ requestId,
32
+ integrationId,
33
+ keySystemId,
34
+ url: request.url,
35
+ method: request.method,
36
+ headers: request.headers,
37
+ useCredentials: request.useCredentials ?? false,
38
+ base64body: request.body ? (0, _reactNativeTheoplayer.fromUint8ArrayToBase64String)(request.body) : null
39
+ };
40
+ }
41
+ //# sourceMappingURL=NativeCertificateRequest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["fromNativeCertificateRequest","request","url","method","headers","useCredentials","base64body","body","fromBase64StringToUint8Array","toNativeCertificateRequest","requestId","integrationId","keySystemId","fromUint8ArrayToBase64String"],"sources":["NativeCertificateRequest.ts"],"sourcesContent":["import type { NativeContentProtectionEvent } from './NativeContentProtectionEvent';\nimport type { CertificateRequest } from 'react-native-theoplayer';\nimport { fromBase64StringToUint8Array, fromUint8ArrayToBase64String } from 'react-native-theoplayer';\n\nexport interface NativeCertificateRequest extends NativeContentProtectionEvent {\n url: string;\n method: string;\n headers: { [headerName: string]: string };\n base64body: string | null;\n useCredentials: boolean;\n}\n\nexport function fromNativeCertificateRequest(request: NativeCertificateRequest): CertificateRequest {\n const { url, method, headers, useCredentials, base64body } = request;\n const body = base64body ? fromBase64StringToUint8Array(base64body) : null;\n return {\n url,\n method,\n headers,\n useCredentials,\n body,\n };\n}\n\nexport function toNativeCertificateRequest(\n requestId: string,\n integrationId: string,\n keySystemId: string,\n request: CertificateRequest,\n): NativeCertificateRequest {\n return {\n requestId,\n integrationId,\n keySystemId,\n url: request.url,\n method: request.method,\n headers: request.headers,\n useCredentials: request.useCredentials ?? false,\n base64body: request.body ? fromUint8ArrayToBase64String(request.body) : null,\n };\n}\n"],"mappings":";;;;;;;;AAEA;;AAUO,SAASA,4BAAT,CAAsCC,OAAtC,EAA6F;EAClG,MAAM;IAAEC,GAAF;IAAOC,MAAP;IAAeC,OAAf;IAAwBC,cAAxB;IAAwCC;EAAxC,IAAuDL,OAA7D;EACA,MAAMM,IAAI,GAAGD,UAAU,GAAG,IAAAE,mDAAA,EAA6BF,UAA7B,CAAH,GAA8C,IAArE;EACA,OAAO;IACLJ,GADK;IAELC,MAFK;IAGLC,OAHK;IAILC,cAJK;IAKLE;EALK,CAAP;AAOD;;AAEM,SAASE,0BAAT,CACLC,SADK,EAELC,aAFK,EAGLC,WAHK,EAILX,OAJK,EAKqB;EAC1B,OAAO;IACLS,SADK;IAELC,aAFK;IAGLC,WAHK;IAILV,GAAG,EAAED,OAAO,CAACC,GAJR;IAKLC,MAAM,EAAEF,OAAO,CAACE,MALX;IAMLC,OAAO,EAAEH,OAAO,CAACG,OANZ;IAOLC,cAAc,EAAEJ,OAAO,CAACI,cAAR,IAA0B,KAPrC;IAQLC,UAAU,EAAEL,OAAO,CAACM,IAAR,GAAe,IAAAM,mDAAA,EAA6BZ,OAAO,CAACM,IAArC,CAAf,GAA4D;EARnE,CAAP;AAUD"}
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.fromNativeCertificateResponse = fromNativeCertificateResponse;
7
+ exports.toNativeCertificateResponseResult = toNativeCertificateResponseResult;
8
+
9
+ var _NativeCertificateRequest = require("./NativeCertificateRequest");
10
+
11
+ var _reactNativeTheoplayer = require("react-native-theoplayer");
12
+
13
+ function fromNativeCertificateResponse(response) {
14
+ const {
15
+ url,
16
+ status,
17
+ statusText,
18
+ headers,
19
+ base64body,
20
+ request
21
+ } = response;
22
+ const body = base64body ? (0, _reactNativeTheoplayer.fromBase64StringToUint8Array)(base64body) : new Uint8Array();
23
+ return {
24
+ url,
25
+ status,
26
+ statusText,
27
+ headers,
28
+ body,
29
+ request: (0, _NativeCertificateRequest.fromNativeCertificateRequest)(request)
30
+ };
31
+ }
32
+
33
+ function toNativeCertificateResponseResult(requestId, integrationId, keySystemId, response) {
34
+ return {
35
+ requestId,
36
+ integrationId,
37
+ keySystemId,
38
+ base64body: response ? (0, _reactNativeTheoplayer.fromUint8ArrayToBase64String)(new Uint8Array(response)) : ''
39
+ };
40
+ }
41
+ //# sourceMappingURL=NativeCertificateResponse.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["fromNativeCertificateResponse","response","url","status","statusText","headers","base64body","request","body","fromBase64StringToUint8Array","Uint8Array","fromNativeCertificateRequest","toNativeCertificateResponseResult","requestId","integrationId","keySystemId","fromUint8ArrayToBase64String"],"sources":["NativeCertificateResponse.ts"],"sourcesContent":["import type { NativeContentProtectionEvent } from './NativeContentProtectionEvent';\nimport type { CertificateResponse } from 'react-native-theoplayer';\nimport type { NativeCertificateRequest } from './NativeCertificateRequest';\nimport { fromNativeCertificateRequest } from './NativeCertificateRequest';\nimport { fromBase64StringToUint8Array, fromUint8ArrayToBase64String } from 'react-native-theoplayer';\n\nexport interface NativeCertificateResponse extends NativeContentProtectionEvent {\n url: string;\n status: number;\n statusText: string;\n headers: { [headerName: string]: string };\n base64body: string;\n request: NativeCertificateRequest;\n}\n\nexport interface NativeCertificateResponseResult extends NativeContentProtectionEvent {\n base64body: string;\n}\n\nexport function fromNativeCertificateResponse(response: NativeCertificateResponse): CertificateResponse {\n const { url, status, statusText, headers, base64body, request } = response;\n const body = base64body ? fromBase64StringToUint8Array(base64body) : new Uint8Array();\n return {\n url,\n status,\n statusText,\n headers,\n body,\n request: fromNativeCertificateRequest(request),\n };\n}\n\nexport function toNativeCertificateResponseResult(\n requestId: string,\n integrationId: string,\n keySystemId: string,\n response: ArrayBuffer,\n): NativeCertificateResponseResult {\n return {\n requestId,\n integrationId,\n keySystemId,\n base64body: response ? fromUint8ArrayToBase64String(new Uint8Array(response)) : '',\n };\n}\n"],"mappings":";;;;;;;;AAGA;;AACA;;AAeO,SAASA,6BAAT,CAAuCC,QAAvC,EAAiG;EACtG,MAAM;IAAEC,GAAF;IAAOC,MAAP;IAAeC,UAAf;IAA2BC,OAA3B;IAAoCC,UAApC;IAAgDC;EAAhD,IAA4DN,QAAlE;EACA,MAAMO,IAAI,GAAGF,UAAU,GAAG,IAAAG,mDAAA,EAA6BH,UAA7B,CAAH,GAA8C,IAAII,UAAJ,EAArE;EACA,OAAO;IACLR,GADK;IAELC,MAFK;IAGLC,UAHK;IAILC,OAJK;IAKLG,IALK;IAMLD,OAAO,EAAE,IAAAI,sDAAA,EAA6BJ,OAA7B;EANJ,CAAP;AAQD;;AAEM,SAASK,iCAAT,CACLC,SADK,EAELC,aAFK,EAGLC,WAHK,EAILd,QAJK,EAK4B;EACjC,OAAO;IACLY,SADK;IAELC,aAFK;IAGLC,WAHK;IAILT,UAAU,EAAEL,QAAQ,GAAG,IAAAe,mDAAA,EAA6B,IAAIN,UAAJ,CAAeT,QAAf,CAA7B,CAAH,GAA4D;EAJ3E,CAAP;AAMD"}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=NativeContentProtectionEvent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["NativeContentProtectionEvent.ts"],"sourcesContent":["export interface NativeContentProtectionEvent {\n requestId: string;\n integrationId: string;\n keySystemId: string;\n}\n"],"mappings":""}
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.fromNativeLicenseRequest = fromNativeLicenseRequest;
7
+ exports.toNativeLicenseRequest = toNativeLicenseRequest;
8
+
9
+ var _reactNativeTheoplayer = require("react-native-theoplayer");
10
+
11
+ function fromNativeLicenseRequest(request) {
12
+ const {
13
+ url,
14
+ method,
15
+ headers,
16
+ useCredentials,
17
+ base64body,
18
+ fairplaySkdUrl
19
+ } = request;
20
+ const body = base64body ? (0, _reactNativeTheoplayer.fromBase64StringToUint8Array)(base64body) : null;
21
+ return {
22
+ url,
23
+ method,
24
+ headers,
25
+ useCredentials,
26
+ body,
27
+ fairplaySkdUrl
28
+ };
29
+ }
30
+
31
+ function toNativeLicenseRequest(requestId, integrationId, keySystemId, request) {
32
+ return {
33
+ requestId,
34
+ integrationId,
35
+ keySystemId,
36
+ url: request.url,
37
+ method: request.method,
38
+ headers: request.headers,
39
+ useCredentials: request.useCredentials ?? false,
40
+ base64body: request.body ? (0, _reactNativeTheoplayer.fromUint8ArrayToBase64String)(request.body) : null,
41
+ fairplaySkdUrl: request.fairplaySkdUrl
42
+ };
43
+ }
44
+ //# sourceMappingURL=NativeLicenseRequest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["fromNativeLicenseRequest","request","url","method","headers","useCredentials","base64body","fairplaySkdUrl","body","fromBase64StringToUint8Array","toNativeLicenseRequest","requestId","integrationId","keySystemId","fromUint8ArrayToBase64String"],"sources":["NativeLicenseRequest.ts"],"sourcesContent":["import type { NativeContentProtectionEvent } from './NativeContentProtectionEvent';\nimport type { LicenseRequest } from 'react-native-theoplayer';\nimport { fromBase64StringToUint8Array, fromUint8ArrayToBase64String } from 'react-native-theoplayer';\n\nexport interface NativeLicenseRequest extends NativeContentProtectionEvent {\n url: string;\n method: string;\n headers: { [headerName: string]: string };\n base64body: string | null;\n useCredentials: boolean;\n fairplaySkdUrl: string | undefined;\n}\n\nexport function fromNativeLicenseRequest(request: NativeLicenseRequest): LicenseRequest {\n const { url, method, headers, useCredentials, base64body, fairplaySkdUrl } = request;\n const body = base64body ? fromBase64StringToUint8Array(base64body) : null;\n return {\n url,\n method,\n headers,\n useCredentials,\n body,\n fairplaySkdUrl,\n };\n}\n\nexport function toNativeLicenseRequest(requestId: string, integrationId: string, keySystemId: string, request: LicenseRequest): NativeLicenseRequest {\n return {\n requestId,\n integrationId,\n keySystemId,\n url: request.url,\n method: request.method,\n headers: request.headers,\n useCredentials: request.useCredentials ?? false,\n base64body: request.body ? fromUint8ArrayToBase64String(request.body) : null,\n fairplaySkdUrl: request.fairplaySkdUrl,\n };\n}\n"],"mappings":";;;;;;;;AAEA;;AAWO,SAASA,wBAAT,CAAkCC,OAAlC,EAAiF;EACtF,MAAM;IAAEC,GAAF;IAAOC,MAAP;IAAeC,OAAf;IAAwBC,cAAxB;IAAwCC,UAAxC;IAAoDC;EAApD,IAAuEN,OAA7E;EACA,MAAMO,IAAI,GAAGF,UAAU,GAAG,IAAAG,mDAAA,EAA6BH,UAA7B,CAAH,GAA8C,IAArE;EACA,OAAO;IACLJ,GADK;IAELC,MAFK;IAGLC,OAHK;IAILC,cAJK;IAKLG,IALK;IAMLD;EANK,CAAP;AAQD;;AAEM,SAASG,sBAAT,CAAgCC,SAAhC,EAAmDC,aAAnD,EAA0EC,WAA1E,EAA+FZ,OAA/F,EAA8I;EACnJ,OAAO;IACLU,SADK;IAELC,aAFK;IAGLC,WAHK;IAILX,GAAG,EAAED,OAAO,CAACC,GAJR;IAKLC,MAAM,EAAEF,OAAO,CAACE,MALX;IAMLC,OAAO,EAAEH,OAAO,CAACG,OANZ;IAOLC,cAAc,EAAEJ,OAAO,CAACI,cAAR,IAA0B,KAPrC;IAQLC,UAAU,EAAEL,OAAO,CAACO,IAAR,GAAe,IAAAM,mDAAA,EAA6Bb,OAAO,CAACO,IAArC,CAAf,GAA4D,IARnE;IASLD,cAAc,EAAEN,OAAO,CAACM;EATnB,CAAP;AAWD"}
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.fromNativeLicenseResponse = fromNativeLicenseResponse;
7
+ exports.toNativeLicenseResponseResult = toNativeLicenseResponseResult;
8
+
9
+ var _NativeLicenseRequest = require("./NativeLicenseRequest");
10
+
11
+ var _reactNativeTheoplayer = require("react-native-theoplayer");
12
+
13
+ function fromNativeLicenseResponse(response) {
14
+ const {
15
+ url,
16
+ status,
17
+ statusText,
18
+ headers,
19
+ base64body,
20
+ request
21
+ } = response;
22
+ const body = base64body ? (0, _reactNativeTheoplayer.fromBase64StringToUint8Array)(base64body) : new Uint8Array();
23
+ return {
24
+ url,
25
+ status,
26
+ statusText,
27
+ headers,
28
+ body,
29
+ request: (0, _NativeLicenseRequest.fromNativeLicenseRequest)(request)
30
+ };
31
+ }
32
+
33
+ function toNativeLicenseResponseResult(requestId, integrationId, keySystemId, response) {
34
+ return {
35
+ requestId,
36
+ integrationId,
37
+ keySystemId,
38
+ base64body: response ? (0, _reactNativeTheoplayer.fromUint8ArrayToBase64String)(new Uint8Array(response)) : ''
39
+ };
40
+ }
41
+ //# sourceMappingURL=NativeLicenseResponse.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["fromNativeLicenseResponse","response","url","status","statusText","headers","base64body","request","body","fromBase64StringToUint8Array","Uint8Array","fromNativeLicenseRequest","toNativeLicenseResponseResult","requestId","integrationId","keySystemId","fromUint8ArrayToBase64String"],"sources":["NativeLicenseResponse.ts"],"sourcesContent":["import type { NativeContentProtectionEvent } from './NativeContentProtectionEvent';\nimport type { LicenseResponse } from 'react-native-theoplayer';\nimport type { NativeLicenseRequest } from './NativeLicenseRequest';\nimport { fromNativeLicenseRequest } from './NativeLicenseRequest';\nimport { fromBase64StringToUint8Array, fromUint8ArrayToBase64String } from 'react-native-theoplayer';\n\nexport interface NativeLicenseResponse extends NativeContentProtectionEvent {\n url: string;\n status: number;\n statusText: string;\n headers: { [headerName: string]: string };\n base64body: string;\n request: NativeLicenseRequest;\n}\n\nexport interface NativeLicenseResponseResult extends NativeContentProtectionEvent {\n base64body: string;\n}\n\nexport function fromNativeLicenseResponse(response: NativeLicenseResponse): LicenseResponse {\n const { url, status, statusText, headers, base64body, request } = response;\n const body = base64body ? fromBase64StringToUint8Array(base64body) : new Uint8Array();\n return {\n url,\n status,\n statusText,\n headers,\n body,\n request: fromNativeLicenseRequest(request),\n };\n}\n\nexport function toNativeLicenseResponseResult(\n requestId: string,\n integrationId: string,\n keySystemId: string,\n response: ArrayBuffer,\n): NativeLicenseResponseResult {\n return {\n requestId,\n integrationId,\n keySystemId,\n base64body: response ? fromUint8ArrayToBase64String(new Uint8Array(response)) : '',\n };\n}\n"],"mappings":";;;;;;;;AAGA;;AACA;;AAeO,SAASA,yBAAT,CAAmCC,QAAnC,EAAqF;EAC1F,MAAM;IAAEC,GAAF;IAAOC,MAAP;IAAeC,UAAf;IAA2BC,OAA3B;IAAoCC,UAApC;IAAgDC;EAAhD,IAA4DN,QAAlE;EACA,MAAMO,IAAI,GAAGF,UAAU,GAAG,IAAAG,mDAAA,EAA6BH,UAA7B,CAAH,GAA8C,IAAII,UAAJ,EAArE;EACA,OAAO;IACLR,GADK;IAELC,MAFK;IAGLC,UAHK;IAILC,OAJK;IAKLG,IALK;IAMLD,OAAO,EAAE,IAAAI,8CAAA,EAAyBJ,OAAzB;EANJ,CAAP;AAQD;;AAEM,SAASK,6BAAT,CACLC,SADK,EAELC,aAFK,EAGLC,WAHK,EAILd,QAJK,EAKwB;EAC7B,OAAO;IACLY,SADK;IAELC,aAFK;IAGLC,WAHK;IAILT,UAAU,EAAEL,QAAQ,GAAG,IAAAe,mDAAA,EAA6B,IAAIN,UAAJ,CAAeT,QAAf,CAA7B,CAAH,GAA4D;EAJ3E,CAAP;AAMD"}
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.arrayContainsElement_ = arrayContainsElement_;
7
+ exports.decodeNanInf = decodeNanInf;
8
+ exports.isArrayBufferView_ = void 0;
9
+ exports.isBufferSource = isBufferSource;
10
+ exports.objectToString = void 0;
11
+ const NAN_VALUE = -1;
12
+ const POS_INF_VALUE = -2; // We can't send INF and NaN values over the bridge, so convert if necessary.
13
+
14
+ function decodeNanInf(v) {
15
+ if (v === NAN_VALUE) {
16
+ return NaN;
17
+ }
18
+
19
+ if (v === POS_INF_VALUE) {
20
+ return Infinity;
21
+ }
22
+
23
+ return v;
24
+ }
25
+
26
+ const objectToString = {}.toString;
27
+ exports.objectToString = objectToString;
28
+ const viewClasses = ['[object Int8Array]', '[object Uint8Array]', '[object Uint8ClampedArray]', '[object Int16Array]', '[object Uint16Array]', '[object Int32Array]', '[object Uint32Array]', '[object Float32Array]', '[object Float64Array]', '[object DataView]'];
29
+
30
+ function arrayContainsElement_(array, element) {
31
+ return array.indexOf(element) !== -1;
32
+ }
33
+
34
+ const isArrayBufferView_ = ArrayBuffer.isView || (obj => obj && arrayContainsElement_(viewClasses, objectToString.call(obj)));
35
+
36
+ exports.isArrayBufferView_ = isArrayBufferView_;
37
+
38
+ function isBufferSource(bufferSource) {
39
+ return bufferSource instanceof ArrayBuffer || isArrayBufferView_(bufferSource);
40
+ }
41
+ //# sourceMappingURL=TypeUtils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["NAN_VALUE","POS_INF_VALUE","decodeNanInf","v","NaN","Infinity","objectToString","toString","viewClasses","arrayContainsElement_","array","element","indexOf","isArrayBufferView_","ArrayBuffer","isView","obj","call","isBufferSource","bufferSource"],"sources":["TypeUtils.ts"],"sourcesContent":["const NAN_VALUE = -1;\nconst POS_INF_VALUE = -2;\n\n// We can't send INF and NaN values over the bridge, so convert if necessary.\nexport function decodeNanInf(v: number): number {\n if (v === NAN_VALUE) {\n return NaN;\n }\n if (v === POS_INF_VALUE) {\n return Infinity;\n }\n return v;\n}\n\nexport const objectToString = {}.toString;\n\nconst viewClasses = [\n '[object Int8Array]',\n '[object Uint8Array]',\n '[object Uint8ClampedArray]',\n '[object Int16Array]',\n '[object Uint16Array]',\n '[object Int32Array]',\n '[object Uint32Array]',\n '[object Float32Array]',\n '[object Float64Array]',\n '[object DataView]',\n];\n\nexport function arrayContainsElement_<T>(array: ReadonlyArray<T>, element: T): boolean {\n return array.indexOf(element) !== -1;\n}\n\nexport const isArrayBufferView_: typeof ArrayBuffer.isView =\n ArrayBuffer.isView || ((obj) => obj && arrayContainsElement_(viewClasses, objectToString.call(obj)));\n\nexport function isBufferSource(bufferSource: any): bufferSource is BufferSource {\n return bufferSource instanceof ArrayBuffer || isArrayBufferView_(bufferSource);\n}\n"],"mappings":";;;;;;;;;;AAAA,MAAMA,SAAS,GAAG,CAAC,CAAnB;AACA,MAAMC,aAAa,GAAG,CAAC,CAAvB,C,CAEA;;AACO,SAASC,YAAT,CAAsBC,CAAtB,EAAyC;EAC9C,IAAIA,CAAC,KAAKH,SAAV,EAAqB;IACnB,OAAOI,GAAP;EACD;;EACD,IAAID,CAAC,KAAKF,aAAV,EAAyB;IACvB,OAAOI,QAAP;EACD;;EACD,OAAOF,CAAP;AACD;;AAEM,MAAMG,cAAc,GAAG,GAAGC,QAA1B;;AAEP,MAAMC,WAAW,GAAG,CAClB,oBADkB,EAElB,qBAFkB,EAGlB,4BAHkB,EAIlB,qBAJkB,EAKlB,sBALkB,EAMlB,qBANkB,EAOlB,sBAPkB,EAQlB,uBARkB,EASlB,uBATkB,EAUlB,mBAVkB,CAApB;;AAaO,SAASC,qBAAT,CAAkCC,KAAlC,EAA2DC,OAA3D,EAAgF;EACrF,OAAOD,KAAK,CAACE,OAAN,CAAcD,OAAd,MAA2B,CAAC,CAAnC;AACD;;AAEM,MAAME,kBAA6C,GACxDC,WAAW,CAACC,MAAZ,KAAwBC,GAAD,IAASA,GAAG,IAAIP,qBAAqB,CAACD,WAAD,EAAcF,cAAc,CAACW,IAAf,CAAoBD,GAApB,CAAd,CAA5D,CADK;;;;AAGA,SAASE,cAAT,CAAwBC,YAAxB,EAAyE;EAC9E,OAAOA,YAAY,YAAYL,WAAxB,IAAuCD,kBAAkB,CAACM,YAAD,CAAhE;AACD"}
@@ -3,6 +3,8 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
+ exports.findNativeQualitiesByUid = findNativeQualitiesByUid;
7
+ exports.findNativeQualityByUid = findNativeQualityByUid;
6
8
  exports.fromNativeCue = fromNativeCue;
7
9
  exports.fromNativeMediaTrack = fromNativeMediaTrack;
8
10
  exports.fromNativeTextTrack = fromNativeTextTrack;
@@ -65,4 +67,21 @@ function fromNativeMediaTrack(track) {
65
67
  targetQuality
66
68
  };
67
69
  }
70
+
71
+ function findNativeQualityByUid(mediaTrack, uid) {
72
+ return mediaTrack.qualities.find(quality => quality.uid === uid);
73
+ }
74
+
75
+ function findNativeQualitiesByUid(mediaTrack, uid) {
76
+ if (uid && mediaTrack) {
77
+ if (Array.isArray(uid)) {
78
+ return mediaTrack.qualities.filter(quality => uid.includes(quality.uid));
79
+ } else {
80
+ const quality = findNativeQualityByUid(mediaTrack, uid);
81
+ return quality ? [quality] : undefined;
82
+ }
83
+ }
84
+
85
+ return undefined;
86
+ }
68
87
  //# sourceMappingURL=TrackUtils.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["fromNativeCue","cue","id","uid","startTime","endTime","content","fromNativeTextTrack","track","kind","label","language","mode","type","src","forced","cues","map","fromNativeMediaTrack","activeQuality","qualities","targetQuality"],"sources":["TrackUtils.ts"],"sourcesContent":["import type { TextTrackCue as NativeTextTrackCue, TextTrack as NativeTextTrack, MediaTrack as NativeMediaTrack } from 'theoplayer';\nimport type { TextTrack, TextTrackCue, MediaTrack } from 'react-native-theoplayer';\n\nexport function fromNativeCue(cue: NativeTextTrackCue): TextTrackCue {\n return {\n id: cue.id,\n uid: cue.uid,\n startTime: 1e3 * cue.startTime,\n endTime: 1e3 * cue.endTime,\n content: cue.content,\n } as TextTrackCue;\n}\n\nexport function fromNativeTextTrack(track: NativeTextTrack): TextTrack {\n const { id, uid, kind, label, language, mode, type, src, forced } = track;\n\n return {\n id,\n uid,\n kind,\n label,\n language,\n mode,\n type,\n src,\n forced,\n cues: track.cues ? track.cues.map((cue) => fromNativeCue(cue)) : [],\n } as TextTrack;\n}\n\nexport function fromNativeMediaTrack(track: NativeMediaTrack): MediaTrack {\n const { id, uid, kind, label, language, activeQuality, qualities, targetQuality } = track;\n\n return {\n kind,\n label,\n language,\n id,\n uid,\n activeQuality,\n qualities,\n targetQuality,\n } as MediaTrack;\n}\n"],"mappings":";;;;;;;;;AAGO,SAASA,aAAT,CAAuBC,GAAvB,EAA8D;EACnE,OAAO;IACLC,EAAE,EAAED,GAAG,CAACC,EADH;IAELC,GAAG,EAAEF,GAAG,CAACE,GAFJ;IAGLC,SAAS,EAAE,MAAMH,GAAG,CAACG,SAHhB;IAILC,OAAO,EAAE,MAAMJ,GAAG,CAACI,OAJd;IAKLC,OAAO,EAAEL,GAAG,CAACK;EALR,CAAP;AAOD;;AAEM,SAASC,mBAAT,CAA6BC,KAA7B,EAAgE;EACrE,MAAM;IAAEN,EAAF;IAAMC,GAAN;IAAWM,IAAX;IAAiBC,KAAjB;IAAwBC,QAAxB;IAAkCC,IAAlC;IAAwCC,IAAxC;IAA8CC,GAA9C;IAAmDC;EAAnD,IAA8DP,KAApE;EAEA,OAAO;IACLN,EADK;IAELC,GAFK;IAGLM,IAHK;IAILC,KAJK;IAKLC,QALK;IAMLC,IANK;IAOLC,IAPK;IAQLC,GARK;IASLC,MATK;IAULC,IAAI,EAAER,KAAK,CAACQ,IAAN,GAAaR,KAAK,CAACQ,IAAN,CAAWC,GAAX,CAAgBhB,GAAD,IAASD,aAAa,CAACC,GAAD,CAArC,CAAb,GAA2D;EAV5D,CAAP;AAYD;;AAEM,SAASiB,oBAAT,CAA8BV,KAA9B,EAAmE;EACxE,MAAM;IAAEN,EAAF;IAAMC,GAAN;IAAWM,IAAX;IAAiBC,KAAjB;IAAwBC,QAAxB;IAAkCQ,aAAlC;IAAiDC,SAAjD;IAA4DC;EAA5D,IAA8Eb,KAApF;EAEA,OAAO;IACLC,IADK;IAELC,KAFK;IAGLC,QAHK;IAILT,EAJK;IAKLC,GALK;IAMLgB,aANK;IAOLC,SAPK;IAQLC;EARK,CAAP;AAUD"}
1
+ {"version":3,"names":["fromNativeCue","cue","id","uid","startTime","endTime","content","fromNativeTextTrack","track","kind","label","language","mode","type","src","forced","cues","map","fromNativeMediaTrack","activeQuality","qualities","targetQuality","findNativeQualityByUid","mediaTrack","find","quality","findNativeQualitiesByUid","Array","isArray","filter","includes","undefined"],"sources":["TrackUtils.ts"],"sourcesContent":["import type {\n TextTrackCue as NativeTextTrackCue,\n TextTrack as NativeTextTrack,\n MediaTrack as NativeMediaTrack,\n Quality as NativeQuality,\n} from 'theoplayer';\nimport type { TextTrack, TextTrackCue, MediaTrack } from 'react-native-theoplayer';\n\nexport function fromNativeCue(cue: NativeTextTrackCue): TextTrackCue {\n return {\n id: cue.id,\n uid: cue.uid,\n startTime: 1e3 * cue.startTime,\n endTime: 1e3 * cue.endTime,\n content: cue.content,\n } as TextTrackCue;\n}\n\nexport function fromNativeTextTrack(track: NativeTextTrack): TextTrack {\n const { id, uid, kind, label, language, mode, type, src, forced } = track;\n\n return {\n id,\n uid,\n kind,\n label,\n language,\n mode,\n type,\n src,\n forced,\n cues: track.cues ? track.cues.map((cue) => fromNativeCue(cue)) : [],\n } as TextTrack;\n}\n\nexport function fromNativeMediaTrack(track: NativeMediaTrack): MediaTrack {\n const { id, uid, kind, label, language, activeQuality, qualities, targetQuality } = track;\n\n return {\n kind,\n label,\n language,\n id,\n uid,\n activeQuality,\n qualities,\n targetQuality,\n } as MediaTrack;\n}\n\nexport function findNativeQualityByUid(mediaTrack: NativeMediaTrack, uid: number | undefined): NativeQuality | undefined {\n return mediaTrack.qualities.find((quality) => quality.uid === uid);\n}\n\nexport function findNativeQualitiesByUid(mediaTrack: NativeMediaTrack | undefined, uid: number | number[] | undefined): NativeQuality[] | undefined {\n if (uid && mediaTrack) {\n if (Array.isArray(uid)) {\n return mediaTrack.qualities.filter((quality) => uid.includes(quality.uid));\n } else {\n const quality = findNativeQualityByUid(mediaTrack, uid);\n return quality ? [quality] : undefined;\n }\n }\n return undefined;\n}\n"],"mappings":";;;;;;;;;;;AAQO,SAASA,aAAT,CAAuBC,GAAvB,EAA8D;EACnE,OAAO;IACLC,EAAE,EAAED,GAAG,CAACC,EADH;IAELC,GAAG,EAAEF,GAAG,CAACE,GAFJ;IAGLC,SAAS,EAAE,MAAMH,GAAG,CAACG,SAHhB;IAILC,OAAO,EAAE,MAAMJ,GAAG,CAACI,OAJd;IAKLC,OAAO,EAAEL,GAAG,CAACK;EALR,CAAP;AAOD;;AAEM,SAASC,mBAAT,CAA6BC,KAA7B,EAAgE;EACrE,MAAM;IAAEN,EAAF;IAAMC,GAAN;IAAWM,IAAX;IAAiBC,KAAjB;IAAwBC,QAAxB;IAAkCC,IAAlC;IAAwCC,IAAxC;IAA8CC,GAA9C;IAAmDC;EAAnD,IAA8DP,KAApE;EAEA,OAAO;IACLN,EADK;IAELC,GAFK;IAGLM,IAHK;IAILC,KAJK;IAKLC,QALK;IAMLC,IANK;IAOLC,IAPK;IAQLC,GARK;IASLC,MATK;IAULC,IAAI,EAAER,KAAK,CAACQ,IAAN,GAAaR,KAAK,CAACQ,IAAN,CAAWC,GAAX,CAAgBhB,GAAD,IAASD,aAAa,CAACC,GAAD,CAArC,CAAb,GAA2D;EAV5D,CAAP;AAYD;;AAEM,SAASiB,oBAAT,CAA8BV,KAA9B,EAAmE;EACxE,MAAM;IAAEN,EAAF;IAAMC,GAAN;IAAWM,IAAX;IAAiBC,KAAjB;IAAwBC,QAAxB;IAAkCQ,aAAlC;IAAiDC,SAAjD;IAA4DC;EAA5D,IAA8Eb,KAApF;EAEA,OAAO;IACLC,IADK;IAELC,KAFK;IAGLC,QAHK;IAILT,EAJK;IAKLC,GALK;IAMLgB,aANK;IAOLC,SAPK;IAQLC;EARK,CAAP;AAUD;;AAEM,SAASC,sBAAT,CAAgCC,UAAhC,EAA8DpB,GAA9D,EAAkH;EACvH,OAAOoB,UAAU,CAACH,SAAX,CAAqBI,IAArB,CAA2BC,OAAD,IAAaA,OAAO,CAACtB,GAAR,KAAgBA,GAAvD,CAAP;AACD;;AAEM,SAASuB,wBAAT,CAAkCH,UAAlC,EAA4EpB,GAA5E,EAA6I;EAClJ,IAAIA,GAAG,IAAIoB,UAAX,EAAuB;IACrB,IAAII,KAAK,CAACC,OAAN,CAAczB,GAAd,CAAJ,EAAwB;MACtB,OAAOoB,UAAU,CAACH,SAAX,CAAqBS,MAArB,CAA6BJ,OAAD,IAAatB,GAAG,CAAC2B,QAAJ,CAAaL,OAAO,CAACtB,GAArB,CAAzC,CAAP;IACD,CAFD,MAEO;MACL,MAAMsB,OAAO,GAAGH,sBAAsB,CAACC,UAAD,EAAapB,GAAb,CAAtC;MACA,OAAOsB,OAAO,GAAG,CAACA,OAAD,CAAH,GAAeM,SAA7B;IACD;EACF;;EACD,OAAOA,SAAP;AACD"}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["THEOplayerView.ts"],"sourcesContent":["import type { SourceDescription } from './source/SourceDescription';\nimport type { StyleProp, ViewStyle } from 'react-native';\nimport type {\n DurationChangeEvent,\n ErrorEvent,\n LoadedMetadataEvent,\n ReadyStateChangeEvent,\n TimeUpdateEvent,\n ProgressEvent,\n SegmentNotFoundEvent,\n} from './event/PlayerEvent';\nimport type { TextTrackEvent, TextTrackListEvent } from './event/TrackEvent';\nimport type { HostComponent } from 'react-native';\nimport type { PlayerConfiguration } from './config/PlayerConfiguration';\n\nexport interface THEOplayerViewProps {\n /**\n * The player configuration with THEOplayer license.\n */\n config?: PlayerConfiguration;\n\n /**\n * A source description that determines the current media resource.\n */\n source: SourceDescription;\n\n /**\n * Used to set the player's paused state.\n *\n * @remarks\n * <br/> - If paused is initially set to `true`, play-out will start once the source is set.\n */\n paused?: boolean;\n\n /**\n * Used to set the playback rate of the media.\n *\n * @example\n * <br/> - `playbackRate = 0.70` will slow down the playback rate of the media by 30%.\n * <br/> - `playbackRate = 1.25` will speed up the playback rate of the media by 25%.\n *\n * @remarks\n * <br/> - Playback rate is represented by a number where `1` is default playback speed.\n * <br/> - Playback rate must be a positive number.\n * <br/> - It is recommended that you limit the range to between 0.5 and 4.\n */\n playbackRate?: number;\n\n /**\n * Used to set the volume of the audio.\n *\n * @remarks\n * <br/> - Volume is represented by a floating point number between `0.0` and `1.0`.\n */\n volume?: number;\n\n /**\n * Determines whether audio is muted.\n */\n muted?: boolean;\n\n /**\n * Determines whether the player is currently playing in fullscreen.\n */\n fullscreen?: boolean;\n\n /**\n * Used to set the current selected text track by passing its `uid`, or `null` to select none.\n */\n selectedTextTrack?: number | null;\n\n /**\n * Used to set the current selected video track by passing its `uid`, or `null` to select none.\n */\n selectedVideoTrack?: number | null;\n\n /**\n * Used to set the current selected audio track by passing its `uid`, or `null` to select none.\n */\n selectedAudioTrack?: number | null;\n\n /**\n * The style applied to the player view.\n */\n style?: StyleProp<ViewStyle>;\n\n /**\n * Invoked before the player goes to fullscreen.\n */\n onFullscreenPlayerWillPresent?: () => void;\n\n /**\n * Invoked after the player went to fullscreen.\n */\n onFullscreenPlayerDidPresent?: () => void;\n\n /**\n * Invoked before the player returns from fullscreen.\n */\n onFullscreenPlayerWillDismiss?: () => void;\n\n /**\n * Invoked after the player returned from fullscreen.\n */\n onFullscreenPlayerDidDismiss?: () => void;\n\n /**\n * Invoked when the player's buffering state has changed.\n *\n * @remarks\n * <br/> - The `isBuffering` value is typically coupled to showing/hiding a loading indicator.\n *\n * @param isBuffering A value that indicates whether the player is buffering.\n */\n onBufferingStateChange?: (isBuffering: boolean) => void;\n\n /**\n * Invoked when the player receives a new source description.\n */\n onSourceChange?: () => void;\n\n /**\n * Invoked when the player starts loading the manifest.\n */\n onLoadStart?: () => void;\n\n /**\n * Invoked when the player has determined the duration and dimensions of the\n * media resource, and the text and media tracks are ready.\n */\n onLoadedMetadata?: (event: LoadedMetadataEvent) => void;\n\n /**\n * Invoked when the player can render the media data at the current playback position for the first time.\n */\n onLoadedData?: () => void;\n\n /**\n * Invoked when the player's readyState has changed.\n */\n onReadyStateChange?: (event: ReadyStateChangeEvent) => void;\n\n /**\n * Invoked when an error occurs.\n */\n onError?: (event: ErrorEvent) => void;\n\n /**\n * Invoked each time the player has loaded media data.\n */\n onProgress?: (event: ProgressEvent) => void;\n\n /**\n * Invoked when the player's internal paused state changes to `false`.\n */\n onPlay?: () => void;\n\n /**\n * Invoked when playback is ready to start after having been paused or delayed due to\n * lack of media data.\n */\n onPlaying?: () => void;\n\n /**\n * Invoked when the player's internal paused state changes to `true`.\n */\n onPause?: () => void;\n\n /**\n * Invoked when a seek operation starts and the player is seeking a new position.\n */\n onSeeking?: () => void;\n\n /**\n * Invoked when a seek operation completed and the current playback position has changed\n */\n onSeeked?: () => void;\n\n /**\n * Invoked when playback has stopped because the end of the media was reached or because\n * no further data is available.\n */\n onEnded?: () => void;\n\n /**\n * Invoked when the current playback position changed.\n */\n onTimeUpdate?: (event: TimeUpdateEvent) => void;\n\n /**\n * Invoked when the player's duration attribute has been updated.\n */\n onDurationChange?: (event: DurationChangeEvent) => void;\n\n /**\n * Invoked when a segment can not be found.\n *\n * @remarks\n * <br/> - Only dispatched on DASH streams.\n */\n onSegmentNotFound?: (event: SegmentNotFoundEvent) => void;\n\n /**\n * Invoked when a text track list event occurs.\n */\n onTextTrackListEvent?: (event: TextTrackListEvent) => void;\n\n /**\n * Invoked when a text track event occurs.\n */\n onTextTrackEvent?: (event: TextTrackEvent) => void;\n}\n\nexport interface THEOplayerViewComponent extends HostComponent<THEOplayerViewProps> {\n /**\n * Seek to a new position.\n *\n * @param seekTime - new time, in milliseconds.\n */\n seek: (seekTime: number) => void;\n}\n"],"mappings":""}
1
+ {"version":3,"names":[],"sources":["THEOplayerView.ts"],"sourcesContent":["import type { SourceDescription } from './source/SourceDescription';\nimport type { StyleProp, ViewStyle } from 'react-native';\nimport type {\n DurationChangeEvent,\n ErrorEvent,\n LoadedMetadataEvent,\n ReadyStateChangeEvent,\n TimeUpdateEvent,\n ProgressEvent,\n SegmentNotFoundEvent,\n} from './event/PlayerEvent';\nimport type { TextTrackEvent, TextTrackListEvent } from './event/TrackEvent';\nimport type { PlayerConfiguration } from './config/PlayerConfiguration';\nimport type { ABRConfiguration } from './abr/ABRConfiguration';\nimport type { AdEvent } from \"./event/AdEvent\";\nimport type { AdsAPI } from \"./ads/AdsAPI\";\n\nexport interface THEOplayerViewProps {\n /**\n * The player configuration with THEOplayer license.\n */\n config?: PlayerConfiguration;\n\n /**\n * The player's adaptive bitrate (ABR) configuration.\n *\n * @remarks\n * <br/> - This property is supported on Android & Web platforms only.\n */\n abrConfig?: ABRConfiguration;\n\n /**\n * A source description that determines the current media resource.\n */\n source: SourceDescription;\n\n /**\n * Used to set the player's paused state.\n *\n * @remarks\n * <br/> - If paused is initially set to `true`, play-out will start once the source is set.\n */\n paused?: boolean;\n\n /**\n * Used to set the playback rate of the media.\n *\n * @example\n * <br/> - `playbackRate = 0.70` will slow down the playback rate of the media by 30%.\n * <br/> - `playbackRate = 1.25` will speed up the playback rate of the media by 25%.\n *\n * @remarks\n * <br/> - Playback rate is represented by a number where `1` is default playback speed.\n * <br/> - Playback rate must be a positive number.\n * <br/> - It is recommended that you limit the range to between 0.5 and 4.\n */\n playbackRate?: number;\n\n /**\n * Used to set the volume of the audio.\n *\n * @remarks\n * <br/> - Volume is represented by a floating point number between `0.0` and `1.0`.\n */\n volume?: number;\n\n /**\n * Determines whether audio is muted.\n */\n muted?: boolean;\n\n /**\n * Determines whether the player is currently playing in fullscreen.\n */\n fullscreen?: boolean;\n\n /**\n * Used to set the current selected text track by passing its `uid`, or `null` to select none.\n */\n selectedTextTrack?: number | null;\n\n /**\n * Used to set the current selected video track by passing its `uid`, or `null` to select none.\n */\n selectedVideoTrack?: number | null;\n\n /**\n * Used to set the current selected video quality by passing its `uid`, or `null` to select none.\n */\n targetVideoQuality?: number | number[] | undefined;\n\n /**\n * Used to set the current selected audio track by passing its `uid`, or `null` to select none.\n */\n selectedAudioTrack?: number | null;\n\n /**\n * The style applied to the player view.\n */\n style?: StyleProp<ViewStyle>;\n\n /**\n * Invoked before the player goes to fullscreen.\n */\n onFullscreenPlayerWillPresent?: () => void;\n\n /**\n * Invoked after the player went to fullscreen.\n */\n onFullscreenPlayerDidPresent?: () => void;\n\n /**\n * Invoked before the player returns from fullscreen.\n */\n onFullscreenPlayerWillDismiss?: () => void;\n\n /**\n * Invoked after the player returned from fullscreen.\n */\n onFullscreenPlayerDidDismiss?: () => void;\n\n /**\n * Invoked when the player's buffering state has changed.\n *\n * @remarks\n * <br/> - The `isBuffering` value is typically coupled to showing/hiding a loading indicator.\n *\n * @param isBuffering A value that indicates whether the player is buffering.\n */\n onBufferingStateChange?: (isBuffering: boolean) => void;\n\n /**\n * Invoked when the player receives a new source description.\n */\n onSourceChange?: () => void;\n\n /**\n * Invoked when the player starts loading the manifest.\n */\n onLoadStart?: () => void;\n\n /**\n * Invoked when the player has determined the duration and dimensions of the\n * media resource, and the text and media tracks are ready.\n */\n onLoadedMetadata?: (event: LoadedMetadataEvent) => void;\n\n /**\n * Invoked when the player can render the media data at the current playback position for the first time.\n */\n onLoadedData?: () => void;\n\n /**\n * Invoked when the player's readyState has changed.\n */\n onReadyStateChange?: (event: ReadyStateChangeEvent) => void;\n\n /**\n * Invoked when an error occurs.\n */\n onError?: (event: ErrorEvent) => void;\n\n /**\n * Invoked each time the player has loaded media data.\n */\n onProgress?: (event: ProgressEvent) => void;\n\n /**\n * Invoked when the player's internal paused state changes to `false`.\n */\n onPlay?: () => void;\n\n /**\n * Invoked when playback is ready to start after having been paused or delayed due to\n * lack of media data.\n */\n onPlaying?: () => void;\n\n /**\n * Invoked when the player's internal paused state changes to `true`.\n */\n onPause?: () => void;\n\n /**\n * Invoked when a seek operation starts and the player is seeking a new position.\n */\n onSeeking?: () => void;\n\n /**\n * Invoked when a seek operation completed and the current playback position has changed.\n */\n onSeeked?: () => void;\n\n /**\n * Invoked when playback has stopped because the end of the media was reached or because\n * no further data is available.\n */\n onEnded?: () => void;\n\n /**\n * Invoked each time the current playback position changed.\n */\n onTimeUpdate?: (event: TimeUpdateEvent) => void;\n\n /**\n * Invoked when the player's duration attribute has been updated.\n */\n onDurationChange?: (event: DurationChangeEvent) => void;\n\n /**\n * Invoked when a segment can not be found.\n *\n * @remarks\n * <br/> - Only dispatched on DASH streams.\n */\n onSegmentNotFound?: (event: SegmentNotFoundEvent) => void;\n\n /**\n * Invoked when a text track list event occurs.\n */\n onTextTrackListEvent?: (event: TextTrackListEvent) => void;\n\n /**\n * Invoked when a text track event occurs.\n */\n onTextTrackEvent?: (event: TextTrackEvent) => void;\n\n /**\n * Invoked when an ad event occurs.\n */\n onAdEvent?: (event: AdEvent) => void;\n}\n\nexport interface THEOplayerViewComponent {\n /**\n * Seek to a new position.\n *\n * @param seekTime - new time, in milliseconds.\n */\n seek: (seekTime: number) => void;\n\n /**\n * The API for advertisements.\n */\n ads: AdsAPI;\n}\n"],"mappings":""}
@@ -0,0 +1,2 @@
1
+
2
+ //# sourceMappingURL=ABRConfiguration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["ABRConfiguration.ts"],"sourcesContent":["/**\n * The adaptive bitrate strategy of the first segment, represented by a value from the following list:\n * <br/> - `'performance'`: The player will optimize ABR behavior to focus on the performance of the player. This strategy initiates playback with the lowest quality suitable for the device which means faster start-up time.\n * <br/> - `'quality'`: The player will optimize ABR behavior to focus displaying the best visual quality to the end-user. This strategy initiates playback with the highest bit rate suitable for the device.\n * <br/> - `'bandwidth'`: The player will optimize the ABR behavior to focus on displaying the most optimal quality based on historic data of available bandwidth and knowledge of the network conditions.\n *\n * @public\n */\nexport type ABRStrategyType = 'performance' | 'quality' | 'bandwidth';\n\n/**\n * Describes the metadata of the adaptive bitrate strategy.\n *\n * @public\n */\nexport interface ABRMetadata {\n /**\n * The initial bitrate, in bits per second.\n *\n * @defaultValue Bitrate available to the browser.\n */\n bitrate?: number;\n}\n\n/**\n * Describes the configuration of the adaptive bitrate strategy.\n *\n * @public\n */\nexport interface ABRStrategyConfiguration {\n /**\n * The strategy for initial playback.\n */\n type: ABRStrategyType;\n\n /**\n * The metadata for the initial playback strategy.\n *\n * @defaultValue A {@link ABRMetadata} object with default values.\n */\n metadata?: ABRMetadata;\n}\n\n/**\n * The adaptive bitrate stratey.\n *\n * @public\n */\nexport type ABRStrategy = ABRStrategyConfiguration | ABRStrategyType;\n\n/**\n * Describes the adaptive bitrate configuration.\n *\n * @public\n */\nexport interface ABRConfiguration {\n /**\n * The adaptive bitrate strategy.\n *\n * @defaultValue `'bandwidth'`\n */\n strategy?: ABRStrategy;\n\n /**\n * The amount which the player should buffer ahead of the current playback position, in seconds.\n *\n * @remarks\n * <br/> - Before v4.3.0: This duration has a maximum of 60 seconds.\n * <br/> - After v4.3.0: This duration has no maximum.\n * <br/> - The player might reduce or ignore the configured amount because of device or performance constraints.\n *\n * @defaultValue `20`\n */\n targetBuffer?: number;\n\n /**\n * The amount of data which the player should keep in its buffer before the current playback position, in seconds.\n * This configuration option can be used to reduce the memory footprint on memory restricted devices or on devices\n * which don't automatically prune decoder buffers.\n *\n * Note that the player can decide to keep less data in the decoder buffer in case memory is running low.\n * A value of 0 or lower is not accepted and will be treated as default.\n *\n * @defaultValue `30`\n *\n * @remarks\n * <br/> - This property is currently supported on Web platforms only.\n */\n bufferLookbackWindow?: number;\n\n /**\n * The maximum length of the player's buffer, in seconds.\n *\n * The player will initially buffer up to {@link ABRConfiguration.targetBuffer} seconds of media data.\n * If the player detects that the decoder is unable to hold so much data,\n * it will reduce `maxBufferLength` and restrict `targetBuffer` to be less than\n * this maximum.\n *\n * @remarks\n * <br/> - This property is currently supported on Web platforms only.\n */\n readonly maxBufferLength?: number;\n}\n"],"mappings":""}