react-native-theoplayer 11.6.0 → 11.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (254) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/README.md +69 -0
  3. package/android/build.gradle +3 -2
  4. package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  5. package/android/gradle/wrapper/gradle-wrapper.properties +1 -1
  6. package/android/gradlew +176 -110
  7. package/android/gradlew.bat +23 -18
  8. package/android/src/main/java/com/theoplayer/PlayerConfigAdapter.kt +6 -0
  9. package/android/src/main/java/com/theoplayer/PlayerEventEmitter.kt +2 -2
  10. package/android/src/main/java/com/theoplayer/ReactTHEOplayerContext.kt +37 -8
  11. package/android/src/main/java/com/theoplayer/ReactTHEOplayerPackage.kt +3 -0
  12. package/android/src/main/java/com/theoplayer/ReactTHEOplayerView.kt +51 -3
  13. package/android/src/main/java/com/theoplayer/ads/AdEventAdapter.kt +4 -0
  14. package/android/src/main/java/com/theoplayer/ads/AdsModule.kt +6 -6
  15. package/android/src/main/java/com/theoplayer/drm/ContentProtectionAdapter.kt +17 -5
  16. package/android/src/main/java/com/theoplayer/drm/ContentProtectionModule.kt +61 -7
  17. package/android/src/main/java/com/theoplayer/drm/ProxyContentProtectionIntegration.kt +12 -5
  18. package/android/src/main/java/com/theoplayer/drm/ProxyContentProtectionIntegrationFactory.kt +3 -1
  19. package/android/src/main/java/com/theoplayer/integration/Integration.kt +72 -0
  20. package/android/src/main/java/com/theoplayer/integration/IntegrationRegistration.kt +68 -0
  21. package/android/src/main/java/com/theoplayer/integration/PlayerFacade.kt +187 -0
  22. package/android/src/main/java/com/theoplayer/integration/PlayerFacadeAdState.kt +19 -0
  23. package/android/src/main/java/com/theoplayer/integration/PlayerFacadeAds.kt +73 -0
  24. package/android/src/main/java/com/theoplayer/integration/PlayerFacadeAdsBridge.kt +112 -0
  25. package/android/src/main/java/com/theoplayer/integration/PlayerFacadeEventSubscription.kt +11 -0
  26. package/android/src/main/java/com/theoplayer/integration/PlayerFacadeEvents.kt +139 -0
  27. package/android/src/main/java/com/theoplayer/metrics/MetricsModule.kt +37 -0
  28. package/android/src/main/java/com/theoplayer/theoads/THEOadsModule.kt +1 -1
  29. package/android/src/main/java/com/theoplayer/theolive/EndpointAdapter.kt +33 -0
  30. package/android/src/test/java/com/theoplayer/integration/PlayerFacadeAdsBridgeTest.kt +250 -0
  31. package/android/src/test/java/com/theoplayer/integration/PlayerFacadeConfigurationTest.kt +30 -0
  32. package/android/src/test/java/com/theoplayer/integration/PlayerFacadeTest.kt +507 -0
  33. package/android/src/test/java/com/theoplayer/integration/PlayerFacadeTestHost.kt +104 -0
  34. package/ios/THEOplayerRCTBridge.m +19 -0
  35. package/ios/THEOplayerRCTPlayerAPI.swift +31 -0
  36. package/ios/Theoplayer-Bridging-Header.h +0 -1
  37. package/ios/contentprotection/THEOplayerRCTContentProtectionAPI.swift +39 -9
  38. package/ios/contentprotection/THEOplayerRCTContentProtectionAggregator.swift +15 -11
  39. package/ios/contentprotection/THEOplayerRCTProxyContentProtectionIntegration.swift +12 -7
  40. package/ios/metrics/THEOplayerRCTMetricsAPI.swift +31 -0
  41. package/ios/theolive/THEOplayerRCTTHEOliveEventAdapter.swift +21 -0
  42. package/lib/commonjs/api/barrel.js +31 -20
  43. package/lib/commonjs/api/barrel.js.map +1 -1
  44. package/lib/commonjs/api/metrics/MetricsAPI.js +2 -0
  45. package/lib/commonjs/api/metrics/MetricsAPI.js.map +1 -0
  46. package/lib/commonjs/api/metrics/barrel.js +17 -0
  47. package/lib/commonjs/api/metrics/barrel.js.map +1 -0
  48. package/lib/commonjs/api/player/Integration.js +2 -0
  49. package/lib/commonjs/api/player/Integration.js.map +1 -0
  50. package/lib/commonjs/api/player/PlayerEventMap.js +1 -1
  51. package/lib/commonjs/api/player/THEOplayer.js.map +1 -1
  52. package/lib/commonjs/api/player/barrel.js +11 -0
  53. package/lib/commonjs/api/player/barrel.js.map +1 -1
  54. package/lib/commonjs/api/track/MediaTrack.js +16 -0
  55. package/lib/commonjs/api/track/MediaTrack.js.map +1 -1
  56. package/lib/commonjs/internal/THEOplayerView.js +2 -0
  57. package/lib/commonjs/internal/THEOplayerView.js.map +1 -1
  58. package/lib/commonjs/internal/THEOplayerView.web.js +3 -1
  59. package/lib/commonjs/internal/THEOplayerView.web.js.map +1 -1
  60. package/lib/commonjs/internal/adapter/DefaultNativePlayerState.js +1 -0
  61. package/lib/commonjs/internal/adapter/DefaultNativePlayerState.js.map +1 -1
  62. package/lib/commonjs/internal/adapter/THEOplayerAdapter.js +18 -0
  63. package/lib/commonjs/internal/adapter/THEOplayerAdapter.js.map +1 -1
  64. package/lib/commonjs/internal/adapter/THEOplayerWebAdapter.js +21 -4
  65. package/lib/commonjs/internal/adapter/THEOplayerWebAdapter.js.map +1 -1
  66. package/lib/commonjs/internal/adapter/WebEventForwarder.js +62 -11
  67. package/lib/commonjs/internal/adapter/WebEventForwarder.js.map +1 -1
  68. package/lib/commonjs/internal/adapter/metrics/MetricsNativeAdapter.js +18 -0
  69. package/lib/commonjs/internal/adapter/metrics/MetricsNativeAdapter.js.map +1 -0
  70. package/lib/commonjs/internal/adapter/metrics/MetricsWebAdapter.js +16 -0
  71. package/lib/commonjs/internal/adapter/metrics/MetricsWebAdapter.js.map +1 -0
  72. package/lib/commonjs/internal/adapter/web/IntegrationRegistration.js +6 -0
  73. package/lib/commonjs/internal/adapter/web/IntegrationRegistration.js.map +1 -0
  74. package/lib/commonjs/internal/adapter/web/PlayerFacade.js +258 -0
  75. package/lib/commonjs/internal/adapter/web/PlayerFacade.js.map +1 -0
  76. package/lib/commonjs/internal/adapter/web/PlayerFacadeAPI.js +6 -0
  77. package/lib/commonjs/internal/adapter/web/PlayerFacadeAPI.js.map +1 -0
  78. package/lib/commonjs/internal/adapter/web/PlayerFacadeAdsEvents.js +114 -0
  79. package/lib/commonjs/internal/adapter/web/PlayerFacadeAdsEvents.js.map +1 -0
  80. package/lib/commonjs/internal/adapter/web/PlayerFacadeIntegration.js +6 -0
  81. package/lib/commonjs/internal/adapter/web/PlayerFacadeIntegration.js.map +1 -0
  82. package/lib/commonjs/internal/adapter/web/PlayerFacadeTypes.js +6 -0
  83. package/lib/commonjs/internal/adapter/web/PlayerFacadeTypes.js.map +1 -0
  84. package/lib/commonjs/internal/drm/ContentProtectionRegistry.js +38 -12
  85. package/lib/commonjs/internal/drm/ContentProtectionRegistry.js.map +1 -1
  86. package/lib/commonjs/manifest.json +1 -1
  87. package/lib/commonjs/plugins/typedoc-platform-icons/package-lock.json +200 -58
  88. package/lib/commonjs/plugins/typedoc-platform-icons/package.json +1 -1
  89. package/lib/commonjs/plugins/typedoc-platform-icons/tsconfig.json +2 -1
  90. package/lib/module/api/barrel.js +1 -0
  91. package/lib/module/api/barrel.js.map +1 -1
  92. package/lib/module/api/metrics/MetricsAPI.js +2 -0
  93. package/lib/module/api/metrics/MetricsAPI.js.map +1 -0
  94. package/lib/module/api/metrics/barrel.js +4 -0
  95. package/lib/module/api/metrics/barrel.js.map +1 -0
  96. package/lib/module/api/player/Integration.js +2 -0
  97. package/lib/module/api/player/Integration.js.map +1 -0
  98. package/lib/module/api/player/PlayerEventMap.js +1 -1
  99. package/lib/module/api/player/THEOplayer.js.map +1 -1
  100. package/lib/module/api/player/barrel.js +1 -0
  101. package/lib/module/api/player/barrel.js.map +1 -1
  102. package/lib/module/api/track/MediaTrack.js +16 -0
  103. package/lib/module/api/track/MediaTrack.js.map +1 -1
  104. package/lib/module/internal/THEOplayerView.js +2 -0
  105. package/lib/module/internal/THEOplayerView.js.map +1 -1
  106. package/lib/module/internal/THEOplayerView.web.js +3 -1
  107. package/lib/module/internal/THEOplayerView.web.js.map +1 -1
  108. package/lib/module/internal/adapter/DefaultNativePlayerState.js +1 -0
  109. package/lib/module/internal/adapter/DefaultNativePlayerState.js.map +1 -1
  110. package/lib/module/internal/adapter/THEOplayerAdapter.js +18 -0
  111. package/lib/module/internal/adapter/THEOplayerAdapter.js.map +1 -1
  112. package/lib/module/internal/adapter/THEOplayerWebAdapter.js +21 -4
  113. package/lib/module/internal/adapter/THEOplayerWebAdapter.js.map +1 -1
  114. package/lib/module/internal/adapter/WebEventForwarder.js +62 -11
  115. package/lib/module/internal/adapter/WebEventForwarder.js.map +1 -1
  116. package/lib/module/internal/adapter/metrics/MetricsNativeAdapter.js +13 -0
  117. package/lib/module/internal/adapter/metrics/MetricsNativeAdapter.js.map +1 -0
  118. package/lib/module/internal/adapter/metrics/MetricsWebAdapter.js +11 -0
  119. package/lib/module/internal/adapter/metrics/MetricsWebAdapter.js.map +1 -0
  120. package/lib/module/internal/adapter/web/IntegrationRegistration.js +4 -0
  121. package/lib/module/internal/adapter/web/IntegrationRegistration.js.map +1 -0
  122. package/lib/module/internal/adapter/web/PlayerFacade.js +253 -0
  123. package/lib/module/internal/adapter/web/PlayerFacade.js.map +1 -0
  124. package/lib/module/internal/adapter/web/PlayerFacadeAPI.js +4 -0
  125. package/lib/module/internal/adapter/web/PlayerFacadeAPI.js.map +1 -0
  126. package/lib/module/internal/adapter/web/PlayerFacadeAdsEvents.js +109 -0
  127. package/lib/module/internal/adapter/web/PlayerFacadeAdsEvents.js.map +1 -0
  128. package/lib/module/internal/adapter/web/PlayerFacadeIntegration.js +4 -0
  129. package/lib/module/internal/adapter/web/PlayerFacadeIntegration.js.map +1 -0
  130. package/lib/module/internal/adapter/web/PlayerFacadeTypes.js +4 -0
  131. package/lib/module/internal/adapter/web/PlayerFacadeTypes.js.map +1 -0
  132. package/lib/module/internal/drm/ContentProtectionRegistry.js +38 -12
  133. package/lib/module/internal/drm/ContentProtectionRegistry.js.map +1 -1
  134. package/lib/module/manifest.json +1 -1
  135. package/lib/module/plugins/typedoc-platform-icons/package-lock.json +200 -58
  136. package/lib/module/plugins/typedoc-platform-icons/package.json +1 -1
  137. package/lib/module/plugins/typedoc-platform-icons/tsconfig.json +2 -1
  138. package/lib/typescript/__tests__/ContentProtectionRegistry.test.d.ts +2 -0
  139. package/lib/typescript/__tests__/ContentProtectionRegistry.test.d.ts.map +1 -0
  140. package/lib/typescript/__tests__/PlayerFacade.test.d.ts +2 -0
  141. package/lib/typescript/__tests__/PlayerFacade.test.d.ts.map +1 -0
  142. package/lib/typescript/__tests__/PlayerFacadeWebAdapter.test.d.ts +2 -0
  143. package/lib/typescript/__tests__/PlayerFacadeWebAdapter.test.d.ts.map +1 -0
  144. package/lib/typescript/__tests__/index.test.d.ts +13 -0
  145. package/lib/typescript/__tests__/index.test.d.ts.map +1 -1
  146. package/lib/typescript/api/THEOplayerView.d.ts +4 -0
  147. package/lib/typescript/api/THEOplayerView.d.ts.map +1 -1
  148. package/lib/typescript/api/barrel.d.ts +1 -0
  149. package/lib/typescript/api/barrel.d.ts.map +1 -1
  150. package/lib/typescript/api/config/PlayerConfiguration.d.ts +15 -0
  151. package/lib/typescript/api/config/PlayerConfiguration.d.ts.map +1 -1
  152. package/lib/typescript/api/error/ChromecastError.d.ts +2 -2
  153. package/lib/typescript/api/event/AdEvent.d.ts +1 -1
  154. package/lib/typescript/api/metrics/MetricsAPI.d.ts +21 -0
  155. package/lib/typescript/api/metrics/MetricsAPI.d.ts.map +1 -0
  156. package/lib/typescript/api/metrics/barrel.d.ts +2 -0
  157. package/lib/typescript/api/metrics/barrel.d.ts.map +1 -0
  158. package/lib/typescript/api/player/Integration.d.ts +88 -0
  159. package/lib/typescript/api/player/Integration.d.ts.map +1 -0
  160. package/lib/typescript/api/player/PlayerEventMap.d.ts +1 -1
  161. package/lib/typescript/api/player/THEOplayer.d.ts +19 -0
  162. package/lib/typescript/api/player/THEOplayer.d.ts.map +1 -1
  163. package/lib/typescript/api/player/barrel.d.ts +1 -0
  164. package/lib/typescript/api/player/barrel.d.ts.map +1 -1
  165. package/lib/typescript/api/theoads/interstitial/Interstitial.d.ts +1 -1
  166. package/lib/typescript/api/theolive/TheoLiveEndpoint.d.ts +23 -5
  167. package/lib/typescript/api/theolive/TheoLiveEndpoint.d.ts.map +1 -1
  168. package/lib/typescript/api/theolive/WebrtcOptions.d.ts +1 -1
  169. package/lib/typescript/api/track/MediaTrack.d.ts +21 -4
  170. package/lib/typescript/api/track/MediaTrack.d.ts.map +1 -1
  171. package/lib/typescript/internal/adapter/DefaultNativePlayerState.d.ts +1 -0
  172. package/lib/typescript/internal/adapter/DefaultNativePlayerState.d.ts.map +1 -1
  173. package/lib/typescript/internal/adapter/NativePlayerState.d.ts +1 -0
  174. package/lib/typescript/internal/adapter/NativePlayerState.d.ts.map +1 -1
  175. package/lib/typescript/internal/adapter/THEOplayerAdapter.d.ts +6 -1
  176. package/lib/typescript/internal/adapter/THEOplayerAdapter.d.ts.map +1 -1
  177. package/lib/typescript/internal/adapter/THEOplayerWebAdapter.d.ts +6 -1
  178. package/lib/typescript/internal/adapter/THEOplayerWebAdapter.d.ts.map +1 -1
  179. package/lib/typescript/internal/adapter/WebEventForwarder.d.ts +3 -0
  180. package/lib/typescript/internal/adapter/WebEventForwarder.d.ts.map +1 -1
  181. package/lib/typescript/internal/adapter/metrics/MetricsNativeAdapter.d.ts +7 -0
  182. package/lib/typescript/internal/adapter/metrics/MetricsNativeAdapter.d.ts.map +1 -0
  183. package/lib/typescript/internal/adapter/metrics/MetricsWebAdapter.d.ts +8 -0
  184. package/lib/typescript/internal/adapter/metrics/MetricsWebAdapter.d.ts.map +1 -0
  185. package/lib/typescript/internal/adapter/web/IntegrationRegistration.d.ts +53 -0
  186. package/lib/typescript/internal/adapter/web/IntegrationRegistration.d.ts.map +1 -0
  187. package/lib/typescript/internal/adapter/web/PlayerFacade.d.ts +26 -0
  188. package/lib/typescript/internal/adapter/web/PlayerFacade.d.ts.map +1 -0
  189. package/lib/typescript/internal/adapter/web/PlayerFacadeAPI.d.ts +33 -0
  190. package/lib/typescript/internal/adapter/web/PlayerFacadeAPI.d.ts.map +1 -0
  191. package/lib/typescript/internal/adapter/web/PlayerFacadeAdsEvents.d.ts +21 -0
  192. package/lib/typescript/internal/adapter/web/PlayerFacadeAdsEvents.d.ts.map +1 -0
  193. package/lib/typescript/internal/adapter/web/PlayerFacadeIntegration.d.ts +43 -0
  194. package/lib/typescript/internal/adapter/web/PlayerFacadeIntegration.d.ts.map +1 -0
  195. package/lib/typescript/internal/adapter/web/PlayerFacadeTypes.d.ts +13 -0
  196. package/lib/typescript/internal/adapter/web/PlayerFacadeTypes.d.ts.map +1 -0
  197. package/lib/typescript/internal/drm/ContentProtectionRegistry.d.ts +3 -1
  198. package/lib/typescript/internal/drm/ContentProtectionRegistry.d.ts.map +1 -1
  199. package/lib/typescript/internal/drm/NativeContentProtectionEvent.d.ts +5 -0
  200. package/lib/typescript/internal/drm/NativeContentProtectionEvent.d.ts.map +1 -1
  201. package/package.json +5 -6
  202. package/react-native-theoplayer.podspec +7 -7
  203. package/src/__tests__/ContentProtectionRegistry.test.ts +239 -0
  204. package/src/__tests__/PlayerFacade.test.ts +579 -0
  205. package/src/__tests__/PlayerFacadeWebAdapter.test.ts +193 -0
  206. package/src/__tests__/index.test.tsx +15 -1
  207. package/src/api/THEOplayerView.ts +5 -0
  208. package/src/api/barrel.ts +1 -0
  209. package/src/api/config/PlayerConfiguration.ts +16 -0
  210. package/src/api/error/ChromecastError.ts +2 -2
  211. package/src/api/event/AdEvent.ts +1 -1
  212. package/src/api/metrics/MetricsAPI.ts +20 -0
  213. package/src/api/metrics/barrel.ts +1 -0
  214. package/src/api/player/Integration.ts +97 -0
  215. package/src/api/player/PlayerEventMap.ts +1 -1
  216. package/src/api/player/THEOplayer.ts +21 -0
  217. package/src/api/player/barrel.ts +1 -0
  218. package/src/api/theoads/interstitial/Interstitial.ts +1 -1
  219. package/src/api/theolive/TheoLiveEndpoint.ts +24 -5
  220. package/src/api/theolive/WebrtcOptions.ts +1 -1
  221. package/src/api/track/MediaTrack.ts +21 -4
  222. package/src/internal/THEOplayerView.tsx +2 -2
  223. package/src/internal/THEOplayerView.web.tsx +2 -2
  224. package/src/internal/adapter/DefaultNativePlayerState.ts +1 -0
  225. package/src/internal/adapter/NativePlayerState.ts +1 -0
  226. package/src/internal/adapter/THEOplayerAdapter.ts +24 -0
  227. package/src/internal/adapter/THEOplayerWebAdapter.ts +27 -4
  228. package/src/internal/adapter/WebEventForwarder.ts +74 -13
  229. package/src/internal/adapter/metrics/MetricsNativeAdapter.ts +12 -0
  230. package/src/internal/adapter/metrics/MetricsWebAdapter.ts +14 -0
  231. package/src/internal/adapter/web/IntegrationRegistration.ts +57 -0
  232. package/src/internal/adapter/web/PlayerFacade.ts +281 -0
  233. package/src/internal/adapter/web/PlayerFacadeAPI.ts +35 -0
  234. package/src/internal/adapter/web/PlayerFacadeAdsEvents.ts +119 -0
  235. package/src/internal/adapter/web/PlayerFacadeIntegration.ts +45 -0
  236. package/src/internal/adapter/web/PlayerFacadeTypes.ts +14 -0
  237. package/src/internal/drm/ContentProtectionRegistry.ts +35 -17
  238. package/src/internal/drm/NativeContentProtectionEvent.ts +5 -0
  239. package/src/manifest.json +1 -1
  240. package/src/plugins/typedoc-platform-icons/package-lock.json +200 -58
  241. package/src/plugins/typedoc-platform-icons/package.json +1 -1
  242. package/src/plugins/typedoc-platform-icons/tsconfig.json +2 -1
  243. package/lib/typescript/plugins/expo/Common.d.ts +0 -13
  244. package/lib/typescript/plugins/expo/Common.d.ts.map +0 -1
  245. package/lib/typescript/plugins/expo/withCustomPod.d.ts +0 -2
  246. package/lib/typescript/plugins/expo/withCustomPod.d.ts.map +0 -1
  247. package/lib/typescript/plugins/expo/withTHEOplayer.d.ts +0 -4
  248. package/lib/typescript/plugins/expo/withTHEOplayer.d.ts.map +0 -1
  249. package/lib/typescript/plugins/expo/withTHEOplayerAndroid.d.ts +0 -4
  250. package/lib/typescript/plugins/expo/withTHEOplayerAndroid.d.ts.map +0 -1
  251. package/lib/typescript/plugins/expo/withTHEOplayerIOS.d.ts +0 -4
  252. package/lib/typescript/plugins/expo/withTHEOplayerIOS.d.ts.map +0 -1
  253. package/lib/typescript/plugins/typedoc-platform-icons/src/index.d.ts +0 -3
  254. package/lib/typescript/plugins/typedoc-platform-icons/src/index.d.ts.map +0 -1
