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
@@ -3,13 +3,7 @@
3
3
  import Foundation
4
4
  import THEOplayerSDK
5
5
 
6
- let ADD_TRACK: Int = 0
7
- let REMOVE_TRACK: Int = 1
8
- let ADD_CUE: Int = 0
9
- let REMOVE_CUE: Int = 1
10
-
11
-
12
- class THEOplayerRCTViewEventHandler {
6
+ class THEOplayerRCTViewMainEventHandler {
13
7
  // MARK: Members
14
8
  private weak var player: THEOplayer?
15
9
  private var currentPresentationMode = THEOplayerSDK.PresentationMode.inline // TheoPlayer's initial presentationMode
@@ -34,8 +28,6 @@ class THEOplayerRCTViewEventHandler {
34
28
  var onNativeFullscreenPlayerDidPresent: RCTDirectEventBlock?
35
29
  var onNativeFullscreenPlayerWillDismiss: RCTDirectEventBlock?
36
30
  var onNativeFullscreenPlayerDidDismiss: RCTDirectEventBlock?
37
- var onNativeTextTrackListEvent: RCTDirectEventBlock?
38
- var onNativeTextTrackEvent: RCTDirectEventBlock?
39
31
 
40
32
  // MARK: player Listeners
41
33
  private var playListener: EventListener?
@@ -55,15 +47,6 @@ class THEOplayerRCTViewEventHandler {
55
47
  private var loadedMetadataListener: EventListener?
56
48
  private var presentationModeChangeListener: EventListener?
57
49
 
58
- // MARK: textTrackList Listeners
59
- private var addTrackListener: EventListener?
60
- private var removeTrackListener: EventListener?
61
-
62
- // MARK: textTrack listeners (attached dynamically to new texttracks)
63
- private var addCueListeners: [Int:EventListener] = [:]
64
- private var removeCueListeners: [Int:EventListener] = [:]
65
-
66
-
67
50
  // MARK: - destruction
68
51
  func destroy() {
69
52
  // dettach listeners
@@ -79,17 +62,15 @@ class THEOplayerRCTViewEventHandler {
79
62
  }
80
63
 
81
64
  private func attachListeners() {
82
- self.attachPlayerListeners()
83
- self.attachTextTrackListListeners()
65
+ self.attachMainPlayerListeners()
84
66
  }
85
67
 
86
68
  private func dettachListeners() {
87
- self.dettachPlayerListeners()
88
- self.dettachTextTrackListListeners()
69
+ self.dettachMainPlayerListeners()
89
70
  }
90
71
 
91
- // MARK: - attach/dettach player Listeners
92
- private func attachPlayerListeners() {
72
+ // MARK: - attach/dettach main player Listeners
73
+ private func attachMainPlayerListeners() {
93
74
  guard let player = self.player else {
94
75
  return
95
76
  }
@@ -145,7 +126,7 @@ class THEOplayerRCTViewEventHandler {
145
126
  if let forwardedDurationChangeEvent = self?.onNativeDurationChange {
146
127
  forwardedDurationChangeEvent(
147
128
  [
148
- "duration": (event.duration ?? 0.0) * 1000 // sec -> msec
129
+ "duration": THEOplayerRCTTypeUtils.encodeInfNan((event.duration ?? Double.nan) * 1000) // sec -> msec
149
130
  ]
150
131
  )
151
132
  }
@@ -296,7 +277,7 @@ class THEOplayerRCTViewEventHandler {
296
277
  if DEBUG_EVENTHANDLER { print("[NATIVE] PresentationModeChange listener attached to THEOplayer") }
297
278
  }
298
279
 
299
- private func dettachPlayerListeners() {
280
+ private func dettachMainPlayerListeners() {
300
281
  guard let player = self.player else {
301
282
  return
302
283
  }
@@ -397,97 +378,4 @@ class THEOplayerRCTViewEventHandler {
397
378
  if DEBUG_EVENTHANDLER { print("[NATIVE] PresentationModeChange listener dettached from THEOplayer") }
398
379
  }
399
380
  }
400
-
401
- // MARK: - attach/dettach textTrackList Listeners
402
- private func attachTextTrackListListeners() {
403
- guard let player = self.player else {
404
- return
405
- }
406
-
407
- // ADD_TRACK
408
- self.addTrackListener = player.textTracks.addEventListener(type: TextTrackListEventTypes.ADD_TRACK) { [weak self] event in
409
- guard let welf = self else { return }
410
- if let forwardedTextTrackListEvent = welf.onNativeTextTrackListEvent,
411
- let textTrack = event.track as? TextTrack {
412
- if DEBUG_THEOPLAYER_EVENTS { print("[NATIVE] Received ADD_TRACK event from THEOplayer textTrack list: trackUid = \(textTrack.uid)") }
413
- // trigger tracklist event
414
- forwardedTextTrackListEvent([
415
- "track" : THEOplayerRCTMetadataAggregator.aggregatedTextTrackInfo(textTrack: textTrack),
416
- "type" : ADD_TRACK
417
- ])
418
- // start listening for cue events on this track and keep listener for later removal
419
- welf.addCueListeners[textTrack.uid] = textTrack.addEventListener(type: TextTrackEventTypes.ADD_CUE, listener: welf.addCueListener(_:))
420
- if DEBUG_EVENTHANDLER { print("[NATIVE] AddCue listener attached to THEOplayer textTrack with uid \(textTrack.uid)") }
421
- welf.removeCueListeners[textTrack.uid] = textTrack.addEventListener(type: TextTrackEventTypes.REMOVE_CUE, listener: welf.removeCueListener(_:))
422
- if DEBUG_EVENTHANDLER { print("[NATIVE] RemoveCue listener attached to THEOplayer textTrack with uid \(textTrack.uid)") }
423
- }
424
- }
425
- if DEBUG_EVENTHANDLER { print("[NATIVE] AddTrack listener attached to THEOplayer textTrack list") }
426
-
427
- // REMOVE_TRACK
428
- self.removeTrackListener = player.textTracks.addEventListener(type: TextTrackListEventTypes.REMOVE_TRACK) { [weak self] event in
429
- guard let welf = self else { return }
430
- if let forwardedTextTrackListEvent = welf.onNativeTextTrackListEvent,
431
- let textTrack = event.track as? TextTrack {
432
- if DEBUG_THEOPLAYER_EVENTS { print("[NATIVE] Received REMOVE_TRACK event from THEOplayer textTrack list: trackUid = \(textTrack.uid)") }
433
- // trigger tracklist event
434
- forwardedTextTrackListEvent([
435
- "track" : THEOplayerRCTMetadataAggregator.aggregatedTextTrackInfo(textTrack: textTrack),
436
- "type" : REMOVE_TRACK
437
- ])
438
- // stop listening for cue events on this track
439
- if let addCueListener = welf.addCueListeners[textTrack.uid],
440
- let removeCueListener = welf.removeCueListeners[textTrack.uid]{
441
- textTrack.removeEventListener(type: TextTrackEventTypes.ADD_CUE, listener: addCueListener)
442
- if DEBUG_EVENTHANDLER { print("[NATIVE] AddCue listener removed from THEOplayer textTrack with uid \(textTrack.uid)") }
443
- textTrack.removeEventListener(type: TextTrackEventTypes.REMOVE_CUE, listener: removeCueListener)
444
- if DEBUG_EVENTHANDLER { print("[NATIVE] RemoveCue listener removed from THEOplayer textTrack with uid \(textTrack.uid)") }
445
- }
446
- }
447
- }
448
- if DEBUG_EVENTHANDLER { print("[NATIVE] RemoveTrack listener attached to THEOplayer textTrack list") }
449
- }
450
-
451
- private func dettachTextTrackListListeners() {
452
- guard let player = self.player else {
453
- return
454
- }
455
-
456
- // ADD_TRACK
457
- if let addTrackListener = self.addTrackListener {
458
- player.textTracks.removeEventListener(type: TextTrackListEventTypes.ADD_TRACK, listener: addTrackListener)
459
- if DEBUG_EVENTHANDLER { print("[NATIVE] AddTrack listener dettached from THEOplayer textTrack list") }
460
- }
461
-
462
- // REMOVE_TRACK
463
- if let removeTrackListener = self.removeTrackListener {
464
- player.textTracks.removeEventListener(type: TextTrackListEventTypes.REMOVE_TRACK, listener: removeTrackListener)
465
- if DEBUG_EVENTHANDLER { print("[NATIVE] RemoveTrack listener dettached from THEOplayer textTrack list") }
466
- }
467
- }
468
-
469
- // MARK: - dynamic textTrack Listeners
470
- private func addCueListener(_ event: AddCueEvent) {
471
- if let forwardedTextTrackEvent = self.onNativeTextTrackEvent,
472
- let textTrack = event.cue.track {
473
- if DEBUG_THEOPLAYER_EVENTS { print("[NATIVE] Received ADD_CUE event from textTrack: trackUid = \(textTrack.uid), cueUid = \(event.cue.uid)") }
474
- forwardedTextTrackEvent([
475
- "trackUid" : textTrack.uid,
476
- "type": ADD_CUE,
477
- "cue": THEOplayerRCTMetadataAggregator.aggregatedTextTrackCueInfo(textTrackCue: event.cue)
478
- ])
479
- }
480
- }
481
-
482
- private func removeCueListener(_ event: RemoveCueEvent) {
483
- if let forwardedTextTrackEvent = self.onNativeTextTrackEvent,
484
- let textTrack = event.cue.track {
485
- if DEBUG_THEOPLAYER_EVENTS { print("[NATIVE] Received REMOVE_CUE event from textTrack: trackUid = \(textTrack.uid), cueUid = \(event.cue.uid)") }
486
- forwardedTextTrackEvent([
487
- "trackUid" : textTrack.uid,
488
- "type": REMOVE_CUE,
489
- "cue": THEOplayerRCTMetadataAggregator.aggregatedTextTrackCueInfo(textTrackCue: event.cue)
490
- ])
491
- }
492
- }
493
381
  }
@@ -0,0 +1,134 @@
1
+ // THEOplayerRCTViewTextTrackEventHandler.swift
2
+
3
+ import Foundation
4
+ import THEOplayerSDK
5
+
6
+ let ADD_TRACK: Int = 0
7
+ let REMOVE_TRACK: Int = 1
8
+ let ADD_CUE: Int = 0
9
+ let REMOVE_CUE: Int = 1
10
+
11
+ class THEOplayerRCTViewTextTrackEventHandler {
12
+ // MARK: Members
13
+ private weak var player: THEOplayer?
14
+
15
+ // MARK: Events
16
+ var onNativeTextTrackListEvent: RCTDirectEventBlock?
17
+ var onNativeTextTrackEvent: RCTDirectEventBlock?
18
+
19
+ // MARK: textTrackList Listeners
20
+ private var addTrackListener: EventListener?
21
+ private var removeTrackListener: EventListener?
22
+
23
+ // MARK: textTrack listeners (attached dynamically to new texttracks)
24
+ private var addCueListeners: [Int:EventListener] = [:]
25
+ private var removeCueListeners: [Int:EventListener] = [:]
26
+
27
+
28
+ // MARK: - destruction
29
+ func destroy() {
30
+ // dettach listeners
31
+ self.dettachListeners()
32
+ }
33
+
34
+ // MARK: - player setup / breakdown
35
+ func setPlayer(_ player: THEOplayer) {
36
+ self.player = player;
37
+
38
+ // attach listeners
39
+ self.attachListeners()
40
+ }
41
+
42
+ // MARK: - attach/dettach textTrackList Listeners
43
+ private func attachListeners() {
44
+ guard let player = self.player else {
45
+ return
46
+ }
47
+
48
+ // ADD_TRACK
49
+ self.addTrackListener = player.textTracks.addEventListener(type: TextTrackListEventTypes.ADD_TRACK) { [weak self] event in
50
+ guard let welf = self else { return }
51
+ if let forwardedTextTrackListEvent = welf.onNativeTextTrackListEvent,
52
+ let textTrack = event.track as? TextTrack {
53
+ if DEBUG_THEOPLAYER_EVENTS { print("[NATIVE] Received ADD_TRACK event from THEOplayer textTrack list: trackUid = \(textTrack.uid)") }
54
+ // trigger tracklist event
55
+ forwardedTextTrackListEvent([
56
+ "track" : THEOplayerRCTMetadataAggregator.aggregatedTextTrackInfo(textTrack: textTrack),
57
+ "type" : ADD_TRACK
58
+ ])
59
+ // start listening for cue events on this track and keep listener for later removal
60
+ welf.addCueListeners[textTrack.uid] = textTrack.addEventListener(type: TextTrackEventTypes.ADD_CUE, listener: welf.addCueListener(_:))
61
+ if DEBUG_EVENTHANDLER { print("[NATIVE] AddCue listener attached to THEOplayer textTrack with uid \(textTrack.uid)") }
62
+ welf.removeCueListeners[textTrack.uid] = textTrack.addEventListener(type: TextTrackEventTypes.REMOVE_CUE, listener: welf.removeCueListener(_:))
63
+ if DEBUG_EVENTHANDLER { print("[NATIVE] RemoveCue listener attached to THEOplayer textTrack with uid \(textTrack.uid)") }
64
+ }
65
+ }
66
+ if DEBUG_EVENTHANDLER { print("[NATIVE] AddTrack listener attached to THEOplayer textTrack list") }
67
+
68
+ // REMOVE_TRACK
69
+ self.removeTrackListener = player.textTracks.addEventListener(type: TextTrackListEventTypes.REMOVE_TRACK) { [weak self] event in
70
+ guard let welf = self else { return }
71
+ if let forwardedTextTrackListEvent = welf.onNativeTextTrackListEvent,
72
+ let textTrack = event.track as? TextTrack {
73
+ if DEBUG_THEOPLAYER_EVENTS { print("[NATIVE] Received REMOVE_TRACK event from THEOplayer textTrack list: trackUid = \(textTrack.uid)") }
74
+ // trigger tracklist event
75
+ forwardedTextTrackListEvent([
76
+ "track" : THEOplayerRCTMetadataAggregator.aggregatedTextTrackInfo(textTrack: textTrack),
77
+ "type" : REMOVE_TRACK
78
+ ])
79
+ // stop listening for cue events on this track
80
+ if let addCueListener = welf.addCueListeners[textTrack.uid],
81
+ let removeCueListener = welf.removeCueListeners[textTrack.uid]{
82
+ textTrack.removeEventListener(type: TextTrackEventTypes.ADD_CUE, listener: addCueListener)
83
+ if DEBUG_EVENTHANDLER { print("[NATIVE] AddCue listener removed from THEOplayer textTrack with uid \(textTrack.uid)") }
84
+ textTrack.removeEventListener(type: TextTrackEventTypes.REMOVE_CUE, listener: removeCueListener)
85
+ if DEBUG_EVENTHANDLER { print("[NATIVE] RemoveCue listener removed from THEOplayer textTrack with uid \(textTrack.uid)") }
86
+ }
87
+ }
88
+ }
89
+ if DEBUG_EVENTHANDLER { print("[NATIVE] RemoveTrack listener attached to THEOplayer textTrack list") }
90
+ }
91
+
92
+ private func dettachListeners() {
93
+ guard let player = self.player else {
94
+ return
95
+ }
96
+
97
+ // ADD_TRACK
98
+ if let addTrackListener = self.addTrackListener {
99
+ player.textTracks.removeEventListener(type: TextTrackListEventTypes.ADD_TRACK, listener: addTrackListener)
100
+ if DEBUG_EVENTHANDLER { print("[NATIVE] AddTrack listener dettached from THEOplayer textTrack list") }
101
+ }
102
+
103
+ // REMOVE_TRACK
104
+ if let removeTrackListener = self.removeTrackListener {
105
+ player.textTracks.removeEventListener(type: TextTrackListEventTypes.REMOVE_TRACK, listener: removeTrackListener)
106
+ if DEBUG_EVENTHANDLER { print("[NATIVE] RemoveTrack listener dettached from THEOplayer textTrack list") }
107
+ }
108
+ }
109
+
110
+ // MARK: - dynamic textTrack Listeners
111
+ private func addCueListener(_ event: AddCueEvent) {
112
+ if let forwardedTextTrackEvent = self.onNativeTextTrackEvent,
113
+ let textTrack = event.cue.track {
114
+ if DEBUG_THEOPLAYER_EVENTS { print("[NATIVE] Received ADD_CUE event from textTrack: trackUid = \(textTrack.uid), cueUid = \(event.cue.uid)") }
115
+ forwardedTextTrackEvent([
116
+ "trackUid" : textTrack.uid,
117
+ "type": ADD_CUE,
118
+ "cue": THEOplayerRCTMetadataAggregator.aggregatedTextTrackCueInfo(textTrackCue: event.cue)
119
+ ])
120
+ }
121
+ }
122
+
123
+ private func removeCueListener(_ event: RemoveCueEvent) {
124
+ if let forwardedTextTrackEvent = self.onNativeTextTrackEvent,
125
+ let textTrack = event.cue.track {
126
+ if DEBUG_THEOPLAYER_EVENTS { print("[NATIVE] Received REMOVE_CUE event from textTrack: trackUid = \(textTrack.uid), cueUid = \(event.cue.uid)") }
127
+ forwardedTextTrackEvent([
128
+ "trackUid" : textTrack.uid,
129
+ "type": REMOVE_CUE,
130
+ "cue": THEOplayerRCTMetadataAggregator.aggregatedTextTrackCueInfo(textTrackCue: event.cue)
131
+ ])
132
+ }
133
+ }
134
+ }
@@ -3,4 +3,6 @@
3
3
  //
4
4
 
5
5
  #import <React/RCTViewManager.h>
6
- #import "React/RCTUIManager.h"
6
+ #import <React/RCTUIManager.h>
7
+ #import <React/RCTBridgeModule.h>
8
+ #import <React/RCTEventEmitter.h>
@@ -0,0 +1,2 @@
1
+ When using a custom THEO portal build, move the downloaded xcframework for iOS to this folder.
2
+ You can also use a different folder structure. In that case make sure to update ../../react-native-theoplayer_custom_ios.podspec to reflect to the correct xcframework paths, before you copy it over the original podspec
@@ -0,0 +1,36 @@
1
+ require "json"
2
+
3
+ package = JSON.parse(File.read(File.join(__dir__, "package.json")))
4
+
5
+ ### Collect player feature flags
6
+ theo_features_ios = `sh ./ios/custom/theofeatures.sh ios ./ios/custom/Frameworks/ios/`
7
+
8
+ Pod::Spec.new do |s|
9
+ s.name = "react-native-theoplayer"
10
+ s.version = package["version"]
11
+ s.summary = package["description"]
12
+ s.homepage = package["homepage"]
13
+ s.license = package["license"]
14
+ s.authors = package["author"]
15
+
16
+ s.platforms = { :ios => "11.0", :tvos => "12.0" }
17
+ s.source = { :git => "https://www.theoplayer.com/.git", :tag => "#{s.version}" }
18
+
19
+ s.source_files = "ios/**/*.{h,m,mm,swift}"
20
+ s.resources = ['ios/**/*.css']
21
+
22
+ s.dependency "React-Core"
23
+
24
+ ### Pass feature flags
25
+ s.ios.pod_target_xcconfig = {
26
+ 'SWIFT_ACTIVE_COMPILATION_CONDITIONS[config=Release]' => "#{theo_features_ios}",
27
+ 'SWIFT_ACTIVE_COMPILATION_CONDITIONS[config=Debug]' => "DEBUG #{theo_features_ios}"
28
+ }
29
+
30
+ ### Set custom player SDK
31
+ s.ios.vendored_frameworks = "ios/custom/Frameworks/ios/THEOplayerSDK.xcframework"
32
+
33
+ ### Add external dependencies
34
+ s.ios.dependency "GoogleAds-IMA-iOS-SDK"
35
+
36
+ end
@@ -0,0 +1,14 @@
1
+ #!/bin/bash
2
+ platform=$1
3
+ framework_path=$2
4
+ infoplist_path="${framework_path}THEOplayerSDK.xcframework/${platform}-arm64/THEOplayerSDK.framework/Info.plist"
5
+ all_features=""
6
+
7
+ info=$(/usr/libexec/PlistBuddy -c "Print :\"THEOplayer build information\":Features" "${infoplist_path}")
8
+ IFS=',' read -ra arrInfo <<< "$info"
9
+ for i in "${arrInfo[@]}"; do
10
+ feature=$(echo $i | tr '[:lower:]' '[:upper:]' | tr '-' '_')
11
+ all_features="${all_features} ${feature}"
12
+ done
13
+
14
+ echo "$all_features"
@@ -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
+ "use strict";
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":""}
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+
7
+ var _ABRConfiguration = require("./ABRConfiguration");
8
+
9
+ Object.keys(_ABRConfiguration).forEach(function (key) {
10
+ if (key === "default" || key === "__esModule") return;
11
+ if (key in exports && exports[key] === _ABRConfiguration[key]) return;
12
+ Object.defineProperty(exports, key, {
13
+ enumerable: true,
14
+ get: function () {
15
+ return _ABRConfiguration[key];
16
+ }
17
+ });
18
+ });
19
+ //# sourceMappingURL=barrel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["barrel.ts"],"sourcesContent":["export * from './ABRConfiguration';\n"],"mappings":";;;;;;AAAA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ //# sourceMappingURL=Ad.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["Ad.ts"],"sourcesContent":["/**\n * Represents a VAST creative. It is either a linear or non-linear ad.\n *\n * @public\n */\nimport type { AdBreak } from './AdBreak';\nimport type { CompanionAd } from 'theoplayer';\n\nexport interface Ad {\n /**\n * The source ad server information included in the ad response.\n *\n * @remarks\n * <br/> - Available when the {@link Ad.readyState} is `'ready'`.\n */\n adSystem: string | undefined;\n\n /**\n * The integration of the ad, represented by a value from the following list:\n * <br/> - `'theo'`\n * <br/> - `'google-ima'`\n * <br/> - `'google-dai'`\n * <br/> - `'freewheel'`\n *\n * @defaultValue `'theo'`\n */\n integration?: string;\n\n /**\n * The type of the ad, represented by a value from the following list:\n * <br/> - `'linear'`\n * <br/> - `'nonlinear'`\n */\n type: string;\n\n /**\n * The identifier of the creative.\n *\n * @remarks\n * <br/> - Available when the {@link Ad.readyState} is `'ready'`.\n */\n id: string | undefined;\n\n /**\n * The ready state of the ad.\n */\n readyState?: AdReadyState;\n\n /**\n * The ad break which the ad is part of.\n *\n * @remarks\n * <br/> - Available for VAST-ads.\n */\n adBreak: AdBreak;\n\n /**\n * The duration of the ad, in seconds.\n *\n * @remarks\n * <br/> - Available when the {@link Ad.readyState} is `'ready'`.\n * <br/> - Only available for LinearAd.\n */\n duration?: number;\n\n /**\n * The width of the ad, in pixels.\n *\n * @remarks\n * <br/> - Available when the {@link Ad.readyState} is `'ready'`.\n */\n width: number | undefined;\n\n /**\n * The height of the ad.\n *\n * @remarks\n * <br/> - Available when the {@link Ad.readyState} is `'ready'`.\n */\n height: number | undefined;\n\n /**\n * The URI of the the ad content.\n *\n * @remarks\n * <br/> - Available when the {@link Ad.readyState} is `'ready'`.\n */\n resourceURI?: string;\n\n /**\n * The website of the advertisement.\n *\n * @remarks\n * <br/> - Available when the {@link Ad.readyState} is `'ready'`.\n */\n clickThrough: string | undefined;\n\n /**\n * List of companions which can be displayed outside the player.\n *\n * @remarks\n * <br/> - Available when the {@link Ad.readyState} is `'ready'`.\n * <br/> - Only supported for `'theo'` and `'google-dai'`.\n */\n companions: CompanionAd[];\n\n /**\n * Offset after which the ad break may be skipped, in seconds.\n *\n * @remarks\n * <br/> - Available when the {@link Ad.readyState} is `'ready'`.\n * <br/> - If the offset is -1, the ad is unskippable.\n * <br/> - If the offset is 0, the ad is immediately skippable.\n * <br/> - Otherwise it must be a positive number indicating the offset.\n */\n skipOffset: number | undefined;\n\n /**\n * The identifier of the selected creative for the ad.\n *\n * @remarks\n * <br/> - Available when the {@link Ad.readyState} is `'ready'`.\n */\n creativeId: string | undefined;\n\n /**\n * The list of universal ad ID information of the selected creative for the ad.\n *\n * @remarks\n * <br/> - Only supported for `'theo'` and `'google-ima'`.\n */\n universalAdIds: UniversalAdId[];\n}\n\n/**\n * The ad readiness state, represented by a value from the following list:\n * <br/> - `'none'`: The ad not loaded state.\n * <br/> - `'ready'`: The ad loaded state.\n *\n * @remarks\n * <br/> - An ad is loaded when the ad resource (e.g. VAST file) is downloaded.\n * <br/> - another remark\n *\n * @public\n */\nexport type AdReadyState = 'none' | 'ready';\n\n/**\n * Represents the information regarding the universal identifier of an ad.\n *\n * @public\n */\nexport interface UniversalAdId {\n /**\n * The registry associated with cataloging the UniversalAdId of the selected creative for the ad.\n *\n * @remarks\n * <br/> - Returns the registry value, or 'unknown' if unavailable.\n */\n adIdRegistry: string;\n\n /**\n * The UniversalAdId of the selected creative for the ad.\n *\n * @remarks\n * <br/> - Returns the id value or 'unknown' if unavailable.\n */\n adIdValue: string;\n}\n\n/**\n * Represents a non-linear ad in the VAST specification.\n *\n * @public\n */\nexport interface NonLinearAd extends Ad {\n /**\n * The alternative description for the ad.\n *\n * @remarks\n * <br/> - Available when the {@link Ad.readyState} is `'ready'`.\n */\n altText: string | undefined;\n\n /**\n * The website of the ad.\n *\n * @remarks\n * <br/> - Available when the {@link Ad.readyState} is `'ready'`.\n */\n clickThrough: string | undefined;\n\n /**\n * The HTML-string with the content of the ad.\n *\n * @remarks\n * <br/> - Available when the {@link Ad.readyState} is `'ready'`.\n */\n contentHTML: string | undefined;\n}\n\n/**\n * The delivery type of the ad content file, represented by a value from the following list:\n * <br/> - `'progressive'`: Delivered through progressive download protocols (e.g. HTTP).\n * <br/> - `'streaming'`: Delivered through streaming download protocols.\n *\n * @remarks\n * <br/> - `'streaming'` is currently not supported.\n *\n * @public\n */\nexport type DeliveryType = 'progressive' | 'streaming';\n\n/**\n * Represents metadata of an media file with ad content.\n *\n * @remarks\n * <br/> - This metadata is retrieved from the VAST file.\n *\n * @public\n */\nexport interface MediaFile {\n /**\n * The delivery type of the video file.\n */\n delivery: DeliveryType;\n\n /**\n * The MIME type for the file container.\n */\n type: string;\n\n /**\n * The native width of the video file, in pixels.\n */\n width: number;\n\n /**\n * The native height of the video file, in pixels.\n */\n height: number;\n\n /**\n * The URI of the VAST content.\n */\n contentURL: string;\n}\n\n/**\n * Represents a linear ad in the VAST specification.\n *\n * @public\n */\nexport interface LinearAd extends Ad {\n /**\n * The duration of the ad, in seconds.\n *\n * @remarks\n * <br/> - Available when the {@link Ad.readyState} is `'ready'`.\n */\n duration: number;\n\n /**\n * List of media files which contain metadata about ad video files.\n */\n mediaFiles: MediaFile[];\n}\n"],"mappings":""}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ //# sourceMappingURL=AdBreak.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["AdBreak.ts"],"sourcesContent":["/**\n * Represents an ad break in the VMAP specification or an ad pod in the VAST specification.\n *\n * @public\n */\nimport type { Ad } from './Ad';\n\nexport interface AdBreak {\n /**\n * The integration of the ad break, represented by a value from the following list:\n * <br/> - `'theo'`\n * <br/> - `'google-ima'`\n * <br/> - `'google-dai'`\n * <br/> - `'freewheel'`\n */\n integration: string | undefined;\n\n /**\n * List of ads which will be played sequentially at the ad break's time offset.\n */\n ads: Ad[] | undefined;\n\n /**\n * The time offset at which content will be paused to play the ad break, in seconds.\n */\n timeOffset: number;\n\n /**\n * The duration of the ad break, in seconds.\n *\n * @remarks\n * <br/> - Ads are lazily loaded. This property becomes available when all ads are loaded.\n */\n maxDuration: number | undefined;\n\n /**\n * The remaining duration of the ad break, in seconds.\n *\n * @remarks\n * <br/> - Ads are lazily loaded. This property becomes available when all ads are loaded.\n * <br/> - This feature is not available in the Google IMA integration and will default to -1.\n */\n maxRemainingDuration: number | undefined;\n}\n"],"mappings":""}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ //# sourceMappingURL=AdsAPI.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["AdsAPI.ts"],"sourcesContent":["/**\n * The API for advertisements.\n */\nimport type { AdDescription } from \"../source/ads/Ads\";\nimport type { AdBreak } from \"./AdBreak\";\nimport type { Ad } from \"./Ad\";\nimport type { GoogleDAI } from \"./GoogleDai\";\n\nexport interface AdsAPI {\n /**\n * Whether a linear ad is currently playing.\n */\n playing(): Promise<boolean>;\n\n /**\n * Skip the current linear ad.\n *\n * @remarks\n * <br/> - This will have no effect when the current linear ad is (not yet) skippable.\n */\n skip(): void;\n\n /**\n * The currently playing ad break.\n */\n currentAdBreak(): Promise<AdBreak>;\n\n /**\n * List of currently playing ads.\n */\n currentAds(): Promise<Ad[]>;\n\n /**\n * List of ad breaks which still need to be played.\n */\n scheduledAdBreaks(): Promise<AdBreak[]>;\n\n /**\n * Add an ad break request.\n *\n * @remarks\n * <br/> - Prefer scheduling ad breaks up front through SourceConfiguration.ads.\n */\n schedule(ad: AdDescription): void;\n\n /**\n * The Google DAI API.\n *\n * @remarks\n * <br/> - Only available when the feature or extension `'google-dai'` is enabled.\n */\n readonly dai?: GoogleDAI;\n}\n"],"mappings":""}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ //# sourceMappingURL=AdsConfiguration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["AdsConfiguration.ts"],"sourcesContent":["/**\n * Describes the configuration of advertisement.\n *\n * @public\n */\nimport type { GoogleImaConfiguration } from './GoogleImaConfiguration';\n\nexport interface AdsConfiguration {\n /**\n * Allows configuring which mime types are allowed during ad playback.\n *\n * @remarks\n * <br/> - This feature is only available for Google IMA.\n * <br/> - If set to an array, all ads with another mime types will be ignored.\n * <br/> - If set to `undefined` the ad system will pick media based on the browser's capabilities.\n *\n * @defaultValue `undefined`\n */\n allowedMimeTypes?: string[];\n\n /**\n * Whether an advertisement UI is shown.\n *\n * @defaultValue `true`\n */\n uiEnabled?: boolean;\n\n /**\n * Whether media files of mid- and postrolls are preloaded.\n *\n * @remarks\n * <br/> - This feature is only available for Google IMA.\n *\n * @defaultValue `'midroll-and-postroll'`\n */\n preload?: AdPreloadType;\n\n /**\n * The iframe policy for VPAID ads.\n *\n * @remarks\n * <br/> - This feature is only available for Google IMA and SpotX.\n *\n * @defaultValue `'enabled'`\n */\n vpaidMode?: VPAIDMode;\n\n /**\n * The Google IMA configuration.\n *\n * @internal\n */\n googleImaConfiguration?: GoogleImaConfiguration;\n}\n\n/**\n * The ad preloading strategy, represented by a value from the following list:\n * <br/> - `'none'`: Ads are not preloaded.\n * <br/> - `'midroll-and-postroll'`: Mid- and postrolls are preloaded.\n *\n * @remarks\n * <br/> - For Google IMA, preloading starts 4 seconds before ad playback.\n *\n * @public\n */\nexport type AdPreloadType = 'none' | 'midroll-and-postroll';\n\n/**\n * The iframe policies for VPAID ads, represented by a value from the following list:\n * <br/> - `'enabled'`: Ads will load in a cross domain iframe. This disables access to the site via JavaScript. Ads that require a friendly iframe will fail to play.\n * <br/> - `'insecure'`: Ads will load in a friendly iframe. This allows access to the site via JavaScript.\n * <br/> - `'disabled'`: Ads will error when requested.\n *\n * @public\n */\nexport type VPAIDMode = 'enabled' | 'insecure' | 'disabled';\n"],"mappings":""}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=CompanionAd.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["CompanionAd.ts"],"sourcesContent":["/**\n * Represents a companion ad which is displayed near the video player.\n *\n * @public\n */\nexport interface CompanionAd {\n /**\n * The identifier of the element in which the companion ad should be appended, if available.\n *\n * @remarks\n * <br/> Only available for Google DAI and THEO ads if provided in the VAST.\n */\n adSlotId?: string;\n\n /**\n * The alternative description for the ad.\n *\n * @remarks\n * <br/> - Returns value as reported in the VAST StaticResource. If not specified, it returns an empty string.\n * <br/> - Returns an empty string for THEO ads if not available.\n * <br/> - Returns an empty string for Google IMA / Google DAI integrations.\n */\n altText: string;\n\n /**\n * The content of the ad, as HTML.\n *\n * @remarks\n * <br/> - Available for StaticResource and HTMLResource in THEO ad system.\n * <br/> - Available in the DAI ad system.\n */\n contentHTML: string;\n\n /**\n * The website of the advertisement.\n *\n * @remarks\n * <br/> - Only available for StaticResource if specified by the VAST. Otherwise returns an empty string.\n */\n clickThrough?: string;\n\n /**\n * The height of the ad, in pixels.\n *\n * @remarks\n * <br/> - Only available for IMA ad system and THEO ad system.\n */\n height: number;\n\n /**\n * The URI of the ad content as specified in the VAST file.\n *\n * @remarks\n * <br/> - Only available in the THEO ad system for StaticResource. Otherwise returns an empty string.\n */\n resourceURI: string;\n\n /**\n * The width of the ad, in pixels.\n *\n * @remarks\n * <br/> - Only available for IMA ad system and THEO ad system.\n */\n width: number;\n}\n"],"mappings":""}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=GoogleDai.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["GoogleDai.ts"],"sourcesContent":["/**\n * The Google DAI API.\n *\n * @public\n */\nexport interface GoogleDAI {\n /**\n * Returns the content time without ads for a given stream time. Returns the given stream time for live streams.\n *\n * @param time - The stream time with inserted ads (in seconds).\n */\n contentTimeForStreamTime(time: number): Promise<number>;\n\n /**\n * Returns the stream time with ads for a given content time. Returns the given content time for live streams.\n *\n * @param time - The content time without any ads (in seconds).\n */\n streamTimeForContentTime(time: number): Promise<number>;\n\n /**\n * Whether snapback is enabled. When enabled and the user seeks over multiple ad breaks, the last ad break that was seeked past will be played.\n *\n * @defaultValue `true`\n */\n readonly snapback: Promise<boolean>;\n\n /**\n * Set snapback value. When enabled and the user seeks over multiple ad breaks, the last ad break that was seeked past will be played.\n */\n setSnapback(enabled: boolean): void;\n}\n"],"mappings":""}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ //# sourceMappingURL=GoogleImaAd.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["GoogleImaAd.ts"],"sourcesContent":["/**\n * Represents a Google IMA creative compliant to the VAST specification.\n *\n * @remarks\n * <br/> - Available since v2.60.0.\n *\n * @public\n */\nimport type { Ad } from './Ad';\n\nexport interface GoogleImaAd extends Ad {\n /**\n * The bitrate of the currently playing creative as listed in the VAST response or 0.\n */\n readonly bitrate: number;\n\n /**\n * Record of custom parameters for the ad at the time of ad trafficking.\n * Each entry contains a parameter name with associated value.\n *\n * @remarks\n * <br/> - Available when the {@link Ad.readyState} is `'ready'`.\n */\n traffickingParameters: { [parameterKey: string]: string } | undefined;\n\n /**\n * Return title of the advertisement.\n *\n * @remarks\n * <br/> - Available when the {@link Ad.readyState} is `'ready'`.\n */\n title: string | undefined;\n\n /**\n * The custom parameters for the ad at the time of ad trafficking, as a string.\n *\n * @remarks\n * <br/> - A parsed version is available as {@link GoogleImaAd.traffickingParameters}.\n * <br/> - Available when the {@link Ad.readyState} is `'ready'`.\n */\n traffickingParametersString: string | undefined;\n\n /**\n * List of wrapper ad identifiers as specified in the VAST response.\n */\n wrapperAdIds: string[];\n\n /**\n * List of wrapper ad systems as specified in the VAST response.\n */\n wrapperAdSystems: string[];\n\n /**\n * List of wrapper creative identifiers.\n *\n * @remarks\n * <br/> - Starts with the first wrapper ad.\n */\n wrapperCreativeIds: string[];\n\n /**\n * The url of the chosen media file.\n *\n * @remarks\n * <br/> - Available when the {@link Ad.readyState} is `'ready'`.\n */\n mediaUrl: string | undefined;\n\n /**\n * The content type of the ad.\n *\n * @remarks\n * <br/> - Available when the {@link Ad.readyState} is `'ready'`.\n * <br/> - For linear ads, the content type is only going to be available after the `'adbegin'` event, when the media file is selected.\n */\n contentType: string | undefined;\n\n /**\n * The identifier of the API framework needed to execute the ad.\n *\n * @remarks\n * <br/> - Available when the {@link Ad.readyState} is `'ready'`.\n * <br/> - This corresponds with the apiFramework specified in vast.\n */\n apiFramework: string | undefined;\n}\n"],"mappings":""}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=GoogleImaConfiguration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["GoogleImaConfiguration.ts"],"sourcesContent":["/**\n * Describes the configuration of Google IMA.\n *\n * @internal\n */\nexport interface GoogleImaConfiguration {\n /**\n * Whether the native (mobile) IMA implementation will be used.\n *\n * @internal\n */\n useNativeIma: boolean;\n}\n"],"mappings":""}