react-native-theoplayer 1.6.1 → 1.7.1

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 +76 -33
  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 +273 -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,24 @@
1
+ import { NativeModules } from 'react-native';
2
+ export class THEOplayerNativeGoogleDAI {
3
+ constructor(_player) {
4
+ this._player = _player;
5
+ }
6
+
7
+ get snapback() {
8
+ return NativeModules.AdsModule.daiSnapback(this._player.nativeHandle);
9
+ }
10
+
11
+ setSnapback(enabled) {
12
+ NativeModules.AdsModule.daiSetSnapback(this._player.nativeHandle, enabled);
13
+ }
14
+
15
+ contentTimeForStreamTime(time) {
16
+ return NativeModules.AdsModule.daiContentTimeForStreamTime(this._player.nativeHandle, time);
17
+ }
18
+
19
+ streamTimeForContentTime(time) {
20
+ return NativeModules.AdsModule.daiStreamTimeForContentTime(this._player.nativeHandle, time);
21
+ }
22
+
23
+ }
24
+ //# sourceMappingURL=THEOplayerNativeGoogleDAI.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["NativeModules","THEOplayerNativeGoogleDAI","constructor","_player","snapback","AdsModule","daiSnapback","nativeHandle","setSnapback","enabled","daiSetSnapback","contentTimeForStreamTime","time","daiContentTimeForStreamTime","streamTimeForContentTime","daiStreamTimeForContentTime"],"sources":["THEOplayerNativeGoogleDAI.ts"],"sourcesContent":["import type { GoogleDAI } from 'react-native-theoplayer';\nimport { NativeModules } from 'react-native';\nimport type { THEOplayerView } from 'react-native-theoplayer';\n\nexport class THEOplayerNativeGoogleDAI implements GoogleDAI {\n public constructor(private readonly _player: THEOplayerView) {}\n\n get snapback(): Promise<boolean> {\n return NativeModules.AdsModule.daiSnapback(this._player.nativeHandle);\n }\n\n setSnapback(enabled: boolean): void {\n NativeModules.AdsModule.daiSetSnapback(this._player.nativeHandle, enabled);\n }\n\n contentTimeForStreamTime(time: number): Promise<number> {\n return NativeModules.AdsModule.daiContentTimeForStreamTime(this._player.nativeHandle, time);\n }\n\n streamTimeForContentTime(time: number): Promise<number> {\n return NativeModules.AdsModule.daiStreamTimeForContentTime(this._player.nativeHandle, time);\n }\n}\n"],"mappings":"AACA,SAASA,aAAT,QAA8B,cAA9B;AAGA,OAAO,MAAMC,yBAAN,CAAqD;EACnDC,WAAW,CAAkBC,OAAlB,EAA2C;IAAA,KAAzBA,OAAyB,GAAzBA,OAAyB;EAAE;;EAEnD,IAARC,QAAQ,GAAqB;IAC/B,OAAOJ,aAAa,CAACK,SAAd,CAAwBC,WAAxB,CAAoC,KAAKH,OAAL,CAAaI,YAAjD,CAAP;EACD;;EAEDC,WAAW,CAACC,OAAD,EAAyB;IAClCT,aAAa,CAACK,SAAd,CAAwBK,cAAxB,CAAuC,KAAKP,OAAL,CAAaI,YAApD,EAAkEE,OAAlE;EACD;;EAEDE,wBAAwB,CAACC,IAAD,EAAgC;IACtD,OAAOZ,aAAa,CAACK,SAAd,CAAwBQ,2BAAxB,CAAoD,KAAKV,OAAL,CAAaI,YAAjE,EAA+EK,IAA/E,CAAP;EACD;;EAEDE,wBAAwB,CAACF,IAAD,EAAgC;IACtD,OAAOZ,aAAa,CAACK,SAAd,CAAwBU,2BAAxB,CAAoD,KAAKZ,OAAL,CAAaI,YAAjE,EAA+EK,IAA/E,CAAP;EACD;;AAjByD"}
@@ -0,0 +1,68 @@
1
+ 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; }
2
+
3
+ import { THEOplayerWebGoogleDAI } from "./THEOplayerWebGoogleDAI";
4
+ export class THEOplayerWebAdsAPI {
5
+ constructor(_player) {
6
+ this._player = _player;
7
+
8
+ _defineProperty(this, "_dai", void 0);
9
+ }
10
+
11
+ currentAdBreak() {
12
+ var _this$_player$nativeP, _this$_player$nativeP2;
13
+
14
+ const adBreak = (_this$_player$nativeP = this._player.nativePlayer) === null || _this$_player$nativeP === void 0 ? void 0 : (_this$_player$nativeP2 = _this$_player$nativeP.ads) === null || _this$_player$nativeP2 === void 0 ? void 0 : _this$_player$nativeP2.currentAdBreak;
15
+ return adBreak ? Promise.resolve(adBreak) : Promise.reject();
16
+ }
17
+
18
+ currentAds() {
19
+ var _this$_player$nativeP3, _this$_player$nativeP4;
20
+
21
+ const ads = (_this$_player$nativeP3 = this._player.nativePlayer) === null || _this$_player$nativeP3 === void 0 ? void 0 : (_this$_player$nativeP4 = _this$_player$nativeP3.ads) === null || _this$_player$nativeP4 === void 0 ? void 0 : _this$_player$nativeP4.currentAds;
22
+ return ads ? Promise.resolve(ads) : Promise.reject();
23
+ }
24
+
25
+ playing() {
26
+ var _this$_player$nativeP5, _this$_player$nativeP6;
27
+
28
+ return Promise.resolve(((_this$_player$nativeP5 = this._player.nativePlayer) === null || _this$_player$nativeP5 === void 0 ? void 0 : (_this$_player$nativeP6 = _this$_player$nativeP5.ads) === null || _this$_player$nativeP6 === void 0 ? void 0 : _this$_player$nativeP6.playing) || false);
29
+ }
30
+
31
+ schedule(ad) {
32
+ var _this$_player$nativeP7, _this$_player$nativeP8;
33
+
34
+ (_this$_player$nativeP7 = this._player.nativePlayer) === null || _this$_player$nativeP7 === void 0 ? void 0 : (_this$_player$nativeP8 = _this$_player$nativeP7.ads) === null || _this$_player$nativeP8 === void 0 ? void 0 : _this$_player$nativeP8.schedule(ad);
35
+ }
36
+
37
+ scheduledAdBreaks() {
38
+ var _this$_player$nativeP9, _this$_player$nativeP10;
39
+
40
+ const adBreaks = (_this$_player$nativeP9 = this._player.nativePlayer) === null || _this$_player$nativeP9 === void 0 ? void 0 : (_this$_player$nativeP10 = _this$_player$nativeP9.ads) === null || _this$_player$nativeP10 === void 0 ? void 0 : _this$_player$nativeP10.scheduledAdBreaks;
41
+ return adBreaks ? Promise.resolve(adBreaks) : Promise.reject();
42
+ }
43
+
44
+ skip() {
45
+ var _this$_player$nativeP11, _this$_player$nativeP12;
46
+
47
+ (_this$_player$nativeP11 = this._player.nativePlayer) === null || _this$_player$nativeP11 === void 0 ? void 0 : (_this$_player$nativeP12 = _this$_player$nativeP11.ads) === null || _this$_player$nativeP12 === void 0 ? void 0 : _this$_player$nativeP12.skip();
48
+ }
49
+
50
+ get dai() {
51
+ if (!this._dai) {
52
+ var _this$_player$nativeP13, _this$_player$nativeP14;
53
+
54
+ const nativeDai = (_this$_player$nativeP13 = this._player.nativePlayer) === null || _this$_player$nativeP13 === void 0 ? void 0 : (_this$_player$nativeP14 = _this$_player$nativeP13.ads) === null || _this$_player$nativeP14 === void 0 ? void 0 : _this$_player$nativeP14.dai;
55
+
56
+ if (!nativeDai) {
57
+ // Not native DAI available
58
+ return undefined;
59
+ }
60
+
61
+ this._dai = new THEOplayerWebGoogleDAI(nativeDai);
62
+ }
63
+
64
+ return this._dai;
65
+ }
66
+
67
+ }
68
+ //# sourceMappingURL=THEOplayerWebAdsAPI.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["THEOplayerWebGoogleDAI","THEOplayerWebAdsAPI","constructor","_player","currentAdBreak","adBreak","nativePlayer","ads","Promise","resolve","reject","currentAds","playing","schedule","ad","scheduledAdBreaks","adBreaks","skip","dai","_dai","nativeDai","undefined"],"sources":["THEOplayerWebAdsAPI.ts"],"sourcesContent":["import type { Ad, AdDescription, AdBreak, AdsAPI } from \"react-native-theoplayer\";\nimport type { THEOplayerView } from \"../THEOplayerView.web\";\nimport type { GoogleDAI } from \"react-native-theoplayer\";\nimport { THEOplayerWebGoogleDAI } from \"./THEOplayerWebGoogleDAI\";\n\nexport class THEOplayerWebAdsAPI implements AdsAPI {\n\n private _dai: GoogleDAI | undefined;\n\n constructor(private readonly _player: THEOplayerView) {\n }\n\n currentAdBreak(): Promise<AdBreak> {\n const adBreak = this._player.nativePlayer?.ads?.currentAdBreak;\n return adBreak ? Promise.resolve(adBreak) : Promise.reject<AdBreak>();\n }\n\n currentAds(): Promise<Ad[]> {\n const ads = this._player.nativePlayer?.ads?.currentAds;\n return ads ? Promise.resolve(ads) : Promise.reject<Ad[]>();\n }\n\n playing(): Promise<boolean> {\n return Promise.resolve<boolean>(this._player.nativePlayer?.ads?.playing || false);\n }\n\n schedule(ad: AdDescription): void {\n this._player.nativePlayer?.ads?.schedule(ad);\n }\n\n scheduledAdBreaks(): Promise<AdBreak[]> {\n const adBreaks = this._player.nativePlayer?.ads?.scheduledAdBreaks;\n return adBreaks ? Promise.resolve(adBreaks) : Promise.reject<AdBreak[]>();\n }\n\n skip(): void {\n this._player.nativePlayer?.ads?.skip();\n }\n\n get dai(): GoogleDAI | undefined {\n if (!this._dai) {\n const nativeDai = this._player.nativePlayer?.ads?.dai;\n if (!nativeDai) {\n // Not native DAI available\n return undefined;\n }\n this._dai = new THEOplayerWebGoogleDAI(nativeDai);\n }\n return this._dai;\n }\n}\n"],"mappings":";;AAGA,SAASA,sBAAT,QAAuC,0BAAvC;AAEA,OAAO,MAAMC,mBAAN,CAA4C;EAIjDC,WAAW,CAAkBC,OAAlB,EAA2C;IAAA,KAAzBA,OAAyB,GAAzBA,OAAyB;;IAAA;EACrD;;EAEDC,cAAc,GAAqB;IAAA;;IACjC,MAAMC,OAAO,4BAAG,KAAKF,OAAL,CAAaG,YAAhB,oFAAG,sBAA2BC,GAA9B,2DAAG,uBAAgCH,cAAhD;IACA,OAAOC,OAAO,GAAGG,OAAO,CAACC,OAAR,CAAgBJ,OAAhB,CAAH,GAA8BG,OAAO,CAACE,MAAR,EAA5C;EACD;;EAEDC,UAAU,GAAkB;IAAA;;IAC1B,MAAMJ,GAAG,6BAAG,KAAKJ,OAAL,CAAaG,YAAhB,qFAAG,uBAA2BC,GAA9B,2DAAG,uBAAgCI,UAA5C;IACA,OAAOJ,GAAG,GAAGC,OAAO,CAACC,OAAR,CAAgBF,GAAhB,CAAH,GAA0BC,OAAO,CAACE,MAAR,EAApC;EACD;;EAEDE,OAAO,GAAqB;IAAA;;IAC1B,OAAOJ,OAAO,CAACC,OAAR,CAAyB,gCAAKN,OAAL,CAAaG,YAAb,4GAA2BC,GAA3B,kFAAgCK,OAAhC,KAA2C,KAApE,CAAP;EACD;;EAEDC,QAAQ,CAACC,EAAD,EAA0B;IAAA;;IAChC,+BAAKX,OAAL,CAAaG,YAAb,4GAA2BC,GAA3B,kFAAgCM,QAAhC,CAAyCC,EAAzC;EACD;;EAEDC,iBAAiB,GAAuB;IAAA;;IACtC,MAAMC,QAAQ,6BAAG,KAAKb,OAAL,CAAaG,YAAhB,sFAAG,uBAA2BC,GAA9B,4DAAG,wBAAgCQ,iBAAjD;IACA,OAAOC,QAAQ,GAAGR,OAAO,CAACC,OAAR,CAAgBO,QAAhB,CAAH,GAA+BR,OAAO,CAACE,MAAR,EAA9C;EACD;;EAEDO,IAAI,GAAS;IAAA;;IACX,gCAAKd,OAAL,CAAaG,YAAb,+GAA2BC,GAA3B,oFAAgCU,IAAhC;EACD;;EAEM,IAAHC,GAAG,GAA0B;IAC/B,IAAI,CAAC,KAAKC,IAAV,EAAgB;MAAA;;MACd,MAAMC,SAAS,8BAAG,KAAKjB,OAAL,CAAaG,YAAhB,uFAAG,wBAA2BC,GAA9B,4DAAG,wBAAgCW,GAAlD;;MACA,IAAI,CAACE,SAAL,EAAgB;QACd;QACA,OAAOC,SAAP;MACD;;MACD,KAAKF,IAAL,GAAY,IAAInB,sBAAJ,CAA2BoB,SAA3B,CAAZ;IACD;;IACD,OAAO,KAAKD,IAAZ;EACD;;AA5CgD"}
@@ -0,0 +1,23 @@
1
+ export class THEOplayerWebGoogleDAI {
2
+ constructor(_googleDAI) {
3
+ this._googleDAI = _googleDAI;
4
+ }
5
+
6
+ get snapback() {
7
+ return Promise.resolve(this._googleDAI.snapback);
8
+ }
9
+
10
+ setSnapback(enabled) {
11
+ this._googleDAI.snapback = enabled;
12
+ }
13
+
14
+ contentTimeForStreamTime(time) {
15
+ return Promise.resolve(this._googleDAI.contentTimeForStreamTime(time));
16
+ }
17
+
18
+ streamTimeForContentTime(time) {
19
+ return Promise.resolve(this._googleDAI.streamTimeForContentTime(time));
20
+ }
21
+
22
+ }
23
+ //# sourceMappingURL=THEOplayerWebGoogleDAI.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["THEOplayerWebGoogleDAI","constructor","_googleDAI","snapback","Promise","resolve","setSnapback","enabled","contentTimeForStreamTime","time","streamTimeForContentTime"],"sources":["THEOplayerWebGoogleDAI.ts"],"sourcesContent":["import type { GoogleDAI } from 'react-native-theoplayer';\nimport type { GoogleDAI as NativeGoogleDAI } from 'theoplayer';\n\nexport class THEOplayerWebGoogleDAI implements GoogleDAI {\n public constructor(private readonly _googleDAI: NativeGoogleDAI) {}\n\n get snapback(): Promise<boolean> {\n return Promise.resolve(this._googleDAI.snapback);\n }\n\n setSnapback(enabled: boolean): void {\n this._googleDAI.snapback = enabled;\n }\n\n contentTimeForStreamTime(time: number): Promise<number> {\n return Promise.resolve(this._googleDAI.contentTimeForStreamTime(time));\n }\n\n streamTimeForContentTime(time: number): Promise<number> {\n return Promise.resolve(this._googleDAI.streamTimeForContentTime(time));\n }\n}\n"],"mappings":"AAGA,OAAO,MAAMA,sBAAN,CAAkD;EAChDC,WAAW,CAAkBC,UAAlB,EAA+C;IAAA,KAA7BA,UAA6B,GAA7BA,UAA6B;EAAE;;EAEvD,IAARC,QAAQ,GAAqB;IAC/B,OAAOC,OAAO,CAACC,OAAR,CAAgB,KAAKH,UAAL,CAAgBC,QAAhC,CAAP;EACD;;EAEDG,WAAW,CAACC,OAAD,EAAyB;IAClC,KAAKL,UAAL,CAAgBC,QAAhB,GAA2BI,OAA3B;EACD;;EAEDC,wBAAwB,CAACC,IAAD,EAAgC;IACtD,OAAOL,OAAO,CAACC,OAAR,CAAgB,KAAKH,UAAL,CAAgBM,wBAAhB,CAAyCC,IAAzC,CAAhB,CAAP;EACD;;EAEDC,wBAAwB,CAACD,IAAD,EAAgC;IACtD,OAAOL,OAAO,CAACC,OAAR,CAAgB,KAAKH,UAAL,CAAgBQ,wBAAhB,CAAyCD,IAAzC,CAAhB,CAAP;EACD;;AAjBsD"}
@@ -0,0 +1,188 @@
1
+ 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; }
2
+
3
+ import { NativeEventEmitter, NativeModules } from 'react-native';
4
+ import { fromNativeLicenseRequest, toNativeLicenseRequest } from './NativeLicenseRequest';
5
+ import { fromNativeLicenseResponse, toNativeLicenseResponseResult } from './NativeLicenseResponse';
6
+ import { fromNativeCertificateRequest, toNativeCertificateRequest } from './NativeCertificateRequest';
7
+ import { fromNativeCertificateResponse, toNativeCertificateResponseResult } from './NativeCertificateResponse';
8
+ import { isBufferSource } from '../utils/TypeUtils';
9
+ export class NativeContentProtectionRegistry {
10
+ constructor() {
11
+ _defineProperty(this, "emitter", void 0);
12
+
13
+ _defineProperty(this, "registeredFactories", []);
14
+
15
+ _defineProperty(this, "currentIntegration", undefined);
16
+
17
+ _defineProperty(this, "onBuildIntegrationRequest", event => {
18
+ const {
19
+ requestId,
20
+ integrationId,
21
+ keySystemId,
22
+ drmConfig
23
+ } = event;
24
+ console.log('ContentProtectionModule', `onBuildIntegrationRequest ${integrationId} ${keySystemId}`);
25
+ const factory = this.getFactory(integrationId, keySystemId);
26
+
27
+ if (factory) {
28
+ this.currentIntegration = {
29
+ integrationId,
30
+ keySystemId,
31
+ integration: factory.build(drmConfig)
32
+ };
33
+ NativeModules.ContentProtectionModule.onBuildProcessed({
34
+ requestId,
35
+ resultString: 'success'
36
+ });
37
+ } else {
38
+ NativeModules.ContentProtectionModule.onBuildProcessed({
39
+ requestId,
40
+ resultString: 'failed'
41
+ });
42
+ }
43
+ });
44
+
45
+ _defineProperty(this, "onCertificateRequest", async request => {
46
+ const {
47
+ requestId,
48
+ integrationId,
49
+ keySystemId
50
+ } = request;
51
+ console.log('ContentProtectionModule', `onCertificateRequest ${integrationId} ${keySystemId}`);
52
+ const integration = this.getIntegration(integrationId, keySystemId);
53
+
54
+ if (integration !== null && integration !== void 0 && integration.onCertificateRequest) {
55
+ const result = await integration.onCertificateRequest(fromNativeCertificateRequest(request)); // TODO: we also want to support ArrayBufferView results
56
+
57
+ if (isBufferSource(result)) {
58
+ const nativeResponse = toNativeCertificateResponseResult(requestId, integrationId, keySystemId, result);
59
+ NativeModules.ContentProtectionModule.onCertificateRequestProcessedAsCertificate(nativeResponse);
60
+ } else if (result) {
61
+ const modifiedNativeRequest = toNativeCertificateRequest(requestId, integrationId, keySystemId, result);
62
+ NativeModules.ContentProtectionModule.onCertificateRequestProcessedAsRequest(modifiedNativeRequest);
63
+ }
64
+ } else {
65
+ NativeModules.ContentProtectionModule.onCertificateRequestProcessedAsRequest(request);
66
+ }
67
+ });
68
+
69
+ _defineProperty(this, "onCertificateResponse", async response => {
70
+ const {
71
+ requestId,
72
+ integrationId,
73
+ keySystemId
74
+ } = response;
75
+ console.log('ContentProtectionModule', `onCertificateResponse ${integrationId} ${keySystemId}`);
76
+ const integration = this.getIntegration(integrationId, keySystemId);
77
+
78
+ if (integration !== null && integration !== void 0 && integration.onCertificateResponse) {
79
+ const responseResult = await integration.onCertificateResponse(fromNativeCertificateResponse(response)); // TODO: we also want to support ArrayBufferView results
80
+
81
+ const modifiedNativeResponse = toNativeCertificateResponseResult(requestId, integrationId, keySystemId, responseResult);
82
+ NativeModules.ContentProtectionModule.onCertificateResponseProcessed(modifiedNativeResponse);
83
+ } else {
84
+ NativeModules.ContentProtectionModule.onCertificateResponseProcessed(response);
85
+ }
86
+ });
87
+
88
+ _defineProperty(this, "onLicenseRequest", async request => {
89
+ const {
90
+ requestId,
91
+ integrationId,
92
+ keySystemId
93
+ } = request;
94
+ console.log('ContentProtectionModule', `onLicenseRequest ${integrationId} ${keySystemId}`);
95
+ const integration = this.getIntegration(integrationId, keySystemId); // Optionally let the custom integration modify the request.
96
+
97
+ if (integration !== null && integration !== void 0 && integration.onLicenseRequest) {
98
+ const result = await integration.onLicenseRequest(fromNativeLicenseRequest(request)); // TODO: we also want to support ArrayBufferView results
99
+
100
+ if (isBufferSource(result)) {
101
+ const nativeResponse = toNativeLicenseResponseResult(requestId, integrationId, keySystemId, result);
102
+ NativeModules.ContentProtectionModule.onLicenseRequestProcessedAsLicense(nativeResponse);
103
+ } else if (result) {
104
+ const modifiedNativeRequest = toNativeLicenseRequest(requestId, integrationId, keySystemId, result);
105
+ NativeModules.ContentProtectionModule.onLicenseRequestProcessedAsRequest(modifiedNativeRequest);
106
+ }
107
+ } else {
108
+ NativeModules.ContentProtectionModule.onLicenseRequestProcessedAsRequest(request);
109
+ }
110
+ });
111
+
112
+ _defineProperty(this, "onLicenseResponse", async response => {
113
+ const {
114
+ requestId,
115
+ integrationId,
116
+ keySystemId
117
+ } = response;
118
+ console.log('ContentProtectionModule', `onLicenseResponse ${integrationId} ${keySystemId}`);
119
+ const integration = this.getIntegration(integrationId, keySystemId);
120
+
121
+ if (integration !== null && integration !== void 0 && integration.onLicenseResponse) {
122
+ const responseResult = await integration.onLicenseResponse(fromNativeLicenseResponse(response)); // TODO: we also want to support ArrayBufferView results
123
+
124
+ const modifiedNativeResponse = toNativeLicenseResponseResult(requestId, integrationId, keySystemId, responseResult);
125
+ NativeModules.ContentProtectionModule.onLicenseResponseProcessed(modifiedNativeResponse);
126
+ } else {
127
+ NativeModules.ContentProtectionModule.onLicenseResponseProcessed(response);
128
+ }
129
+ });
130
+
131
+ _defineProperty(this, "onExtractFairplayContentId", async event => {
132
+ const {
133
+ integrationId,
134
+ keySystemId,
135
+ fairplaySkdUrl,
136
+ requestId
137
+ } = event;
138
+ console.log('ContentProtectionModule', `onExtractFairplayContentId ${integrationId} ${keySystemId}`);
139
+ const integration = this.getIntegration(integrationId, keySystemId);
140
+
141
+ if (integration !== null && integration !== void 0 && integration.extractFairplayContentId) {
142
+ const contentId = await integration.extractFairplayContentId(fairplaySkdUrl);
143
+ NativeModules.ContentProtectionModule.onExtractFairplayContentIdProcessed({
144
+ requestId,
145
+ contentId
146
+ });
147
+ } else {
148
+ const contentId = fairplaySkdUrl;
149
+ NativeModules.ContentProtectionModule.onExtractFairplayContentIdProcessed({
150
+ requestId,
151
+ contentId
152
+ });
153
+ }
154
+ });
155
+
156
+ this.emitter = new NativeEventEmitter(NativeModules.ContentProtectionModule);
157
+ this.emitter.addListener('onBuildIntegration', this.onBuildIntegrationRequest);
158
+ this.emitter.addListener('onCertificateRequest', this.onCertificateRequest);
159
+ this.emitter.addListener('onCertificateResponse', this.onCertificateResponse);
160
+ this.emitter.addListener('onLicenseRequest', this.onLicenseRequest);
161
+ this.emitter.addListener('onLicenseResponse', this.onLicenseResponse);
162
+ this.emitter.addListener('onExtractFairplayContentId', this.onExtractFairplayContentId);
163
+ }
164
+
165
+ registerContentProtectionIntegration(integrationId, keySystemId, integrationFactory) {
166
+ this.registeredFactories.push({
167
+ integrationId,
168
+ keySystemId,
169
+ integrationFactory
170
+ });
171
+ NativeModules.ContentProtectionModule.registerContentProtectionIntegration(integrationId, keySystemId);
172
+ }
173
+
174
+ getFactory(integrationId, keySystemId) {
175
+ var _this$registeredFacto;
176
+
177
+ return (_this$registeredFacto = this.registeredFactories.find(init => init.integrationId === integrationId && init.keySystemId === keySystemId)) === null || _this$registeredFacto === void 0 ? void 0 : _this$registeredFacto.integrationFactory;
178
+ }
179
+
180
+ getIntegration(integrationId, keySystemId) {
181
+ var _this$currentIntegrat, _this$currentIntegrat2, _this$currentIntegrat3;
182
+
183
+ 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;
184
+ }
185
+
186
+ }
187
+ export const ContentProtectionRegistry = new NativeContentProtectionRegistry();
188
+ //# sourceMappingURL=ContentProtectionRegistry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["NativeEventEmitter","NativeModules","fromNativeLicenseRequest","toNativeLicenseRequest","fromNativeLicenseResponse","toNativeLicenseResponseResult","fromNativeCertificateRequest","toNativeCertificateRequest","fromNativeCertificateResponse","toNativeCertificateResponseResult","isBufferSource","NativeContentProtectionRegistry","constructor","undefined","event","requestId","integrationId","keySystemId","drmConfig","console","log","factory","getFactory","currentIntegration","integration","build","ContentProtectionModule","onBuildProcessed","resultString","request","getIntegration","onCertificateRequest","result","nativeResponse","onCertificateRequestProcessedAsCertificate","modifiedNativeRequest","onCertificateRequestProcessedAsRequest","response","onCertificateResponse","responseResult","modifiedNativeResponse","onCertificateResponseProcessed","onLicenseRequest","onLicenseRequestProcessedAsLicense","onLicenseRequestProcessedAsRequest","onLicenseResponse","onLicenseResponseProcessed","fairplaySkdUrl","extractFairplayContentId","contentId","onExtractFairplayContentIdProcessed","emitter","addListener","onBuildIntegrationRequest","onExtractFairplayContentId","registerContentProtectionIntegration","integrationFactory","registeredFactories","push","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":";;AAGA,SAASA,kBAAT,EAA6BC,aAA7B,QAAkD,cAAlD;AAG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KO,kBAAL,kFAAyBN,WAAzB,MAAyCA,WAArG,6BACH,KAAKM,kBADF,2DACH,uBAAyBC,WADtB,GAEHX,SAFJ;EAGD;;AAhC0E;AA4I7E,OAAO,MAAMgD,yBAAyB,GAAG,IAAIlD,+BAAJ,EAAlC"}
@@ -0,0 +1,9 @@
1
+ import { registerContentProtectionIntegration } from 'theoplayer';
2
+ export class WebContentProtectionRegistry {
3
+ registerContentProtectionIntegration(integrationId, keySystem, integrationFactory) {
4
+ registerContentProtectionIntegration(integrationId, keySystem, integrationFactory);
5
+ }
6
+
7
+ }
8
+ export const ContentProtectionRegistry = new WebContentProtectionRegistry();
9
+ //# sourceMappingURL=ContentProtectionRegistry.web.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["registerContentProtectionIntegration","WebContentProtectionRegistry","integrationId","keySystem","integrationFactory","ContentProtectionRegistry"],"sources":["ContentProtectionRegistry.web.ts"],"sourcesContent":["import type { ContentProtectionAPI, ContentProtectionIntegrationFactory, KeySystemId } from 'react-native-theoplayer';\nimport { registerContentProtectionIntegration } from 'theoplayer';\n\nexport class WebContentProtectionRegistry implements ContentProtectionAPI {\n registerContentProtectionIntegration(integrationId: string, keySystem: KeySystemId, integrationFactory: ContentProtectionIntegrationFactory): void {\n registerContentProtectionIntegration(integrationId, keySystem, integrationFactory);\n }\n}\n\nexport const ContentProtectionRegistry = new WebContentProtectionRegistry();\n"],"mappings":"AACA,SAASA,oCAAT,QAAqD,YAArD;AAEA,OAAO,MAAMC,4BAAN,CAAmE;EACxED,oCAAoC,CAACE,aAAD,EAAwBC,SAAxB,EAAgDC,kBAAhD,EAA+G;IACjJJ,oCAAoC,CAACE,aAAD,EAAgBC,SAAhB,EAA2BC,kBAA3B,CAApC;EACD;;AAHuE;AAM1E,OAAO,MAAMC,yBAAyB,GAAG,IAAIJ,4BAAJ,EAAlC"}
@@ -0,0 +1,31 @@
1
+ import { fromBase64StringToUint8Array, fromUint8ArrayToBase64String } from 'react-native-theoplayer';
2
+ export function fromNativeCertificateRequest(request) {
3
+ const {
4
+ url,
5
+ method,
6
+ headers,
7
+ useCredentials,
8
+ base64body
9
+ } = request;
10
+ const body = base64body ? fromBase64StringToUint8Array(base64body) : null;
11
+ return {
12
+ url,
13
+ method,
14
+ headers,
15
+ useCredentials,
16
+ body
17
+ };
18
+ }
19
+ export function toNativeCertificateRequest(requestId, integrationId, keySystemId, request) {
20
+ return {
21
+ requestId,
22
+ integrationId,
23
+ keySystemId,
24
+ url: request.url,
25
+ method: request.method,
26
+ headers: request.headers,
27
+ useCredentials: request.useCredentials ?? false,
28
+ base64body: request.body ? fromUint8ArrayToBase64String(request.body) : null
29
+ };
30
+ }
31
+ //# sourceMappingURL=NativeCertificateRequest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["fromBase64StringToUint8Array","fromUint8ArrayToBase64String","fromNativeCertificateRequest","request","url","method","headers","useCredentials","base64body","body","toNativeCertificateRequest","requestId","integrationId","keySystemId"],"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,SAASA,4BAAT,EAAuCC,4BAAvC,QAA2E,yBAA3E;AAUA,OAAO,SAASC,4BAAT,CAAsCC,OAAtC,EAA6F;EAClG,MAAM;IAAEC,GAAF;IAAOC,MAAP;IAAeC,OAAf;IAAwBC,cAAxB;IAAwCC;EAAxC,IAAuDL,OAA7D;EACA,MAAMM,IAAI,GAAGD,UAAU,GAAGR,4BAA4B,CAACQ,UAAD,CAA/B,GAA8C,IAArE;EACA,OAAO;IACLJ,GADK;IAELC,MAFK;IAGLC,OAHK;IAILC,cAJK;IAKLE;EALK,CAAP;AAOD;AAED,OAAO,SAASC,0BAAT,CACLC,SADK,EAELC,aAFK,EAGLC,WAHK,EAILV,OAJK,EAKqB;EAC1B,OAAO;IACLQ,SADK;IAELC,aAFK;IAGLC,WAHK;IAILT,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,GAAeR,4BAA4B,CAACE,OAAO,CAACM,IAAT,CAA3C,GAA4D;EARnE,CAAP;AAUD"}
@@ -0,0 +1,30 @@
1
+ import { fromNativeCertificateRequest } from './NativeCertificateRequest';
2
+ import { fromBase64StringToUint8Array, fromUint8ArrayToBase64String } from 'react-native-theoplayer';
3
+ export function fromNativeCertificateResponse(response) {
4
+ const {
5
+ url,
6
+ status,
7
+ statusText,
8
+ headers,
9
+ base64body,
10
+ request
11
+ } = response;
12
+ const body = base64body ? fromBase64StringToUint8Array(base64body) : new Uint8Array();
13
+ return {
14
+ url,
15
+ status,
16
+ statusText,
17
+ headers,
18
+ body,
19
+ request: fromNativeCertificateRequest(request)
20
+ };
21
+ }
22
+ export function toNativeCertificateResponseResult(requestId, integrationId, keySystemId, response) {
23
+ return {
24
+ requestId,
25
+ integrationId,
26
+ keySystemId,
27
+ base64body: response ? fromUint8ArrayToBase64String(new Uint8Array(response)) : ''
28
+ };
29
+ }
30
+ //# sourceMappingURL=NativeCertificateResponse.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["fromNativeCertificateRequest","fromBase64StringToUint8Array","fromUint8ArrayToBase64String","fromNativeCertificateResponse","response","url","status","statusText","headers","base64body","request","body","Uint8Array","toNativeCertificateResponseResult","requestId","integrationId","keySystemId"],"sources":["NativeCertificateResponse.ts"],"sourcesContent":["import type { NativeContentProtectionEvent } from './NativeContentProtectionEvent';\nimport type { CertificateResponse } from 'react-native-theoplayer';\nimport type { NativeCertificateRequest } from './NativeCertificateRequest';\nimport { fromNativeCertificateRequest } from './NativeCertificateRequest';\nimport { fromBase64StringToUint8Array, fromUint8ArrayToBase64String } from 'react-native-theoplayer';\n\nexport interface NativeCertificateResponse extends NativeContentProtectionEvent {\n url: string;\n status: number;\n statusText: string;\n headers: { [headerName: string]: string };\n base64body: string;\n request: NativeCertificateRequest;\n}\n\nexport interface NativeCertificateResponseResult extends NativeContentProtectionEvent {\n base64body: string;\n}\n\nexport function fromNativeCertificateResponse(response: NativeCertificateResponse): CertificateResponse {\n const { url, status, statusText, headers, base64body, request } = response;\n const body = base64body ? fromBase64StringToUint8Array(base64body) : new Uint8Array();\n return {\n url,\n status,\n statusText,\n headers,\n body,\n request: fromNativeCertificateRequest(request),\n };\n}\n\nexport function toNativeCertificateResponseResult(\n requestId: string,\n integrationId: string,\n keySystemId: string,\n response: ArrayBuffer,\n): NativeCertificateResponseResult {\n return {\n requestId,\n integrationId,\n keySystemId,\n base64body: response ? fromUint8ArrayToBase64String(new Uint8Array(response)) : '',\n };\n}\n"],"mappings":"AAGA,SAASA,4BAAT,QAA6C,4BAA7C;AACA,SAASC,4BAAT,EAAuCC,4BAAvC,QAA2E,yBAA3E;AAeA,OAAO,SAASC,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,GAAGR,4BAA4B,CAACQ,UAAD,CAA/B,GAA8C,IAAIG,UAAJ,EAArE;EACA,OAAO;IACLP,GADK;IAELC,MAFK;IAGLC,UAHK;IAILC,OAJK;IAKLG,IALK;IAMLD,OAAO,EAAEV,4BAA4B,CAACU,OAAD;EANhC,CAAP;AAQD;AAED,OAAO,SAASG,iCAAT,CACLC,SADK,EAELC,aAFK,EAGLC,WAHK,EAILZ,QAJK,EAK4B;EACjC,OAAO;IACLU,SADK;IAELC,aAFK;IAGLC,WAHK;IAILP,UAAU,EAAEL,QAAQ,GAAGF,4BAA4B,CAAC,IAAIU,UAAJ,CAAeR,QAAf,CAAD,CAA/B,GAA4D;EAJ3E,CAAP;AAMD"}
@@ -0,0 +1,2 @@
1
+
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,34 @@
1
+ import { fromBase64StringToUint8Array, fromUint8ArrayToBase64String } from 'react-native-theoplayer';
2
+ export function fromNativeLicenseRequest(request) {
3
+ const {
4
+ url,
5
+ method,
6
+ headers,
7
+ useCredentials,
8
+ base64body,
9
+ fairplaySkdUrl
10
+ } = request;
11
+ const body = base64body ? fromBase64StringToUint8Array(base64body) : null;
12
+ return {
13
+ url,
14
+ method,
15
+ headers,
16
+ useCredentials,
17
+ body,
18
+ fairplaySkdUrl
19
+ };
20
+ }
21
+ export function toNativeLicenseRequest(requestId, integrationId, keySystemId, request) {
22
+ return {
23
+ requestId,
24
+ integrationId,
25
+ keySystemId,
26
+ url: request.url,
27
+ method: request.method,
28
+ headers: request.headers,
29
+ useCredentials: request.useCredentials ?? false,
30
+ base64body: request.body ? fromUint8ArrayToBase64String(request.body) : null,
31
+ fairplaySkdUrl: request.fairplaySkdUrl
32
+ };
33
+ }
34
+ //# sourceMappingURL=NativeLicenseRequest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["fromBase64StringToUint8Array","fromUint8ArrayToBase64String","fromNativeLicenseRequest","request","url","method","headers","useCredentials","base64body","fairplaySkdUrl","body","toNativeLicenseRequest","requestId","integrationId","keySystemId"],"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,SAASA,4BAAT,EAAuCC,4BAAvC,QAA2E,yBAA3E;AAWA,OAAO,SAASC,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,GAAGR,4BAA4B,CAACQ,UAAD,CAA/B,GAA8C,IAArE;EACA,OAAO;IACLJ,GADK;IAELC,MAFK;IAGLC,OAHK;IAILC,cAJK;IAKLG,IALK;IAMLD;EANK,CAAP;AAQD;AAED,OAAO,SAASE,sBAAT,CAAgCC,SAAhC,EAAmDC,aAAnD,EAA0EC,WAA1E,EAA+FX,OAA/F,EAA8I;EACnJ,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,CAACO,IAAR,GAAeT,4BAA4B,CAACE,OAAO,CAACO,IAAT,CAA3C,GAA4D,IARnE;IASLD,cAAc,EAAEN,OAAO,CAACM;EATnB,CAAP;AAWD"}
@@ -0,0 +1,30 @@
1
+ import { fromNativeLicenseRequest } from './NativeLicenseRequest';
2
+ import { fromBase64StringToUint8Array, fromUint8ArrayToBase64String } from 'react-native-theoplayer';
3
+ export function fromNativeLicenseResponse(response) {
4
+ const {
5
+ url,
6
+ status,
7
+ statusText,
8
+ headers,
9
+ base64body,
10
+ request
11
+ } = response;
12
+ const body = base64body ? fromBase64StringToUint8Array(base64body) : new Uint8Array();
13
+ return {
14
+ url,
15
+ status,
16
+ statusText,
17
+ headers,
18
+ body,
19
+ request: fromNativeLicenseRequest(request)
20
+ };
21
+ }
22
+ export function toNativeLicenseResponseResult(requestId, integrationId, keySystemId, response) {
23
+ return {
24
+ requestId,
25
+ integrationId,
26
+ keySystemId,
27
+ base64body: response ? fromUint8ArrayToBase64String(new Uint8Array(response)) : ''
28
+ };
29
+ }
30
+ //# sourceMappingURL=NativeLicenseResponse.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["fromNativeLicenseRequest","fromBase64StringToUint8Array","fromUint8ArrayToBase64String","fromNativeLicenseResponse","response","url","status","statusText","headers","base64body","request","body","Uint8Array","toNativeLicenseResponseResult","requestId","integrationId","keySystemId"],"sources":["NativeLicenseResponse.ts"],"sourcesContent":["import type { NativeContentProtectionEvent } from './NativeContentProtectionEvent';\nimport type { LicenseResponse } from 'react-native-theoplayer';\nimport type { NativeLicenseRequest } from './NativeLicenseRequest';\nimport { fromNativeLicenseRequest } from './NativeLicenseRequest';\nimport { fromBase64StringToUint8Array, fromUint8ArrayToBase64String } from 'react-native-theoplayer';\n\nexport interface NativeLicenseResponse extends NativeContentProtectionEvent {\n url: string;\n status: number;\n statusText: string;\n headers: { [headerName: string]: string };\n base64body: string;\n request: NativeLicenseRequest;\n}\n\nexport interface NativeLicenseResponseResult extends NativeContentProtectionEvent {\n base64body: string;\n}\n\nexport function fromNativeLicenseResponse(response: NativeLicenseResponse): LicenseResponse {\n const { url, status, statusText, headers, base64body, request } = response;\n const body = base64body ? fromBase64StringToUint8Array(base64body) : new Uint8Array();\n return {\n url,\n status,\n statusText,\n headers,\n body,\n request: fromNativeLicenseRequest(request),\n };\n}\n\nexport function toNativeLicenseResponseResult(\n requestId: string,\n integrationId: string,\n keySystemId: string,\n response: ArrayBuffer,\n): NativeLicenseResponseResult {\n return {\n requestId,\n integrationId,\n keySystemId,\n base64body: response ? fromUint8ArrayToBase64String(new Uint8Array(response)) : '',\n };\n}\n"],"mappings":"AAGA,SAASA,wBAAT,QAAyC,wBAAzC;AACA,SAASC,4BAAT,EAAuCC,4BAAvC,QAA2E,yBAA3E;AAeA,OAAO,SAASC,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,GAAGR,4BAA4B,CAACQ,UAAD,CAA/B,GAA8C,IAAIG,UAAJ,EAArE;EACA,OAAO;IACLP,GADK;IAELC,MAFK;IAGLC,UAHK;IAILC,OAJK;IAKLG,IALK;IAMLD,OAAO,EAAEV,wBAAwB,CAACU,OAAD;EAN5B,CAAP;AAQD;AAED,OAAO,SAASG,6BAAT,CACLC,SADK,EAELC,aAFK,EAGLC,WAHK,EAILZ,QAJK,EAKwB;EAC7B,OAAO;IACLU,SADK;IAELC,aAFK;IAGLC,WAHK;IAILP,UAAU,EAAEL,QAAQ,GAAGF,4BAA4B,CAAC,IAAIU,UAAJ,CAAeR,QAAf,CAAD,CAA/B,GAA4D;EAJ3E,CAAP;AAMD"}
@@ -0,0 +1,24 @@
1
+ const NAN_VALUE = -1;
2
+ const POS_INF_VALUE = -2; // We can't send INF and NaN values over the bridge, so convert if necessary.
3
+
4
+ export function decodeNanInf(v) {
5
+ if (v === NAN_VALUE) {
6
+ return NaN;
7
+ }
8
+
9
+ if (v === POS_INF_VALUE) {
10
+ return Infinity;
11
+ }
12
+
13
+ return v;
14
+ }
15
+ export const objectToString = {}.toString;
16
+ const viewClasses = ['[object Int8Array]', '[object Uint8Array]', '[object Uint8ClampedArray]', '[object Int16Array]', '[object Uint16Array]', '[object Int32Array]', '[object Uint32Array]', '[object Float32Array]', '[object Float64Array]', '[object DataView]'];
17
+ export function arrayContainsElement_(array, element) {
18
+ return array.indexOf(element) !== -1;
19
+ }
20
+ export const isArrayBufferView_ = ArrayBuffer.isView || (obj => obj && arrayContainsElement_(viewClasses, objectToString.call(obj)));
21
+ export function isBufferSource(bufferSource) {
22
+ return bufferSource instanceof ArrayBuffer || isArrayBufferView_(bufferSource);
23
+ }
24
+ //# 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;;AACA,OAAO,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;AAED,OAAO,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;AAaA,OAAO,SAASC,qBAAT,CAAkCC,KAAlC,EAA2DC,OAA3D,EAAgF;EACrF,OAAOD,KAAK,CAACE,OAAN,CAAcD,OAAd,MAA2B,CAAC,CAAnC;AACD;AAED,OAAO,MAAME,kBAA6C,GACxDC,WAAW,CAACC,MAAZ,KAAwBC,GAAD,IAASA,GAAG,IAAIP,qBAAqB,CAACD,WAAD,EAAcF,cAAc,CAACW,IAAf,CAAoBD,GAApB,CAAd,CAA5D,CADK;AAGP,OAAO,SAASE,cAAT,CAAwBC,YAAxB,EAAyE;EAC9E,OAAOA,YAAY,YAAYL,WAAxB,IAAuCD,kBAAkB,CAACM,YAAD,CAAhE;AACD"}
@@ -54,4 +54,19 @@ export function fromNativeMediaTrack(track) {
54
54
  targetQuality
55
55
  };
56
56
  }
57
+ export function findNativeQualityByUid(mediaTrack, uid) {
58
+ return mediaTrack.qualities.find(quality => quality.uid === uid);
59
+ }
60
+ export function findNativeQualitiesByUid(mediaTrack, uid) {
61
+ if (uid && mediaTrack) {
62
+ if (Array.isArray(uid)) {
63
+ return mediaTrack.qualities.filter(quality => uid.includes(quality.uid));
64
+ } else {
65
+ const quality = findNativeQualityByUid(mediaTrack, uid);
66
+ return quality ? [quality] : undefined;
67
+ }
68
+ }
69
+
70
+ return undefined;
71
+ }
57
72
  //# 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":"AAGA,OAAO,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;AAED,OAAO,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;AAED,OAAO,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":"AAQA,OAAO,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;AAED,OAAO,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;AAED,OAAO,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,CA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