@@ -0,0 +1,253 @@
1
+ "use strict";
2
+
3
+ import { PlayerFacadeAdsEvents } from './PlayerFacadeAdsEvents';
4
+ // Resolve the current backing object on every access while preserving its method receiver and identity.
5
+ function delegate(backing, overrides) {
6
+ const methods = new Map();
7
+ return new Proxy(Object.create(Object.getPrototypeOf(backing())), {
8
+ get: (_target, property) => {
9
+ const receiver = Object.prototype.hasOwnProperty.call(overrides, property) ? overrides : backing();
10
+ const value = Reflect.get(receiver, property, receiver);
11
+ if (typeof value !== 'function' || property === 'constructor') return value;
12
+ const cached = methods.get(property);
13
+ if (cached?.original !== value || cached.receiver !== receiver) methods.set(property, {
14
+ original: value,
15
+ receiver,
16
+ bound: value.bind(receiver)
17
+ });
18
+ return methods.get(property).bound;
19
+ },
20
+ set: (_target, property, value) => {
21
+ const receiver = Reflect.getOwnPropertyDescriptor(overrides, property)?.set ? overrides : backing();
22
+ return Reflect.set(receiver, property, value, receiver);
23
+ },
24
+ has: (_target, property) => property in overrides || property in backing(),
25
+ ownKeys: () => [...new Set([...Reflect.ownKeys(backing()), ...Reflect.ownKeys(overrides)])],
26
+ getOwnPropertyDescriptor: (_target, property) => {
27
+ const descriptor = Reflect.getOwnPropertyDescriptor(overrides, property) ?? Reflect.getOwnPropertyDescriptor(backing(), property);
28
+ return descriptor && {
29
+ ...descriptor,
30
+ configurable: true
31
+ };
32
+ },
33
+ preventExtensions: () => false
34
+ });
35
+ }
36
+
37
+ /**
38
+ * Stable player surface with generic integration hooks; no playback or ad-lifecycle policy lives here.
39
+ *
40
+ * @internal
41
+ */
42
+ export class PlayerFacade {
43
+ playerSubscriptions = new Map();
44
+ playerInterceptors = new Set();
45
+ closed = false;
46
+ constructor(contentPlayer) {
47
+ this.contentPlayer = contentPlayer;
48
+ this.nativeAds = contentPlayer.ads;
49
+ this.adsEvents = new PlayerFacadeAdsEvents(this.nativeAds, () => this.registration?.integration);
50
+ const readAdState = () => this.registration?.integration?.ads ?? this.registration?.integration?.getAdState?.();
51
+ const readPlaying = () => readAdState()?.playing ?? this.nativeAds?.playing ?? false;
52
+ const readAds = () => readAdState()?.currentAds ?? this.nativeAds?.currentAds ?? [];
53
+ const readBreak = () => {
54
+ const state = readAdState();
55
+ return state ? state.currentAdBreak : this.nativeAds?.currentAdBreak;
56
+ };
57
+ const readTime = () => {
58
+ const value = this.registration?.integration?.getCurrentTime?.();
59
+ return typeof value === 'number' && Number.isFinite(value) && value >= 0 ? value : contentPlayer.currentTime;
60
+ };
61
+ const writeTime = value => {
62
+ if (this.registration?.integration?.setCurrentTime?.(value) !== true) contentPlayer.currentTime = value;
63
+ };
64
+ const readPaused = () => this.registration?.integration?.isPaused?.() ?? contentPlayer.paused;
65
+ const readSeeking = () => this.registration?.integration?.isSeeking?.() ?? contentPlayer.seeking;
66
+ const readDuration = () => this.registration?.integration?.getDuration?.() ?? contentPlayer.duration;
67
+ const emptyAds = {};
68
+ // Consumers may retain player.ads before registration; only its backing source should change.
69
+ const ads = delegate(() => this.registration?.integration?.ads ?? this.nativeAds ?? emptyAds, {
70
+ get playing() {
71
+ return readPlaying();
72
+ },
73
+ get currentAds() {
74
+ return readAds();
75
+ },
76
+ get currentAdBreak() {
77
+ return readBreak();
78
+ },
79
+ addEventListener: this.adsEvents.addEventListener,
80
+ removeEventListener: this.adsEvents.removeEventListener
81
+ });
82
+ const readMuted = () => this.registration?.integration?.getMuted?.() ?? contentPlayer.muted;
83
+ const writeMuted = value => {
84
+ if (this.registration?.integration?.setMuted?.(value) !== true) contentPlayer.muted = value;
85
+ };
86
+ const readVolume = () => this.registration?.integration?.getVolume?.() ?? contentPlayer.volume;
87
+ const writeVolume = value => {
88
+ if (this.registration?.integration?.setVolume?.(value) !== true) contentPlayer.volume = value;
89
+ };
90
+ this.player = delegate(() => contentPlayer, {
91
+ get muted() {
92
+ return readMuted();
93
+ },
94
+ set muted(value) {
95
+ writeMuted(value);
96
+ },
97
+ get volume() {
98
+ return readVolume();
99
+ },
100
+ set volume(value) {
101
+ writeVolume(value);
102
+ },
103
+ ads,
104
+ contentPlayer,
105
+ registerIntegration: this.registerIntegration.bind(this),
106
+ addEventListener: this.addPlayerEventListener,
107
+ removeEventListener: this.removePlayerEventListener,
108
+ get currentTime() {
109
+ return readTime();
110
+ },
111
+ set currentTime(value) {
112
+ writeTime(value);
113
+ },
114
+ get paused() {
115
+ return readPaused();
116
+ },
117
+ get seeking() {
118
+ return readSeeking();
119
+ },
120
+ get duration() {
121
+ return readDuration();
122
+ },
123
+ play: () => {
124
+ if (this.registration?.integration?.play?.() !== true) contentPlayer.play();
125
+ },
126
+ pause: () => {
127
+ if (this.registration?.integration?.pause?.() !== true) contentPlayer.pause();
128
+ }
129
+ });
130
+ this.getPlayerSubscription('destroy');
131
+ }
132
+ registerIntegration(integration) {
133
+ if (this.closed) throw new Error('The player facade has been closed.');
134
+ if (this.registration) throw new Error('Unregister the previous integration first.');
135
+ if (!integration || typeof integration !== 'object') throw new Error('An integration must be an object implementing Integration.');
136
+ for (const method of ['getCurrentTime', 'setCurrentTime', 'play', 'pause', 'isPaused', 'isSeeking', 'getDuration', 'getMuted', 'setMuted', 'getVolume', 'setVolume', 'getAdState', 'shouldConsumeAdEvent']) {
137
+ if (integration[method] !== undefined && typeof integration[method] !== 'function') {
138
+ throw new Error(`Integration.${method} must be a function.`);
139
+ }
140
+ }
141
+ const registration = {
142
+ integration,
143
+ dispatchPlayerEvent: event => this.dispatchEvent(registration, event),
144
+ dispatchEvent: event => this.dispatchEvent(registration, event),
145
+ interceptPlayerEvent: (type, callback) => {
146
+ if (this.closed || this.registration !== registration) return () => undefined;
147
+ const subscription = this.getPlayerSubscription(type);
148
+ const interceptor = callback;
149
+ subscription.interceptors.add(interceptor);
150
+ return () => {
151
+ subscription.interceptors.delete(interceptor);
152
+ this.releasePlayerSubscription(type, subscription);
153
+ };
154
+ },
155
+ interceptPlayerEvents: interceptor => {
156
+ if (this.closed || this.registration !== registration) return () => undefined;
157
+ this.playerInterceptors.add(interceptor);
158
+ return () => {
159
+ this.playerInterceptors.delete(interceptor);
160
+ };
161
+ },
162
+ close: () => {
163
+ registration.integration = undefined;
164
+ if (this.registration !== registration) return;
165
+ this.registration = undefined;
166
+ // Interceptors have explicit disposers so queued backing events can drain after unregistering.
167
+ if (!this.closed) this.adsEvents.rebind();
168
+ }
169
+ };
170
+ this.registration = registration;
171
+ try {
172
+ this.adsEvents.rebind();
173
+ } catch (error) {
174
+ registration.close();
175
+ throw error;
176
+ }
177
+ return registration;
178
+ }
179
+ getPlayerSubscription(type) {
180
+ const existing = this.playerSubscriptions.get(type);
181
+ if (existing) return existing;
182
+ // One backing listener per type lets interceptors decide once for all facade consumers.
183
+ const subscription = {
184
+ listeners: new Set(),
185
+ interceptors: new Set(),
186
+ forward: event => {
187
+ try {
188
+ for (const interceptor of [...subscription.interceptors]) {
189
+ if (subscription.interceptors.has(interceptor) && interceptor(event)) return;
190
+ }
191
+ for (const interceptor of [...this.playerInterceptors]) {
192
+ if (this.playerInterceptors.has(interceptor) && interceptor(event)) return;
193
+ }
194
+ for (const listener of [...subscription.listeners]) {
195
+ if (subscription.listeners.has(listener)) listener(event);
196
+ }
197
+ } finally {
198
+ if (type === 'destroy') this.close();
199
+ }
200
+ }
201
+ };
202
+ this.playerSubscriptions.set(type, subscription);
203
+ this.contentPlayer.addEventListener(type, subscription.forward);
204
+ return subscription;
205
+ }
206
+ releasePlayerSubscription(type, subscription) {
207
+ if (type === 'destroy' || subscription.listeners.size || subscription.interceptors.size || this.playerSubscriptions.get(type) !== subscription) return;
208
+ this.contentPlayer.removeEventListener(type, subscription.forward);
209
+ this.playerSubscriptions.delete(type);
210
+ }
211
+ addPlayerEventListener = (types, listener) => {
212
+ if (this.closed) throw new Error('The player facade has been closed.');
213
+ for (const type of typeof types === 'string' ? [types] : types) {
214
+ this.getPlayerSubscription(type).listeners.add(listener);
215
+ }
216
+ };
217
+ removePlayerEventListener = (types, listener) => {
218
+ for (const type of typeof types === 'string' ? [types] : types) {
219
+ const subscription = this.playerSubscriptions.get(type);
220
+ if (!subscription) continue;
221
+ subscription.listeners.delete(listener);
222
+ this.releasePlayerSubscription(type, subscription);
223
+ }
224
+ };
225
+ dispatchEvent(registration, event) {
226
+ const isCurrentRegistration = () => !this.closed && this.registration === registration;
227
+ if (!isCurrentRegistration()) return;
228
+ if (!event || typeof event.type !== 'string') throw new Error('A THEOplayer event with a type is required.');
229
+ if (PlayerFacadeAdsEvents.isAdEvent(event)) {
230
+ this.adsEvents.dispatch(event, isCurrentRegistration);
231
+ return;
232
+ }
233
+ // Integration events already represent public playback state; backing-player filters must not consume them.
234
+ const listeners = this.playerSubscriptions.get(event.type)?.listeners;
235
+ for (const listener of [...(listeners ?? [])]) {
236
+ if (isCurrentRegistration() && listeners?.has(listener)) listener(event);
237
+ }
238
+ }
239
+ close = () => {
240
+ if (this.closed) return;
241
+ this.closed = true;
242
+ this.registration?.close();
243
+ this.playerInterceptors.clear();
244
+ for (const [type, subscription] of this.playerSubscriptions) {
245
+ subscription.listeners.clear();
246
+ subscription.interceptors.clear();
247
+ this.contentPlayer.removeEventListener(type, subscription.forward);
248
+ }
249
+ this.playerSubscriptions.clear();
250
+ this.adsEvents.close();
251
+ };
252
+ }
253
+ //# sourceMappingURL=PlayerFacade.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["PlayerFacadeAdsEvents","delegate","backing","overrides","methods","Map","Proxy","Object","create","getPrototypeOf","get","_target","property","receiver","prototype","hasOwnProperty","call","value","Reflect","cached","original","set","bound","bind","getOwnPropertyDescriptor","has","ownKeys","Set","descriptor","configurable","preventExtensions","PlayerFacade","playerSubscriptions","playerInterceptors","closed","constructor","contentPlayer","nativeAds","ads","adsEvents","registration","integration","readAdState","getAdState","readPlaying","playing","readAds","currentAds","readBreak","state","currentAdBreak","readTime","getCurrentTime","Number","isFinite","currentTime","writeTime","setCurrentTime","readPaused","isPaused","paused","readSeeking","isSeeking","seeking","readDuration","getDuration","duration","emptyAds","addEventListener","removeEventListener","readMuted","getMuted","muted","writeMuted","setMuted","readVolume","getVolume","volume","writeVolume","setVolume","player","registerIntegration","addPlayerEventListener","removePlayerEventListener","play","pause","getPlayerSubscription","Error","method","undefined","dispatchPlayerEvent","event","dispatchEvent","interceptPlayerEvent","type","callback","subscription","interceptor","interceptors","add","delete","releasePlayerSubscription","interceptPlayerEvents","close","rebind","error","existing","listeners","forward","listener","size","types","isCurrentRegistration","isAdEvent","dispatch","clear"],"sourceRoot":"../../../../../src","sources":["internal/adapter/web/PlayerFacade.ts"],"mappings":";;AACA,SAASA,qBAAqB,QAAQ,yBAAyB;AAW/D;AACA,SAASC,QAAQA,CAA8CC,OAAgB,EAAEC,SAAqB,EAAkB;EACtH,MAAMC,OAAO,GAAG,IAAIC,GAAG,CAAuE,CAAC;EAC/F,OAAO,IAAIC,KAAK,CAACC,MAAM,CAACC,MAAM,CAACD,MAAM,CAACE,cAAc,CAACP,OAAO,CAAC,CAAC,CAAC,CAAC,EAAoB;IAClFQ,GAAG,EAAEA,CAACC,OAAO,EAAEC,QAAQ,KAAK;MAC1B,MAAMC,QAAQ,GAAGN,MAAM,CAACO,SAAS,CAACC,cAAc,CAACC,IAAI,CAACb,SAAS,EAAES,QAAQ,CAAC,GAAGT,SAAS,GAAGD,OAAO,CAAC,CAAC;MAClG,MAAMe,KAAc,GAAGC,OAAO,CAACR,GAAG,CAACG,QAAQ,EAAED,QAAQ,EAAEC,QAAQ,CAAC;MAChE,IAAI,OAAOI,KAAK,KAAK,UAAU,IAAIL,QAAQ,KAAK,aAAa,EAAE,OAAOK,KAAK;MAC3E,MAAME,MAAM,GAAGf,OAAO,CAACM,GAAG,CAACE,QAAQ,CAAC;MACpC,IAAIO,MAAM,EAAEC,QAAQ,KAAKH,KAAK,IAAIE,MAAM,CAACN,QAAQ,KAAKA,QAAQ,EAC5DT,OAAO,CAACiB,GAAG,CAACT,QAAQ,EAAE;QAAEQ,QAAQ,EAAEH,KAAK;QAAEJ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CAAC,CAAC;MAC9BnB,YAAY,CAACE,YAAY,CAACiB,KAAK,CAAC,CAAC;MACjC,IAAI,CAAC/E,aAAa,CAACiC,mBAAmB,CAACyB,IAAI,EAAEE,YAAY,CAACY,OAAO,CAAC;IACpE;IACA,IAAI,CAAC5E,mBAAmB,CAACmF,KAAK,CAAC,CAAC;IAChC,IAAI,CAAC5E,SAAS,CAACgE,KAAK,CAAC,CAAC;EACxB,CAAC;AACH","ignoreList":[]}
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+
3
+ export {};
4
+ //# sourceMappingURL=PlayerFacadeAPI.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../../../../src","sources":["internal/adapter/web/PlayerFacadeAPI.ts"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,109 @@
1
+ "use strict";
2
+
3
+ // This table selects the Ads event surface; it does not restrict player event dispatch.
4
+ const AD_EVENTS = {
5
+ addadbreak: true,
6
+ removeadbreak: true,
7
+ adbreakbegin: true,
8
+ adbreakend: true,
9
+ adbreakchange: true,
10
+ addad: true,
11
+ updatead: true,
12
+ updateadbreak: true,
13
+ adloaded: true,
14
+ adbegin: true,
15
+ adend: true,
16
+ adskip: true,
17
+ aderror: true,
18
+ adimpression: true,
19
+ adclicked: true,
20
+ adfirstquartile: true,
21
+ admidpoint: true,
22
+ adthirdquartile: true,
23
+ adbuffering: true,
24
+ admetadata: true,
25
+ adsmanagerloaded: true
26
+ };
27
+
28
+ /** Keeps public Ads listeners stable while their backing event source changes. */
29
+ export class PlayerFacadeAdsEvents {
30
+ subscriptions = new Map();
31
+ closed = false;
32
+ constructor(nativeAds, getIntegration) {
33
+ this.nativeAds = nativeAds;
34
+ this.getIntegration = getIntegration;
35
+ }
36
+ static isAdEvent(event) {
37
+ return Object.prototype.hasOwnProperty.call(AD_EVENTS, event.type);
38
+ }
39
+ addEventListener = (types, listener) => {
40
+ if (this.closed) throw new Error('The player facade has been closed.');
41
+ for (const type of typeof types === 'string' ? [types] : types) {
42
+ let subscription = this.subscriptions.get(type);
43
+ if (!subscription) {
44
+ subscription = {
45
+ listeners: new Set(),
46
+ remove: () => undefined
47
+ };
48
+ subscription.remove = this.bindListener(type, subscription);
49
+ this.subscriptions.set(type, subscription);
50
+ }
51
+ subscription.listeners.add(listener);
52
+ }
53
+ };
54
+ removeEventListener = (types, listener) => {
55
+ for (const type of typeof types === 'string' ? [types] : types) {
56
+ const subscription = this.subscriptions.get(type);
57
+ if (!subscription) continue;
58
+ subscription.listeners.delete(listener);
59
+ if (!subscription.listeners.size) {
60
+ subscription.remove();
61
+ this.subscriptions.delete(type);
62
+ }
63
+ }
64
+ };
65
+ bindListener(type, subscription) {
66
+ const integration = this.getIntegration();
67
+ const ads = integration?.ads ?? this.nativeAds;
68
+ let attached = true;
69
+ const isCurrentSource = () => attached && this.getIntegration() === integration && this.subscriptions.get(type) === subscription;
70
+ const forward = event => {
71
+ // A detached source may still deliver an event queued before the integration changed.
72
+ if (!isCurrentSource() || this.closed) return;
73
+ if (ads === this.nativeAds && integration?.shouldConsumeAdEvent?.(event) === true) return;
74
+ this.dispatch(event, isCurrentSource);
75
+ };
76
+ try {
77
+ ads?.addEventListener(type, forward);
78
+ } catch (error) {
79
+ attached = false;
80
+ ads?.removeEventListener(type, forward);
81
+ throw error;
82
+ }
83
+ return () => {
84
+ attached = false;
85
+ ads?.removeEventListener(type, forward);
86
+ };
87
+ }
88
+ rebind() {
89
+ for (const [type, subscription] of this.subscriptions) {
90
+ subscription.remove();
91
+ subscription.remove = this.bindListener(type, subscription);
92
+ }
93
+ }
94
+ dispatch(event, isCurrentRegistration) {
95
+ const listeners = this.subscriptions.get(event.type)?.listeners;
96
+ for (const listener of [...(listeners ?? [])]) {
97
+ // Listeners can remove each other or unregister the integration during delivery.
98
+ if (!this.closed && isCurrentRegistration() && listeners?.has(listener)) listener(event);
99
+ }
100
+ }
101
+ close() {
102
+ if (this.closed) return;
103
+ this.closed = true;
104
+ const subscriptions = [...this.subscriptions.values()];
105
+ this.subscriptions.clear();
106
+ for (const subscription of subscriptions) subscription.remove();
107
+ }
108
+ }
109
+ //# sourceMappingURL=PlayerFacadeAdsEvents.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["AD_EVENTS","addadbreak","removeadbreak","adbreakbegin","adbreakend","adbreakchange","addad","updatead","updateadbreak","adloaded","adbegin","adend","adskip","aderror","adimpression","adclicked","adfirstquartile","admidpoint","adthirdquartile","adbuffering","admetadata","adsmanagerloaded","PlayerFacadeAdsEvents","subscriptions","Map","closed","constructor","nativeAds","getIntegration","isAdEvent","event","Object","prototype","hasOwnProperty","call","type","addEventListener","types","listener","Error","subscription","get","listeners","Set","remove","undefined","bindListener","set","add","removeEventListener","delete","size","integration","ads","attached","isCurrentSource","forward","shouldConsumeAdEvent","dispatch","error","rebind","isCurrentRegistration","has","close","values","clear"],"sourceRoot":"../../../../../src","sources":["internal/adapter/web/PlayerFacadeAdsEvents.ts"],"mappings":";;AAQA;AACA,MAAMA,SAAoC,GAAG;EAC3CC,UAAU,EAAE,IAAI;EAChBC,aAAa,EAAE,IAAI;EACnBC,YAAY,EAAE,IAAI;EAClBC,UAAU,EAAE,IAAI;EAChBC,aAAa,EAAE,IAAI;EACnBC,KAAK,EAAE,IAAI;EACXC,QAAQ,EAAE,IAAI;EACdC,aAAa,EAAE,IAAI;EACnBC,QAAQ,EAAE,IAAI;EACdC,OAAO,EAAE,IAAI;EACbC,KAAK,EAAE,IAAI;EACXC,MAAM,EAAE,IAAI;EACZC,OAAO,EAAE,IAAI;EACbC,YAAY,EAAE,IAAI;EAClBC,SAAS,EAAE,IAAI;EACfC,eAAe,EAAE,IAAI;EACrBC,UAAU,EAAE,IAAI;EAChBC,eAAe,EAAE,IAAI;EACrBC,WAAW,EAAE,IAAI;EACjBC,UAAU,EAAE,IAAI;EAChBC,gBAAgB,EAAE;AACpB,CAAC;;AAED;AACA,OAAO,MAAMC,qBAAqB,CAAC;EAChBC,aAAa,GAAG,IAAIC,GA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AChBD,GAAG,EAAEJ,mBAAmB,CAACd,IAAI,EAAEqB,OAAO,CAAC;IACzC,CAAC;EACH;EAEAI,MAAMA,CAAA,EAAS;IACb,KAAK,MAAM,CAACzB,IAAI,EAAEK,YAAY,CAAC,IAAI,IAAI,CAACjB,aAAa,EAAE;MACrDiB,YAAY,CAACI,MAAM,CAAC,CAAC;MACrBJ,YAAY,CAACI,MAAM,GAAG,IAAI,CAACE,YAAY,CAACX,IAAI,EAAEK,YAAY,CAAC;IAC7D;EACF;EAEAkB,QAAQA,CAAC5B,KAAc,EAAE+B,qBAAoC,EAAQ;IACnE,MAAMnB,SAAS,GAAG,IAAI,CAACnB,aAAa,CAACkB,GAAG,CAACX,KAAK,CAACK,IAAI,CAAC,EAAEO,SAAS;IAC/D,KAAK,MAAMJ,QAAQ,IAAI,CAAC,IAAII,SAAS,IAAI,EAAE,CAAC,CAAC,EAAE;MAC7C;MACA,IAAI,CAAC,IAAI,CAACjB,MAAM,IAAIoC,qBAAqB,CAAC,CAAC,IAAInB,SAAS,EAAEoB,GAAG,CAACxB,QAAQ,CAAC,EAAEA,QAAQ,CAACR,KAAK,CAAC;IAC1F;EACF;EAEAiC,KAAKA,CAAA,EAAS;IACZ,IAAI,IAAI,CAACtC,MAAM,EAAE;IACjB,IAAI,CAACA,MAAM,GAAG,IAAI;IAClB,MAAMF,aAAa,GAAG,CAAC,GAAG,IAAI,CAACA,aAAa,CAACyC,MAAM,CAAC,CAAC,CAAC;IACtD,IAAI,CAACzC,aAAa,CAAC0C,KAAK,CAAC,CAAC;IAC1B,KAAK,MAAMzB,YAAY,IAAIjB,aAAa,EAAEiB,YAAY,CAACI,MAAM,CAAC,CAAC;EACjE;AACF","ignoreList":[]}
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+
3
+ export {};
4
+ //# sourceMappingURL=PlayerFacadeIntegration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../../../../src","sources":["internal/adapter/web/PlayerFacadeIntegration.ts"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+
3
+ export {};
4
+ //# sourceMappingURL=PlayerFacadeTypes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../../../../src","sources":["internal/adapter/web/PlayerFacadeTypes.ts"],"mappings":"","ignoreList":[]}
@@ -9,7 +9,7 @@ import { isBufferSource } from '../utils/TypeUtils';
9
9
  const NativeContentProtectionModule = NativeModules.THEORCTContentProtectionModule;
10
10
  export class NativeContentProtectionRegistry {
11
11
  registeredFactories = [];
12
- currentIntegration = undefined;
12
+ integrations = new Map();
13
13
  constructor() {
14
14
  this.emitter = new NativeEventEmitter(NativeContentProtectionModule);
15
15
  this.emitter.addListener('onBuildIntegration', this.onBuildIntegrationRequest);
@@ -18,20 +18,43 @@ export class NativeContentProtectionRegistry {
18
18
  this.emitter.addListener('onLicenseRequest', this.onLicenseRequest);
19
19
  this.emitter.addListener('onLicenseResponse', this.onLicenseResponse);
20
20
  this.emitter.addListener('onExtractFairplayContentId', this.onExtractFairplayContentId);
21
+ this.emitter.addListener('onIntegrationDisposed', this.onIntegrationDisposed);
21
22
  }
22
23
  registerContentProtectionIntegration(integrationId, keySystemId, integrationFactory) {
23
- this.registeredFactories.push({
24
+ // Replace a previous registration for the same (integrationId, keySystemId) pair:
25
+ // getFactory() matches the first entry, so pushing duplicates would leave stale
26
+ // factories active while the newly registered factory would never be used.
27
+ const existingIndex = this.registeredFactories.findIndex(f => f.integrationId === integrationId && f.keySystemId === keySystemId);
28
+ const registration = {
24
29
  integrationId,
25
30
  keySystemId,
26
31
  integrationFactory
27
- });
32
+ };
33
+ if (existingIndex === -1) {
34
+ this.registeredFactories.push(registration);
35
+ } else {
36
+ this.registeredFactories[existingIndex] = registration;
37
+ }
28
38
  NativeContentProtectionModule.registerContentProtectionIntegration(integrationId, keySystemId);
29
39
  }
30
40
  getFactory(integrationId, keySystemId) {
31
41
  return this.registeredFactories.find(init => init.integrationId === integrationId && init.keySystemId === keySystemId)?.integrationFactory;
32
42
  }
33
- getIntegration(integrationId, keySystemId) {
34
- return this.currentIntegration?.integrationId === integrationId && this.currentIntegration?.keySystemId === keySystemId ? this.currentIntegration?.integration : undefined;
43
+
44
+ // Each native content protection integration instance gets its own registry entry,
45
+ // keyed by the integrationInstanceId emitted in bridge events. Events from native builds
46
+ // that predate per-instance routing do not carry an integrationInstanceId; these share a
47
+ // single legacy slot, matching the previous single-integration behaviour.
48
+ integrationKey(event) {
49
+ return event.integrationInstanceId ?? '';
50
+ }
51
+ getIntegration(event) {
52
+ const {
53
+ integrationId,
54
+ keySystemId
55
+ } = event;
56
+ const wrapped = this.integrations.get(this.integrationKey(event));
57
+ return wrapped?.integrationId === integrationId && wrapped?.keySystemId === keySystemId ? wrapped?.integration : undefined;
35
58
  }
36
59
  onBuildIntegrationRequest = event => {
37
60
  const {
@@ -43,11 +66,11 @@ export class NativeContentProtectionRegistry {
43
66
  console.log('NativeContentProtectionModule', `onBuildIntegrationRequest ${integrationId} ${keySystemId}`);
44
67
  const factory = this.getFactory(integrationId, keySystemId);
45
68
  if (factory) {
46
- this.currentIntegration = {
69
+ this.integrations.set(this.integrationKey(event), {
47
70
  integrationId,
48
71
  keySystemId,
49
72
  integration: factory.build(drmConfig)
50
- };
73
+ });
51
74
  NativeContentProtectionModule.onBuildProcessed({
52
75
  requestId,
53
76
  resultString: 'success'
@@ -66,7 +89,7 @@ export class NativeContentProtectionRegistry {
66
89
  keySystemId
67
90
  } = request;
68
91
  console.log('NativeContentProtectionModule', `onCertificateRequest ${integrationId} ${keySystemId}`);
69
- const integration = this.getIntegration(integrationId, keySystemId);
92
+ const integration = this.getIntegration(request);
70
93
  if (integration?.onCertificateRequest) {
71
94
  const result = await integration.onCertificateRequest(fromNativeCertificateRequest(request));
72
95
  // TODO: we also want to support ArrayBufferView results
@@ -88,7 +111,7 @@ export class NativeContentProtectionRegistry {
88
111
  keySystemId
89
112
  } = response;
90
113
  console.log('NativeContentProtectionModule', `onCertificateResponse ${integrationId} ${keySystemId}`);
91
- const integration = this.getIntegration(integrationId, keySystemId);
114
+ const integration = this.getIntegration(response);
92
115
  if (integration?.onCertificateResponse) {
93
116
  const responseResult = await integration.onCertificateResponse(fromNativeCertificateResponse(response));
94
117
  // TODO: we also want to support ArrayBufferView results
@@ -105,7 +128,7 @@ export class NativeContentProtectionRegistry {
105
128
  keySystemId
106
129
  } = request;
107
130
  console.log('NativeContentProtectionModule', `onLicenseRequest ${integrationId} ${keySystemId}`);
108
- const integration = this.getIntegration(integrationId, keySystemId);
131
+ const integration = this.getIntegration(request);
109
132
  // Optionally let the custom integration modify the request.
110
133
  if (integration?.onLicenseRequest) {
111
134
  const result = await integration.onLicenseRequest(fromNativeLicenseRequest(request));
@@ -128,7 +151,7 @@ export class NativeContentProtectionRegistry {
128
151
  keySystemId
129
152
  } = response;
130
153
  console.log('NativeContentProtectionModule', `onLicenseResponse ${integrationId} ${keySystemId}`);
131
- const integration = this.getIntegration(integrationId, keySystemId);
154
+ const integration = this.getIntegration(response);
132
155
  if (integration?.onLicenseResponse) {
133
156
  const responseResult = await integration.onLicenseResponse(fromNativeLicenseResponse(response));
134
157
  // TODO: we also want to support ArrayBufferView results
@@ -146,7 +169,7 @@ export class NativeContentProtectionRegistry {
146
169
  requestId
147
170
  } = event;
148
171
  console.log('NativeContentProtectionModule', `onExtractFairplayContentId ${integrationId} ${keySystemId}`);
149
- const integration = this.getIntegration(integrationId, keySystemId);
172
+ const integration = this.getIntegration(event);
150
173
  if (integration?.extractFairplayContentId) {
151
174
  const contentId = await integration.extractFairplayContentId(fairplaySkdUrl);
152
175
  NativeContentProtectionModule.onExtractFairplayContentIdProcessed({
@@ -161,6 +184,9 @@ export class NativeContentProtectionRegistry {
161
184
  });
162
185
  }
163
186
  };
187
+ onIntegrationDisposed = event => {
188
+ this.integrations.delete(this.integrationKey(event));
189
+ };
164
190
  }
165
191
 
166
192
  /**
@@ -1 +1 @@
1
- {"version":3,"names":["NativeEventEmitter","NativeModules","fromNativeLicenseRequest","toNativeLicenseRequest","fromNativeLicenseResponse","toNativeLicenseResponseResult","fromNativeCertificateRequest","toNativeCertificateRequest","fromNativeCertificateResponse","toNativeCertificateResponseResult","isBufferSource","NativeContentProtectionModule","THEORCTContentProtectionModule","NativeContentProtectionRegistry","registeredFactories","currentIntegration","undefined","constructor","emitter","addListener","onBuildIntegrationRequest","onCertificateRequest","onCertificateResponse","onLicenseRequest","onLicenseResponse","onExtractFairplayContentId","registerContentProtectionIntegration","integrationId","keySystemId","integrationFactory","push","getFactory","find","init","getIntegration","integration","event","requestId","drmConfig","console","log","factory","build","onBuildProcessed","resultString","request","result","nativeResponse","onCertificateRequestProcessedAsCertificate","modifiedNativeRequest","onCertificateRequestProcessedAsRequest","response","responseResult","modifiedNativeResponse","onCertificateResponseProcessed","onLicenseRequestProcessedAsLicense","onLicenseRequestProcessedAsRequest","onLicenseResponseProcessed","fairplaySkdUrl","extractFairplayContentId","contentId","onExtractFairplayContentIdProcessed","ContentProtectionRegistry"],"sourceRoot":"../../../../src","sources":["internal/drm/ContentProtectionRegistry.ts"],"mappings":";;AAGA,SAASA,kBAAkB,EAAEC,aAAa,QAAQ,cAAc;AAGhE,SAASC,wBAAwB,EAAwBC,sBAAsB,QAAQ,wBAAwB;AAC/G,SAASC,yBAAyB,EAAyBC,6BAA6B,QAAQ,yBAAyB;AACzH,SAASC,4BAA4B,EAA4BC,0BAA0B,QAAQ,4BAA4B;AAC/H,SAASC,6BAA6B,EAA6BC,iCAAiC,QAAQ,6BAA6B;AACzI,SAASC,cAAc,QAAQ,oBAAoB;AAEnD,MAAMC,6BAA6B,GAAGV,aAAa,CAACW,8BAA8B;AAsBlF,OAAO,MAAMC,+BAA+B,CAAiC;EAEnEC,mBAAmB,GAAiD,EAAE;EACtEC,kBAAkB,GAAoDC,SAAS;EAEvFC,WAAWA,CAAA,EAAG;IACZ,IAAI,CAACC,OAAO,GAAG,IAAIlB,kBAAkB,CAACW,6BA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AA0B,CAACN,QAAQ,CAAC;IACpE;EACF,CAAC;EAEO1B,0BAA0B,GAAG,MAAOW,KAAmC,IAAK;IAClF,MAAM;MAAET,aAAa;MAAEC,WAAW;MAAE8B,cAAc;MAAErB;IAAU,CAAC,GAAGD,KAAK;IACvEG,OAAO,CAACC,GAAG,CAAC,+BAA+B,EAAE,8BAA8Bb,aAAa,IAAIC,WAAW,EAAE,CAAC;IAC1G,MAAMO,WAAW,GAAG,IAAI,CAACD,cAAc,CAACP,aAAa,EAAEC,WAAW,CAAC;IACnE,IAAIO,WAAW,EAAEwB,wBAAwB,EAAE;MACzC,MAAMC,SAAS,GAAG,MAAMzB,WAAW,CAACwB,wBAAwB,CAACD,cAAc,CAAC;MAC5E/C,6BAA6B,CAACkD,mCAAmC,CAAC;QAChExB,SAAS;QACTuB;MACF,CAAC,CAAC;IACJ,CAAC,MAAM;MACL,MAAMA,SAAS,GAAGF,cAAc;MAChC/C,6BAA6B,CAACkD,mCAAmC,CAAC;QAChExB,SAAS;QACTuB;MACF,CAAC,CAAC;IACJ;EACF,CAAC;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAME,yBAA+C,GAAG,IAAIjD,+BAA+B,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["NativeEventEmitter","NativeModules","fromNativeLicenseRequest","toNativeLicenseRequest","fromNativeLicenseResponse","toNativeLicenseResponseResult","fromNativeCertificateRequest","toNativeCertificateRequest","fromNativeCertificateResponse","toNativeCertificateResponseResult","isBufferSource","NativeContentProtectionModule","THEORCTContentProtectionModule","NativeContentProtectionRegistry","registeredFactories","integrations","Map","constructor","emitter","addListener","onBuildIntegrationRequest","onCertificateRequest","onCertificateResponse","onLicenseRequest","onLicenseResponse","onExtractFairplayContentId","onIntegrationDisposed","registerContentProtectionIntegration","integrationId","keySystemId","integrationFactory","existingIndex","findIndex","f","registration","push","getFactory","find","init","integrationKey","event","integrationInstanceId","getIntegration","wrapped","get","integration","undefined","requestId","drmConfig","console","log","factory","set","build","onBuildProcessed","resultString","request","result","nativeResponse","onCertificateRequestProcessedAsCertificate","modifiedNativeRequest","onCertificateRequestProcessedAsRequest","response","responseResult","modifiedNativeResponse","onCertificateResponseProcessed","onLicenseRequestProcessedAsLicense","onLicenseRequestProcessedAsRequest","onLicenseResponseProcessed","fairplaySkdUrl","extractFairplayContentId","contentId","onExtractFairplayContentIdProcessed","delete","ContentProtectionRegistry"],"sourceRoot":"../../../../src","sources":["internal/drm/ContentProtectionRegistry.ts"],"mappings":";;AAGA,SAASA,kBAAkB,EAAEC,aAAa,QAAQ,cAAc;AAGhE,SAASC,wBAAwB,EAAwBC,sBAAsB,QAAQ,wBAAwB;AAC/G,SAASC,yBAAyB,EAAyBC,6BAA6B,QAAQ,yBAAyB;AACzH,SAASC,4BAA4B,EAA4BC,0BAA0B,QAAQ,4BAA4B;AAC/H,SAASC,6BAA6B,EAA6BC,iCAAiC,QAAQ,6BAA6B;AACzI,SAASC,cAAc,QAAQ,oBAAoB;AAEnD,MAAMC,6BAA6B,GAAGV,aAAa,CAACW,8BAA8B;AAsBlF,OAAO,MAAMC,+BAA+B,CAAiC;EAEnEC,mBAAmB,GAAiD,EAAE;EACtEC,YAAY,GAAqD,IAAIC,GAAG,CAAC,CAAC;EAElFC,WAAWA,CAAA,EAAG;IACZ,IAAI,CAACC,OAAO,GAAG,IAAIlB,kBAAkB,CAACW,6BAA6B,CAAC;IACpE,IAAI,CAACO,OAAO,CAACC,WAAW,CAAC,oBAAoB,EAAE,IAAI,CAACC,yBAAyB,CAAC;IAC9E,IAAI,CAACF,OAAO,CAACC,WAAW,CAAC,sBAAsB,EAAE,IAAI,CAACE,oBAAoB,CAAC;IAC3E,IAAI,CAACH,OAAO,CAACC,WAAW,CAAC,uBAAuB,EAAE,IAAI,CAACG,qBAAqB,CAAC;IAC7E,IAAI,CAACJ,OAAO,CAACC,WAAW,CAAC,kBAAkB,EAAE,IAAI,CAACI,gBAAgB,CAAC;IACnE,IAAI,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