@svta/cml-drm 0.19.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 (260) hide show
  1. package/LICENSE +202 -0
  2. package/dist/cenc/findCencContentProtection.d.ts +14 -0
  3. package/dist/cenc/findCencContentProtection.d.ts.map +1 -0
  4. package/dist/cenc/findCencContentProtection.js +30 -0
  5. package/dist/cenc/findCencContentProtection.js.map +1 -0
  6. package/dist/cenc/getLicenseServerUrlFromContentProtection.d.ts +15 -0
  7. package/dist/cenc/getLicenseServerUrlFromContentProtection.d.ts.map +1 -0
  8. package/dist/cenc/getLicenseServerUrlFromContentProtection.js +17 -0
  9. package/dist/cenc/getLicenseServerUrlFromContentProtection.js.map +1 -0
  10. package/dist/cenc/getPsshData.d.ts +13 -0
  11. package/dist/cenc/getPsshData.d.ts.map +1 -0
  12. package/dist/cenc/getPsshData.js +24 -0
  13. package/dist/cenc/getPsshData.js.map +1 -0
  14. package/dist/cenc/getPsshForKeySystem.d.ts +15 -0
  15. package/dist/cenc/getPsshForKeySystem.d.ts.map +1 -0
  16. package/dist/cenc/getPsshForKeySystem.js +22 -0
  17. package/dist/cenc/getPsshForKeySystem.js.map +1 -0
  18. package/dist/cenc/parseInitDataFromContentProtection.d.ts +18 -0
  19. package/dist/cenc/parseInitDataFromContentProtection.d.ts.map +1 -0
  20. package/dist/cenc/parseInitDataFromContentProtection.js +21 -0
  21. package/dist/cenc/parseInitDataFromContentProtection.js.map +1 -0
  22. package/dist/cenc/parsePsshList.d.ts +16 -0
  23. package/dist/cenc/parsePsshList.d.ts.map +1 -0
  24. package/dist/cenc/parsePsshList.js +87 -0
  25. package/dist/cenc/parsePsshList.js.map +1 -0
  26. package/dist/common/CBCS.d.ts +8 -0
  27. package/dist/common/CBCS.d.ts.map +1 -0
  28. package/dist/common/CBCS.js +8 -0
  29. package/dist/common/CBCS.js.map +1 -0
  30. package/dist/common/CENC.d.ts +8 -0
  31. package/dist/common/CENC.d.ts.map +1 -0
  32. package/dist/common/CENC.js +8 -0
  33. package/dist/common/CENC.js.map +1 -0
  34. package/dist/common/CHALLENGE.d.ts +8 -0
  35. package/dist/common/CHALLENGE.d.ts.map +1 -0
  36. package/dist/common/CHALLENGE.js +8 -0
  37. package/dist/common/CHALLENGE.js.map +1 -0
  38. package/dist/common/CLEAR_KEY_SYSTEM.d.ts +8 -0
  39. package/dist/common/CLEAR_KEY_SYSTEM.d.ts.map +1 -0
  40. package/dist/common/CLEAR_KEY_SYSTEM.js +8 -0
  41. package/dist/common/CLEAR_KEY_SYSTEM.js.map +1 -0
  42. package/dist/common/CLEAR_KEY_UUID.d.ts +8 -0
  43. package/dist/common/CLEAR_KEY_UUID.d.ts.map +1 -0
  44. package/dist/common/CLEAR_KEY_UUID.js +8 -0
  45. package/dist/common/CLEAR_KEY_UUID.js.map +1 -0
  46. package/dist/common/CONTENT_TYPE.d.ts +8 -0
  47. package/dist/common/CONTENT_TYPE.d.ts.map +1 -0
  48. package/dist/common/CONTENT_TYPE.js +8 -0
  49. package/dist/common/CONTENT_TYPE.js.map +1 -0
  50. package/dist/common/ContentProtection.d.ts +12 -0
  51. package/dist/common/ContentProtection.d.ts.map +1 -0
  52. package/dist/common/ContentProtection.js +2 -0
  53. package/dist/common/ContentProtection.js.map +1 -0
  54. package/dist/common/EXPIRED.d.ts +8 -0
  55. package/dist/common/EXPIRED.d.ts.map +1 -0
  56. package/dist/common/EXPIRED.js +8 -0
  57. package/dist/common/EXPIRED.js.map +1 -0
  58. package/dist/common/EncryptionScheme.d.ts +21 -0
  59. package/dist/common/EncryptionScheme.d.ts.map +1 -0
  60. package/dist/common/EncryptionScheme.js +13 -0
  61. package/dist/common/EncryptionScheme.js.map +1 -0
  62. package/dist/common/FAIRPLAY_KEY_SYSTEM.d.ts +8 -0
  63. package/dist/common/FAIRPLAY_KEY_SYSTEM.d.ts.map +1 -0
  64. package/dist/common/FAIRPLAY_KEY_SYSTEM.js +8 -0
  65. package/dist/common/FAIRPLAY_KEY_SYSTEM.js.map +1 -0
  66. package/dist/common/FAIRPLAY_UUID.d.ts +8 -0
  67. package/dist/common/FAIRPLAY_UUID.d.ts.map +1 -0
  68. package/dist/common/FAIRPLAY_UUID.js +8 -0
  69. package/dist/common/FAIRPLAY_UUID.js.map +1 -0
  70. package/dist/common/HTTP_HEADERS.d.ts +8 -0
  71. package/dist/common/HTTP_HEADERS.d.ts.map +1 -0
  72. package/dist/common/HTTP_HEADERS.js +8 -0
  73. package/dist/common/HTTP_HEADERS.js.map +1 -0
  74. package/dist/common/HW_SECURE_ALL.d.ts +8 -0
  75. package/dist/common/HW_SECURE_ALL.d.ts.map +1 -0
  76. package/dist/common/HW_SECURE_ALL.js +8 -0
  77. package/dist/common/HW_SECURE_ALL.js.map +1 -0
  78. package/dist/common/HW_SECURE_CRYPTO.d.ts +8 -0
  79. package/dist/common/HW_SECURE_CRYPTO.d.ts.map +1 -0
  80. package/dist/common/HW_SECURE_CRYPTO.js +8 -0
  81. package/dist/common/HW_SECURE_CRYPTO.js.map +1 -0
  82. package/dist/common/HW_SECURE_DECODE.d.ts +8 -0
  83. package/dist/common/HW_SECURE_DECODE.d.ts.map +1 -0
  84. package/dist/common/HW_SECURE_DECODE.js +8 -0
  85. package/dist/common/HW_SECURE_DECODE.js.map +1 -0
  86. package/dist/common/INDIVIDUALIZATION_REQUEST.d.ts +8 -0
  87. package/dist/common/INDIVIDUALIZATION_REQUEST.d.ts.map +1 -0
  88. package/dist/common/INDIVIDUALIZATION_REQUEST.js +8 -0
  89. package/dist/common/INDIVIDUALIZATION_REQUEST.js.map +1 -0
  90. package/dist/common/INTERNAL_ERROR.d.ts +8 -0
  91. package/dist/common/INTERNAL_ERROR.d.ts.map +1 -0
  92. package/dist/common/INTERNAL_ERROR.js +8 -0
  93. package/dist/common/INTERNAL_ERROR.js.map +1 -0
  94. package/dist/common/InitializationDataType.d.ts +25 -0
  95. package/dist/common/InitializationDataType.d.ts.map +1 -0
  96. package/dist/common/InitializationDataType.js +17 -0
  97. package/dist/common/InitializationDataType.js.map +1 -0
  98. package/dist/common/KEYIDS.d.ts +8 -0
  99. package/dist/common/KEYIDS.d.ts.map +1 -0
  100. package/dist/common/KEYIDS.js +8 -0
  101. package/dist/common/KEYIDS.js.map +1 -0
  102. package/dist/common/LICENSE_ACQUISITION.d.ts +8 -0
  103. package/dist/common/LICENSE_ACQUISITION.d.ts.map +1 -0
  104. package/dist/common/LICENSE_ACQUISITION.js +8 -0
  105. package/dist/common/LICENSE_ACQUISITION.js.map +1 -0
  106. package/dist/common/LICENSE_RELEASE.d.ts +8 -0
  107. package/dist/common/LICENSE_RELEASE.d.ts.map +1 -0
  108. package/dist/common/LICENSE_RELEASE.js +8 -0
  109. package/dist/common/LICENSE_RELEASE.js.map +1 -0
  110. package/dist/common/LICENSE_RENEWAL.d.ts +8 -0
  111. package/dist/common/LICENSE_RENEWAL.d.ts.map +1 -0
  112. package/dist/common/LICENSE_RENEWAL.js +8 -0
  113. package/dist/common/LICENSE_RENEWAL.js.map +1 -0
  114. package/dist/common/LICENSE_REQUEST.d.ts +8 -0
  115. package/dist/common/LICENSE_REQUEST.d.ts.map +1 -0
  116. package/dist/common/LICENSE_REQUEST.js +8 -0
  117. package/dist/common/LICENSE_REQUEST.js.map +1 -0
  118. package/dist/common/LicenseRequest.d.ts +45 -0
  119. package/dist/common/LicenseRequest.d.ts.map +1 -0
  120. package/dist/common/LicenseRequest.js +2 -0
  121. package/dist/common/LicenseRequest.js.map +1 -0
  122. package/dist/common/MP4_PROTECTION_SCHEME.d.ts +7 -0
  123. package/dist/common/MP4_PROTECTION_SCHEME.d.ts.map +1 -0
  124. package/dist/common/MP4_PROTECTION_SCHEME.js +7 -0
  125. package/dist/common/MP4_PROTECTION_SCHEME.js.map +1 -0
  126. package/dist/common/MediaKeyMessageType.d.ts +25 -0
  127. package/dist/common/MediaKeyMessageType.d.ts.map +1 -0
  128. package/dist/common/MediaKeyMessageType.js +17 -0
  129. package/dist/common/MediaKeyMessageType.js.map +1 -0
  130. package/dist/common/MediaKeyStatus.d.ts +31 -0
  131. package/dist/common/MediaKeyStatus.d.ts.map +1 -0
  132. package/dist/common/MediaKeyStatus.js +23 -0
  133. package/dist/common/MediaKeyStatus.js.map +1 -0
  134. package/dist/common/MediaKeySystemAccessRequest.d.ts +11 -0
  135. package/dist/common/MediaKeySystemAccessRequest.d.ts.map +1 -0
  136. package/dist/common/MediaKeySystemAccessRequest.js +2 -0
  137. package/dist/common/MediaKeySystemAccessRequest.js.map +1 -0
  138. package/dist/common/OUTPUT_DOWNSCALED.d.ts +8 -0
  139. package/dist/common/OUTPUT_DOWNSCALED.d.ts.map +1 -0
  140. package/dist/common/OUTPUT_DOWNSCALED.js +8 -0
  141. package/dist/common/OUTPUT_DOWNSCALED.js.map +1 -0
  142. package/dist/common/OUTPUT_RESTRICTED.d.ts +8 -0
  143. package/dist/common/OUTPUT_RESTRICTED.d.ts.map +1 -0
  144. package/dist/common/OUTPUT_RESTRICTED.js +8 -0
  145. package/dist/common/OUTPUT_RESTRICTED.js.map +1 -0
  146. package/dist/common/PLAYREADY_KEY_MESSAGE.d.ts +8 -0
  147. package/dist/common/PLAYREADY_KEY_MESSAGE.d.ts.map +1 -0
  148. package/dist/common/PLAYREADY_KEY_MESSAGE.js +8 -0
  149. package/dist/common/PLAYREADY_KEY_MESSAGE.js.map +1 -0
  150. package/dist/common/PLAYREADY_KEY_SYSTEM.d.ts +8 -0
  151. package/dist/common/PLAYREADY_KEY_SYSTEM.d.ts.map +1 -0
  152. package/dist/common/PLAYREADY_KEY_SYSTEM.js +8 -0
  153. package/dist/common/PLAYREADY_KEY_SYSTEM.js.map +1 -0
  154. package/dist/common/PLAYREADY_RECOMMENDATION_KEY_SYSTEM.d.ts +8 -0
  155. package/dist/common/PLAYREADY_RECOMMENDATION_KEY_SYSTEM.d.ts.map +1 -0
  156. package/dist/common/PLAYREADY_RECOMMENDATION_KEY_SYSTEM.js +8 -0
  157. package/dist/common/PLAYREADY_RECOMMENDATION_KEY_SYSTEM.js.map +1 -0
  158. package/dist/common/PLAYREADY_UUID.d.ts +8 -0
  159. package/dist/common/PLAYREADY_UUID.d.ts.map +1 -0
  160. package/dist/common/PLAYREADY_UUID.js +8 -0
  161. package/dist/common/PLAYREADY_UUID.js.map +1 -0
  162. package/dist/common/RELEASED.d.ts +8 -0
  163. package/dist/common/RELEASED.d.ts.map +1 -0
  164. package/dist/common/RELEASED.js +8 -0
  165. package/dist/common/RELEASED.js.map +1 -0
  166. package/dist/common/STATUS_PENDING.d.ts +8 -0
  167. package/dist/common/STATUS_PENDING.d.ts.map +1 -0
  168. package/dist/common/STATUS_PENDING.js +8 -0
  169. package/dist/common/STATUS_PENDING.js.map +1 -0
  170. package/dist/common/SW_SECURE_CRYPTO.d.ts +8 -0
  171. package/dist/common/SW_SECURE_CRYPTO.d.ts.map +1 -0
  172. package/dist/common/SW_SECURE_CRYPTO.js +8 -0
  173. package/dist/common/SW_SECURE_CRYPTO.js.map +1 -0
  174. package/dist/common/SW_SECURE_DECODE.d.ts +8 -0
  175. package/dist/common/SW_SECURE_DECODE.d.ts.map +1 -0
  176. package/dist/common/SW_SECURE_DECODE.js +8 -0
  177. package/dist/common/SW_SECURE_DECODE.js.map +1 -0
  178. package/dist/common/TEXT_XML_UTF8.d.ts +8 -0
  179. package/dist/common/TEXT_XML_UTF8.d.ts.map +1 -0
  180. package/dist/common/TEXT_XML_UTF8.js +8 -0
  181. package/dist/common/TEXT_XML_UTF8.js.map +1 -0
  182. package/dist/common/USABLE.d.ts +8 -0
  183. package/dist/common/USABLE.d.ts.map +1 -0
  184. package/dist/common/USABLE.js +8 -0
  185. package/dist/common/USABLE.js.map +1 -0
  186. package/dist/common/W3C_CLEAR_KEY_UUID.d.ts +8 -0
  187. package/dist/common/W3C_CLEAR_KEY_UUID.d.ts.map +1 -0
  188. package/dist/common/W3C_CLEAR_KEY_UUID.js +8 -0
  189. package/dist/common/W3C_CLEAR_KEY_UUID.js.map +1 -0
  190. package/dist/common/WEBM.d.ts +8 -0
  191. package/dist/common/WEBM.d.ts.map +1 -0
  192. package/dist/common/WEBM.js +8 -0
  193. package/dist/common/WEBM.js.map +1 -0
  194. package/dist/common/WIDEVINE_KEY_SYSTEM.d.ts +8 -0
  195. package/dist/common/WIDEVINE_KEY_SYSTEM.d.ts.map +1 -0
  196. package/dist/common/WIDEVINE_KEY_SYSTEM.js +8 -0
  197. package/dist/common/WIDEVINE_KEY_SYSTEM.js.map +1 -0
  198. package/dist/common/WIDEVINE_UUID.d.ts +8 -0
  199. package/dist/common/WIDEVINE_UUID.d.ts.map +1 -0
  200. package/dist/common/WIDEVINE_UUID.js +8 -0
  201. package/dist/common/WIDEVINE_UUID.js.map +1 -0
  202. package/dist/common/WidevineRobustness.d.ts +27 -0
  203. package/dist/common/WidevineRobustness.d.ts.map +1 -0
  204. package/dist/common/WidevineRobustness.js +19 -0
  205. package/dist/common/WidevineRobustness.js.map +1 -0
  206. package/dist/fairplay/concatInitDataIdAndCertificate.d.ts +15 -0
  207. package/dist/fairplay/concatInitDataIdAndCertificate.d.ts.map +1 -0
  208. package/dist/fairplay/concatInitDataIdAndCertificate.js +33 -0
  209. package/dist/fairplay/concatInitDataIdAndCertificate.js.map +1 -0
  210. package/dist/fairplay/decodeFairPlayLicense.d.ts +13 -0
  211. package/dist/fairplay/decodeFairPlayLicense.d.ts.map +1 -0
  212. package/dist/fairplay/decodeFairPlayLicense.js +18 -0
  213. package/dist/fairplay/decodeFairPlayLicense.js.map +1 -0
  214. package/dist/fairplay/extractContentId.d.ts +14 -0
  215. package/dist/fairplay/extractContentId.d.ts.map +1 -0
  216. package/dist/fairplay/extractContentId.js +19 -0
  217. package/dist/fairplay/extractContentId.js.map +1 -0
  218. package/dist/fairplay/getId.d.ts +15 -0
  219. package/dist/fairplay/getId.d.ts.map +1 -0
  220. package/dist/fairplay/getId.js +27 -0
  221. package/dist/fairplay/getId.js.map +1 -0
  222. package/dist/fairplay/getLicenseServerUrl.d.ts +13 -0
  223. package/dist/fairplay/getLicenseServerUrl.d.ts.map +1 -0
  224. package/dist/fairplay/getLicenseServerUrl.js +22 -0
  225. package/dist/fairplay/getLicenseServerUrl.js.map +1 -0
  226. package/dist/index.d.ts +71 -0
  227. package/dist/index.d.ts.map +1 -0
  228. package/dist/index.js +73 -0
  229. package/dist/index.js.map +1 -0
  230. package/dist/keysystem/createMediaKeySystemConfiguration.d.ts +14 -0
  231. package/dist/keysystem/createMediaKeySystemConfiguration.d.ts.map +1 -0
  232. package/dist/keysystem/createMediaKeySystemConfiguration.js +27 -0
  233. package/dist/keysystem/createMediaKeySystemConfiguration.js.map +1 -0
  234. package/dist/keysystem/getKeySystemAccess.d.ts +11 -0
  235. package/dist/keysystem/getKeySystemAccess.d.ts.map +1 -0
  236. package/dist/keysystem/getKeySystemAccess.js +20 -0
  237. package/dist/keysystem/getKeySystemAccess.js.map +1 -0
  238. package/dist/keysystem/getLegacyKeySystemAccess.d.ts +11 -0
  239. package/dist/keysystem/getLegacyKeySystemAccess.d.ts.map +1 -0
  240. package/dist/keysystem/getLegacyKeySystemAccess.js +24 -0
  241. package/dist/keysystem/getLegacyKeySystemAccess.js.map +1 -0
  242. package/dist/keysystem/getSupportedKeySystemConfiguration.d.ts +14 -0
  243. package/dist/keysystem/getSupportedKeySystemConfiguration.d.ts.map +1 -0
  244. package/dist/keysystem/getSupportedKeySystemConfiguration.js +28 -0
  245. package/dist/keysystem/getSupportedKeySystemConfiguration.js.map +1 -0
  246. package/dist/playready/getLicenseRequestFromMessage.d.ts +15 -0
  247. package/dist/playready/getLicenseRequestFromMessage.d.ts.map +1 -0
  248. package/dist/playready/getLicenseRequestFromMessage.js +41 -0
  249. package/dist/playready/getLicenseRequestFromMessage.js.map +1 -0
  250. package/dist/playready/getRequestHeadersFromMessage.d.ts +16 -0
  251. package/dist/playready/getRequestHeadersFromMessage.d.ts.map +1 -0
  252. package/dist/playready/getRequestHeadersFromMessage.js +52 -0
  253. package/dist/playready/getRequestHeadersFromMessage.js.map +1 -0
  254. package/dist/playready/toBigEndianKeyId.d.ts +13 -0
  255. package/dist/playready/toBigEndianKeyId.d.ts.map +1 -0
  256. package/dist/playready/toBigEndianKeyId.js +23 -0
  257. package/dist/playready/toBigEndianKeyId.js.map +1 -0
  258. package/dist/tsconfig.tsbuildinfo +1 -0
  259. package/dist/tsdoc-metadata.json +11 -0
  260. package/package.json +79 -0
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Widevine Key System.
3
+ *
4
+ *
5
+ * @beta
6
+ */
7
+ export declare const WIDEVINE_KEY_SYSTEM = "com.widevine.alpha";
8
+ //# sourceMappingURL=WIDEVINE_KEY_SYSTEM.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WIDEVINE_KEY_SYSTEM.d.ts","sourceRoot":"","sources":["../../src/common/WIDEVINE_KEY_SYSTEM.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,uBAAuB,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Widevine Key System.
3
+ *
4
+ *
5
+ * @beta
6
+ */
7
+ export const WIDEVINE_KEY_SYSTEM = 'com.widevine.alpha';
8
+ //# sourceMappingURL=WIDEVINE_KEY_SYSTEM.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WIDEVINE_KEY_SYSTEM.js","sourceRoot":"","sources":["../../src/common/WIDEVINE_KEY_SYSTEM.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,oBAAoB,CAAC","sourcesContent":["/**\n * Widevine Key System.\n *\n *\n * @beta\n */\nexport const WIDEVINE_KEY_SYSTEM = 'com.widevine.alpha';\n"]}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Widevine UUID.
3
+ *
4
+ *
5
+ * @beta
6
+ */
7
+ export declare const WIDEVINE_UUID = "edef8ba9-79d6-4ace-a3c8-27dcd51d21ed";
8
+ //# sourceMappingURL=WIDEVINE_UUID.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WIDEVINE_UUID.d.ts","sourceRoot":"","sources":["../../src/common/WIDEVINE_UUID.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,eAAO,MAAM,aAAa,yCAAyC,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Widevine UUID.
3
+ *
4
+ *
5
+ * @beta
6
+ */
7
+ export const WIDEVINE_UUID = 'edef8ba9-79d6-4ace-a3c8-27dcd51d21ed';
8
+ //# sourceMappingURL=WIDEVINE_UUID.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WIDEVINE_UUID.js","sourceRoot":"","sources":["../../src/common/WIDEVINE_UUID.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,sCAAsC,CAAC","sourcesContent":["/**\n * Widevine UUID.\n *\n *\n * @beta\n */\nexport const WIDEVINE_UUID = 'edef8ba9-79d6-4ace-a3c8-27dcd51d21ed';\n"]}
@@ -0,0 +1,27 @@
1
+ import type { ValueOf } from '@svta/cml-utils/ValueOf.js';
2
+ import { HW_SECURE_ALL } from './HW_SECURE_ALL.js';
3
+ import { HW_SECURE_CRYPTO } from './HW_SECURE_CRYPTO.js';
4
+ import { HW_SECURE_DECODE } from './HW_SECURE_DECODE.js';
5
+ import { SW_SECURE_CRYPTO } from './SW_SECURE_CRYPTO.js';
6
+ import { SW_SECURE_DECODE } from './SW_SECURE_DECODE.js';
7
+ /**
8
+ * Widevine Robustness.
9
+ *
10
+ *
11
+ * @beta
12
+ */
13
+ export declare const WidevineRobustness: {
14
+ readonly SW_SECURE_CRYPTO: typeof SW_SECURE_CRYPTO;
15
+ readonly SW_SECURE_DECODE: typeof SW_SECURE_DECODE;
16
+ readonly HW_SECURE_CRYPTO: typeof HW_SECURE_CRYPTO;
17
+ readonly HW_SECURE_DECODE: typeof HW_SECURE_DECODE;
18
+ readonly HW_SECURE_ALL: typeof HW_SECURE_ALL;
19
+ };
20
+ /**
21
+ * Widevine Robustness.
22
+ *
23
+ *
24
+ * @beta
25
+ */
26
+ export type WidevineRobustness = ValueOf<typeof WidevineRobustness>;
27
+ //# sourceMappingURL=WidevineRobustness.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WidevineRobustness.d.ts","sourceRoot":"","sources":["../../src/common/WidevineRobustness.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB;+BACQ,OAAO,gBAAgB;+BACvB,OAAO,gBAAgB;+BACvB,OAAO,gBAAgB;+BACvB,OAAO,gBAAgB;4BAC7B,OAAO,aAAa;CAC3C,CAAC;AAEX;;;;;GAKG;AACH,MAAM,MAAM,kBAAkB,GAAG,OAAO,CAAC,OAAO,kBAAkB,CAAC,CAAC"}
@@ -0,0 +1,19 @@
1
+ import { HW_SECURE_ALL } from './HW_SECURE_ALL.js';
2
+ import { HW_SECURE_CRYPTO } from './HW_SECURE_CRYPTO.js';
3
+ import { HW_SECURE_DECODE } from './HW_SECURE_DECODE.js';
4
+ import { SW_SECURE_CRYPTO } from './SW_SECURE_CRYPTO.js';
5
+ import { SW_SECURE_DECODE } from './SW_SECURE_DECODE.js';
6
+ /**
7
+ * Widevine Robustness.
8
+ *
9
+ *
10
+ * @beta
11
+ */
12
+ export const WidevineRobustness = {
13
+ SW_SECURE_CRYPTO: SW_SECURE_CRYPTO,
14
+ SW_SECURE_DECODE: SW_SECURE_DECODE,
15
+ HW_SECURE_CRYPTO: HW_SECURE_CRYPTO,
16
+ HW_SECURE_DECODE: HW_SECURE_DECODE,
17
+ HW_SECURE_ALL: HW_SECURE_ALL,
18
+ };
19
+ //# sourceMappingURL=WidevineRobustness.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WidevineRobustness.js","sourceRoot":"","sources":["../../src/common/WidevineRobustness.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG;IACjC,gBAAgB,EAAE,gBAA2C;IAC7D,gBAAgB,EAAE,gBAA2C;IAC7D,gBAAgB,EAAE,gBAA2C;IAC7D,gBAAgB,EAAE,gBAA2C;IAC7D,aAAa,EAAE,aAAqC;CAC3C,CAAC","sourcesContent":["import type { ValueOf } from '@svta/cml-utils/ValueOf.js';\nimport { HW_SECURE_ALL } from './HW_SECURE_ALL.js';\nimport { HW_SECURE_CRYPTO } from './HW_SECURE_CRYPTO.js';\nimport { HW_SECURE_DECODE } from './HW_SECURE_DECODE.js';\nimport { SW_SECURE_CRYPTO } from './SW_SECURE_CRYPTO.js';\nimport { SW_SECURE_DECODE } from './SW_SECURE_DECODE.js';\n\n/**\n * Widevine Robustness.\n *\n *\n * @beta\n */\nexport const WidevineRobustness = {\n\tSW_SECURE_CRYPTO: SW_SECURE_CRYPTO as typeof SW_SECURE_CRYPTO,\n\tSW_SECURE_DECODE: SW_SECURE_DECODE as typeof SW_SECURE_DECODE,\n\tHW_SECURE_CRYPTO: HW_SECURE_CRYPTO as typeof HW_SECURE_CRYPTO,\n\tHW_SECURE_DECODE: HW_SECURE_DECODE as typeof HW_SECURE_DECODE,\n\tHW_SECURE_ALL: HW_SECURE_ALL as typeof HW_SECURE_ALL,\n} as const;\n\n/**\n * Widevine Robustness.\n *\n *\n * @beta\n */\nexport type WidevineRobustness = ValueOf<typeof WidevineRobustness>;\n"]}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Concatenates InitData, ID, and Certificate for FairPlay DRM.
3
+ *
4
+ * @param initData - The initialization data (PSSH box)
5
+ * @param id - The content ID (string or Uint16Array)
6
+ * @param cert - The application certificate (Uint8Array)
7
+ * @returns A Uint8Array containing the concatenated data
8
+ *
9
+ * @beta
10
+ *
11
+ * @example
12
+ * {@includeCode ../../test/fairplay/concatInitDataIdAndCertificate.test.ts#example}
13
+ */
14
+ export declare function concatInitDataIdAndCertificate(initData: Uint16Array, id: Uint16Array | string, cert: Uint8Array): Uint8Array;
15
+ //# sourceMappingURL=concatInitDataIdAndCertificate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"concatInitDataIdAndCertificate.d.ts","sourceRoot":"","sources":["../../src/fairplay/concatInitDataIdAndCertificate.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;GAYG;AAEH,wBAAgB,8BAA8B,CAAC,QAAQ,EAAE,WAAW,EAAE,EAAE,EAAE,WAAW,GAAG,MAAM,EAAE,IAAI,EAAE,UAAU,GAAG,UAAU,CAqB5H"}
@@ -0,0 +1,33 @@
1
+ import { stringToUint16 } from '@svta/cml-utils/stringToUint16.js';
2
+ /**
3
+ * Concatenates InitData, ID, and Certificate for FairPlay DRM.
4
+ *
5
+ * @param initData - The initialization data (PSSH box)
6
+ * @param id - The content ID (string or Uint16Array)
7
+ * @param cert - The application certificate (Uint8Array)
8
+ * @returns A Uint8Array containing the concatenated data
9
+ *
10
+ * @beta
11
+ *
12
+ * @example
13
+ * {@includeCode ../../test/fairplay/concatInitDataIdAndCertificate.test.ts#example}
14
+ */
15
+ export function concatInitDataIdAndCertificate(initData, id, cert) {
16
+ if (typeof id === 'string') {
17
+ id = stringToUint16(id);
18
+ }
19
+ const buffer = new ArrayBuffer(initData.byteLength + 4 + id.byteLength + 4 + cert.byteLength);
20
+ const dataView = new DataView(buffer);
21
+ let offset = 0;
22
+ new Uint8Array(buffer, offset, initData.byteLength).set(initData);
23
+ offset += initData.byteLength;
24
+ dataView.setUint32(offset, id.byteLength, true);
25
+ offset += 4;
26
+ new Uint16Array(buffer, offset, id.length).set(id);
27
+ offset += id.byteLength;
28
+ dataView.setUint32(offset, cert.byteLength, true);
29
+ offset += 4;
30
+ new Uint8Array(buffer, offset, cert.byteLength).set(cert);
31
+ return new Uint8Array(buffer);
32
+ }
33
+ //# sourceMappingURL=concatInitDataIdAndCertificate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"concatInitDataIdAndCertificate.js","sourceRoot":"","sources":["../../src/fairplay/concatInitDataIdAndCertificate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAEnE;;;;;;;;;;;;GAYG;AAEH,MAAM,UAAU,8BAA8B,CAAC,QAAqB,EAAE,EAAwB,EAAE,IAAgB;IAC/G,IAAI,OAAO,EAAE,KAAK,QAAQ,EAAE,CAAC;QAC5B,EAAE,GAAG,cAAc,CAAC,EAAE,CAAC,CAAC;IACzB,CAAC;IACD,MAAM,MAAM,GAAG,IAAI,WAAW,CAAC,QAAQ,CAAC,UAAU,GAAG,CAAC,GAAG,EAAE,CAAC,UAAU,GAAG,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC;IAC9F,MAAM,QAAQ,GAAG,IAAI,QAAQ,CAAC,MAAM,CAAC,CAAC;IACtC,IAAI,MAAM,GAAG,CAAC,CAAC;IAEf,IAAI,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IAClE,MAAM,IAAI,QAAQ,CAAC,UAAU,CAAC;IAE9B,QAAQ,CAAC,SAAS,CAAC,MAAM,EAAE,EAAE,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;IAChD,MAAM,IAAI,CAAC,CAAC;IACZ,IAAI,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IACnD,MAAM,IAAI,EAAE,CAAC,UAAU,CAAC;IAExB,QAAQ,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;IAClD,MAAM,IAAI,CAAC,CAAC;IACZ,IAAI,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAE1D,OAAO,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC;AAC/B,CAAC","sourcesContent":["import { stringToUint16 } from '@svta/cml-utils/stringToUint16.js';\n\n/**\n * Concatenates InitData, ID, and Certificate for FairPlay DRM.\n *\n * @param initData - The initialization data (PSSH box)\n * @param id - The content ID (string or Uint16Array)\n * @param cert - The application certificate (Uint8Array)\n * @returns A Uint8Array containing the concatenated data\n *\n * @beta\n *\n * @example\n * {@includeCode ../../test/fairplay/concatInitDataIdAndCertificate.test.ts#example}\n */\n\nexport function concatInitDataIdAndCertificate(initData: Uint16Array, id: Uint16Array | string, cert: Uint8Array): Uint8Array {\n\tif (typeof id === 'string') {\n\t\tid = stringToUint16(id);\n\t}\n\tconst buffer = new ArrayBuffer(initData.byteLength + 4 + id.byteLength + 4 + cert.byteLength);\n\tconst dataView = new DataView(buffer);\n\tlet offset = 0;\n\n\tnew Uint8Array(buffer, offset, initData.byteLength).set(initData);\n\toffset += initData.byteLength;\n\n\tdataView.setUint32(offset, id.byteLength, true);\n\toffset += 4;\n\tnew Uint16Array(buffer, offset, id.length).set(id);\n\toffset += id.byteLength;\n\n\tdataView.setUint32(offset, cert.byteLength, true);\n\toffset += 4;\n\tnew Uint8Array(buffer, offset, cert.byteLength).set(cert);\n\n\treturn new Uint8Array(buffer);\n}\n"]}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Decodes a FairPlay DRM license response.
3
+ *
4
+ * @param response - The license response, either a base64 string or ArrayBuffer
5
+ * @returns A Uint8Array containing the decoded license
6
+ *
7
+ * @beta
8
+ *
9
+ * @example
10
+ * {@includeCode ../../test/fairplay/decodeFairPlayLicense.test.ts#example}
11
+ */
12
+ export declare function decodeFairPlayLicense(response: string | ArrayBuffer): Uint8Array;
13
+ //# sourceMappingURL=decodeFairPlayLicense.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"decodeFairPlayLicense.d.ts","sourceRoot":"","sources":["../../src/fairplay/decodeFairPlayLicense.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;AAEH,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,MAAM,GAAG,WAAW,GAAG,UAAU,CAIhF"}
@@ -0,0 +1,18 @@
1
+ import { decodeBase64 } from '@svta/cml-utils/decodeBase64.js';
2
+ /**
3
+ * Decodes a FairPlay DRM license response.
4
+ *
5
+ * @param response - The license response, either a base64 string or ArrayBuffer
6
+ * @returns A Uint8Array containing the decoded license
7
+ *
8
+ * @beta
9
+ *
10
+ * @example
11
+ * {@includeCode ../../test/fairplay/decodeFairPlayLicense.test.ts#example}
12
+ */
13
+ export function decodeFairPlayLicense(response) {
14
+ return typeof response === 'string'
15
+ ? decodeBase64(response)
16
+ : new Uint8Array(response);
17
+ }
18
+ //# sourceMappingURL=decodeFairPlayLicense.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"decodeFairPlayLicense.js","sourceRoot":"","sources":["../../src/fairplay/decodeFairPlayLicense.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAE/D;;;;;;;;;;GAUG;AAEH,MAAM,UAAU,qBAAqB,CAAC,QAA8B;IACnE,OAAO,OAAO,QAAQ,KAAK,QAAQ;QAClC,CAAC,CAAC,YAAY,CAAC,QAAQ,CAAC;QACxB,CAAC,CAAC,IAAI,UAAU,CAAC,QAAQ,CAAC,CAAC;AAC7B,CAAC","sourcesContent":["import { decodeBase64 } from '@svta/cml-utils/decodeBase64.js';\n\n/**\n * Decodes a FairPlay DRM license response.\n *\n * @param response - The license response, either a base64 string or ArrayBuffer\n * @returns A Uint8Array containing the decoded license\n *\n * @beta\n *\n * @example\n * {@includeCode ../../test/fairplay/decodeFairPlayLicense.test.ts#example}\n */\n\nexport function decodeFairPlayLicense(response: string | ArrayBuffer): Uint8Array {\n\treturn typeof response === 'string'\n\t\t? decodeBase64(response)\n\t\t: new Uint8Array(response);\n}\n"]}
@@ -0,0 +1,14 @@
1
+ import type { Encoding } from '@svta/cml-utils/Encoding.js';
2
+ /**
3
+ * Extracts the content ID from InitData using skd:// URI or query parameters.
4
+ *
5
+ * @param initData - The initialization data (PSSH box)
6
+ * @returns The extracted content ID
7
+ *
8
+ * @beta
9
+ *
10
+ * @example
11
+ * {@includeCode ../../test/fairplay/extractContentId.test.ts#example}
12
+ */
13
+ export declare function extractContentId(initData: ArrayBuffer, encoding?: Encoding): string;
14
+ //# sourceMappingURL=extractContentId.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extractContentId.d.ts","sourceRoot":"","sources":["../../src/fairplay/extractContentId.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAG5D;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,WAAW,EAAE,QAAQ,GAAE,QAAiB,GAAG,MAAM,CAK3F"}
@@ -0,0 +1,19 @@
1
+ import { decodeText } from '@svta/cml-utils/decodeText.js';
2
+ import { UTF_16 } from '@svta/cml-utils/UTF_16.js';
3
+ /**
4
+ * Extracts the content ID from InitData using skd:// URI or query parameters.
5
+ *
6
+ * @param initData - The initialization data (PSSH box)
7
+ * @returns The extracted content ID
8
+ *
9
+ * @beta
10
+ *
11
+ * @example
12
+ * {@includeCode ../../test/fairplay/extractContentId.test.ts#example}
13
+ */
14
+ export function extractContentId(initData, encoding = UTF_16) {
15
+ const initDataString = decodeText(initData, { encoding });
16
+ // Try extracting skd:// content ID
17
+ return initDataString.split('skd://')[1] || '';
18
+ }
19
+ //# sourceMappingURL=extractContentId.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extractContentId.js","sourceRoot":"","sources":["../../src/fairplay/extractContentId.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAE3D,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AAEnD;;;;;;;;;;GAUG;AACH,MAAM,UAAU,gBAAgB,CAAC,QAAqB,EAAE,WAAqB,MAAM;IAClF,MAAM,cAAc,GAAG,UAAU,CAAC,QAAQ,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC;IAE1D,mCAAmC;IACnC,OAAO,cAAc,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;AAChD,CAAC","sourcesContent":["import { decodeText } from '@svta/cml-utils/decodeText.js';\nimport type { Encoding } from '@svta/cml-utils/Encoding.js';\nimport { UTF_16 } from '@svta/cml-utils/UTF_16.js';\n\n/**\n * Extracts the content ID from InitData using skd:// URI or query parameters.\n *\n * @param initData - The initialization data (PSSH box)\n * @returns The extracted content ID\n *\n * @beta\n *\n * @example\n * {@includeCode ../../test/fairplay/extractContentId.test.ts#example}\n */\nexport function extractContentId(initData: ArrayBuffer, encoding: Encoding = UTF_16): string {\n\tconst initDataString = decodeText(initData, { encoding });\n\n\t// Try extracting skd:// content ID\n\treturn initDataString.split('skd://')[1] || '';\n}\n"]}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Extracts the content ID from the license server URL or InitData.
3
+ *
4
+ * @param licenseServerUrl - The license server URL
5
+ * @param initData - The initialization data (PSSH box)
6
+ * @param queryParam - The query parameter key to extract (default: 'ContentId')
7
+ * @returns The extracted content ID as a string or null if not found
8
+ *
9
+ * @beta
10
+ *
11
+ * @example
12
+ * {@includeCode ../../test/fairplay/getId.test.ts#example}
13
+ */
14
+ export declare function getId(licenseServerUrl: string, initData: ArrayBuffer, queryParam?: string): string;
15
+ //# sourceMappingURL=getId.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getId.d.ts","sourceRoot":"","sources":["../../src/fairplay/getId.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;GAYG;AAEH,wBAAgB,KAAK,CAAC,gBAAgB,EAAE,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,UAAU,GAAE,MAAoB,GAAG,MAAM,CAW/G"}
@@ -0,0 +1,27 @@
1
+ import { extractContentId } from './extractContentId.js';
2
+ /**
3
+ * Extracts the content ID from the license server URL or InitData.
4
+ *
5
+ * @param licenseServerUrl - The license server URL
6
+ * @param initData - The initialization data (PSSH box)
7
+ * @param queryParam - The query parameter key to extract (default: 'ContentId')
8
+ * @returns The extracted content ID as a string or null if not found
9
+ *
10
+ * @beta
11
+ *
12
+ * @example
13
+ * {@includeCode ../../test/fairplay/getId.test.ts#example}
14
+ */
15
+ export function getId(licenseServerUrl, initData, queryParam = 'ContentId') {
16
+ try {
17
+ const url = new URL(licenseServerUrl);
18
+ const params = new URLSearchParams(url.search);
19
+ return params.get(queryParam) || extractContentId(initData);
20
+ }
21
+ catch {
22
+ // in case if URL parsing fails,
23
+ // fallback to extracting from initData
24
+ return extractContentId(initData);
25
+ }
26
+ }
27
+ //# sourceMappingURL=getId.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getId.js","sourceRoot":"","sources":["../../src/fairplay/getId.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD;;;;;;;;;;;;GAYG;AAEH,MAAM,UAAU,KAAK,CAAC,gBAAwB,EAAE,QAAqB,EAAE,aAAqB,WAAW;IACtG,IAAI,CAAC;QACJ,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,gBAAgB,CAAC,CAAC;QACtC,MAAM,MAAM,GAAG,IAAI,eAAe,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QAC/C,OAAO,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAC7D,CAAC;IACD,MAAM,CAAC;QACN,gCAAgC;QAChC,uCAAuC;QACvC,OAAO,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IACnC,CAAC;AACF,CAAC","sourcesContent":["import { extractContentId } from './extractContentId.js';\n\n/**\n * Extracts the content ID from the license server URL or InitData.\n *\n * @param licenseServerUrl - The license server URL\n * @param initData - The initialization data (PSSH box)\n * @param queryParam - The query parameter key to extract (default: 'ContentId')\n * @returns The extracted content ID as a string or null if not found\n *\n * @beta\n *\n * @example\n * {@includeCode ../../test/fairplay/getId.test.ts#example}\n */\n\nexport function getId(licenseServerUrl: string, initData: ArrayBuffer, queryParam: string = 'ContentId'): string {\n\ttry {\n\t\tconst url = new URL(licenseServerUrl);\n\t\tconst params = new URLSearchParams(url.search);\n\t\treturn params.get(queryParam) || extractContentId(initData);\n\t}\n\tcatch {\n\t\t// in case if URL parsing fails,\n\t\t// fallback to extracting from initData\n\t\treturn extractContentId(initData);\n\t}\n}\n"]}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Retrieves the FairPlay license server URL from InitData.
3
+ *
4
+ * @param initData - The initialization data (PSSH box)
5
+ * @returns The license server URL as a string
6
+ *
7
+ * @beta
8
+ *
9
+ * @example
10
+ * {@includeCode ../../test/fairplay/getLicenseServerUrl.test.ts#example}
11
+ */
12
+ export declare function getLicenseServerUrl(initData: Uint16Array): string;
13
+ //# sourceMappingURL=getLicenseServerUrl.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getLicenseServerUrl.d.ts","sourceRoot":"","sources":["../../src/fairplay/getLicenseServerUrl.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,WAAW,GAAG,MAAM,CAUjE"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Retrieves the FairPlay license server URL from InitData.
3
+ *
4
+ * @param initData - The initialization data (PSSH box)
5
+ * @returns The license server URL as a string
6
+ *
7
+ * @beta
8
+ *
9
+ * @example
10
+ * {@includeCode ../../test/fairplay/getLicenseServerUrl.test.ts#example}
11
+ */
12
+ export function getLicenseServerUrl(initData) {
13
+ let initDataString = '';
14
+ for (let i = 0; i < initData.length; i++) {
15
+ if (initData[i] !== 0) { // Ignore null characters
16
+ initDataString += String.fromCharCode(initData[i]);
17
+ }
18
+ }
19
+ const match = initDataString.match(/skd:\/\/([^"\s]+)/);
20
+ return match ? `https://${match[1]}` : '';
21
+ }
22
+ //# sourceMappingURL=getLicenseServerUrl.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getLicenseServerUrl.js","sourceRoot":"","sources":["../../src/fairplay/getLicenseServerUrl.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,MAAM,UAAU,mBAAmB,CAAC,QAAqB;IACxD,IAAI,cAAc,GAAG,EAAE,CAAC;IACxB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QAC1C,IAAI,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,yBAAyB;YACjD,cAAc,IAAI,MAAM,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;QACpD,CAAC;IACF,CAAC;IAED,MAAM,KAAK,GAAG,cAAc,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC;IACxD,OAAO,KAAK,CAAC,CAAC,CAAC,WAAW,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;AAC3C,CAAC","sourcesContent":["/**\n * Retrieves the FairPlay license server URL from InitData.\n *\n * @param initData - The initialization data (PSSH box)\n * @returns The license server URL as a string\n *\n * @beta\n *\n * @example\n * {@includeCode ../../test/fairplay/getLicenseServerUrl.test.ts#example}\n */\n\nexport function getLicenseServerUrl(initData: Uint16Array): string {\n\tlet initDataString = '';\n\tfor (let i = 0; i < initData.length; i++) {\n\t\tif (initData[i] !== 0) { // Ignore null characters\n\t\t\tinitDataString += String.fromCharCode(initData[i]);\n\t\t}\n\t}\n\n\tconst match = initDataString.match(/skd:\\/\\/([^\"\\s]+)/);\n\treturn match ? `https://${match[1]}` : '';\n}\n"]}
@@ -0,0 +1,71 @@
1
+ /**
2
+ * A collection of tools for working with DRM.
3
+ *
4
+ * @packageDocumentation
5
+ *
6
+ * @beta
7
+ */
8
+ export * from './cenc/findCencContentProtection.js';
9
+ export * from './cenc/getLicenseServerUrlFromContentProtection.js';
10
+ export * from './cenc/getPsshData.js';
11
+ export * from './cenc/getPsshForKeySystem.js';
12
+ export * from './cenc/parseInitDataFromContentProtection.js';
13
+ export * from './cenc/parsePsshList.js';
14
+ export * from './keysystem/createMediaKeySystemConfiguration.js';
15
+ export * from './keysystem/getKeySystemAccess.js';
16
+ export * from './keysystem/getLegacyKeySystemAccess.js';
17
+ export * from './keysystem/getSupportedKeySystemConfiguration.js';
18
+ export * from './fairplay/concatInitDataIdAndCertificate.js';
19
+ export * from './fairplay/decodeFairPlayLicense.js';
20
+ export * from './fairplay/extractContentId.js';
21
+ export * from './fairplay/getId.js';
22
+ export * from './fairplay/getLicenseServerUrl.js';
23
+ export * from './playready/getLicenseRequestFromMessage.js';
24
+ export * from './playready/getRequestHeadersFromMessage.js';
25
+ export * from './playready/toBigEndianKeyId.js';
26
+ export type * from './common/ContentProtection.js';
27
+ export type * from './common/LicenseRequest.js';
28
+ export type * from './common/MediaKeySystemAccessRequest.js';
29
+ export * from './common/CBCS.js';
30
+ export * from './common/CENC.js';
31
+ export * from './common/CHALLENGE.js';
32
+ export * from './common/CLEAR_KEY_SYSTEM.js';
33
+ export * from './common/CLEAR_KEY_UUID.js';
34
+ export * from './common/CONTENT_TYPE.js';
35
+ export * from './common/EncryptionScheme.js';
36
+ export * from './common/EXPIRED.js';
37
+ export * from './common/FAIRPLAY_KEY_SYSTEM.js';
38
+ export * from './common/FAIRPLAY_UUID.js';
39
+ export * from './common/HTTP_HEADERS.js';
40
+ export * from './common/HW_SECURE_ALL.js';
41
+ export * from './common/HW_SECURE_CRYPTO.js';
42
+ export * from './common/HW_SECURE_DECODE.js';
43
+ export * from './common/INDIVIDUALIZATION_REQUEST.js';
44
+ export * from './common/InitializationDataType.js';
45
+ export * from './common/INTERNAL_ERROR.js';
46
+ export * from './common/KEYIDS.js';
47
+ export * from './common/LICENSE_ACQUISITION.js';
48
+ export * from './common/LICENSE_RELEASE.js';
49
+ export * from './common/LICENSE_RENEWAL.js';
50
+ export * from './common/LICENSE_REQUEST.js';
51
+ export * from './common/MediaKeyMessageType.js';
52
+ export * from './common/MediaKeyStatus.js';
53
+ export * from './common/MP4_PROTECTION_SCHEME.js';
54
+ export * from './common/OUTPUT_DOWNSCALED.js';
55
+ export * from './common/OUTPUT_RESTRICTED.js';
56
+ export * from './common/PLAYREADY_KEY_MESSAGE.js';
57
+ export * from './common/PLAYREADY_KEY_SYSTEM.js';
58
+ export * from './common/PLAYREADY_RECOMMENDATION_KEY_SYSTEM.js';
59
+ export * from './common/PLAYREADY_UUID.js';
60
+ export * from './common/RELEASED.js';
61
+ export * from './common/STATUS_PENDING.js';
62
+ export * from './common/SW_SECURE_CRYPTO.js';
63
+ export * from './common/SW_SECURE_DECODE.js';
64
+ export * from './common/TEXT_XML_UTF8.js';
65
+ export * from './common/USABLE.js';
66
+ export * from './common/W3C_CLEAR_KEY_UUID.js';
67
+ export * from './common/WEBM.js';
68
+ export * from './common/WIDEVINE_KEY_SYSTEM.js';
69
+ export * from './common/WIDEVINE_UUID.js';
70
+ export * from './common/WidevineRobustness.js';
71
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,cAAc,qCAAqC,CAAC;AACpD,cAAc,oDAAoD,CAAC;AACnE,cAAc,uBAAuB,CAAC;AACtC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,8CAA8C,CAAC;AAC7D,cAAc,yBAAyB,CAAC;AAGxC,cAAc,kDAAkD,CAAC;AACjE,cAAc,mCAAmC,CAAC;AAClD,cAAc,yCAAyC,CAAC;AACxD,cAAc,mDAAmD,CAAC;AAGlE,cAAc,8CAA8C,CAAC;AAC7D,cAAc,qCAAqC,CAAC;AACpD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,qBAAqB,CAAC;AACpC,cAAc,mCAAmC,CAAC;AAGlD,cAAc,6CAA6C,CAAC;AAC5D,cAAc,6CAA6C,CAAC;AAC5D,cAAc,iCAAiC,CAAC;AAGhD,mBAAmB,+BAA+B,CAAC;AACnD,mBAAmB,4BAA4B,CAAC;AAChD,mBAAmB,yCAAyC,CAAC;AAG7D,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,0BAA0B,CAAC;AACzC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,qBAAqB,CAAC;AACpC,cAAc,iCAAiC,CAAC;AAChD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,uCAAuC,CAAC;AACtD,cAAc,oCAAoC,CAAC;AACnD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,oBAAoB,CAAC;AACnC,cAAc,iCAAiC,CAAC;AAChD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,iCAAiC,CAAC;AAChD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,mCAAmC,CAAC;AAClD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,mCAAmC,CAAC;AAClD,cAAc,kCAAkC,CAAC;AACjD,cAAc,iDAAiD,CAAC;AAChE,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sBAAsB,CAAC;AACrC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oBAAoB,CAAC;AACnC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,kBAAkB,CAAC;AACjC,cAAc,iCAAiC,CAAC;AAChD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,gCAAgC,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,73 @@
1
+ /**
2
+ * A collection of tools for working with DRM.
3
+ *
4
+ * @packageDocumentation
5
+ *
6
+ * @beta
7
+ */
8
+ // common utils
9
+ export * from './cenc/findCencContentProtection.js';
10
+ export * from './cenc/getLicenseServerUrlFromContentProtection.js';
11
+ export * from './cenc/getPsshData.js';
12
+ export * from './cenc/getPsshForKeySystem.js';
13
+ export * from './cenc/parseInitDataFromContentProtection.js';
14
+ export * from './cenc/parsePsshList.js';
15
+ // key system utils
16
+ export * from './keysystem/createMediaKeySystemConfiguration.js';
17
+ export * from './keysystem/getKeySystemAccess.js';
18
+ export * from './keysystem/getLegacyKeySystemAccess.js';
19
+ export * from './keysystem/getSupportedKeySystemConfiguration.js';
20
+ // fairplay utilities
21
+ export * from './fairplay/concatInitDataIdAndCertificate.js';
22
+ export * from './fairplay/decodeFairPlayLicense.js';
23
+ export * from './fairplay/extractContentId.js';
24
+ export * from './fairplay/getId.js';
25
+ export * from './fairplay/getLicenseServerUrl.js';
26
+ // playready utilities
27
+ export * from './playready/getLicenseRequestFromMessage.js';
28
+ export * from './playready/getRequestHeadersFromMessage.js';
29
+ export * from './playready/toBigEndianKeyId.js';
30
+ // drm constants
31
+ export * from './common/CBCS.js';
32
+ export * from './common/CENC.js';
33
+ export * from './common/CHALLENGE.js';
34
+ export * from './common/CLEAR_KEY_SYSTEM.js';
35
+ export * from './common/CLEAR_KEY_UUID.js';
36
+ export * from './common/CONTENT_TYPE.js';
37
+ export * from './common/EncryptionScheme.js';
38
+ export * from './common/EXPIRED.js';
39
+ export * from './common/FAIRPLAY_KEY_SYSTEM.js';
40
+ export * from './common/FAIRPLAY_UUID.js';
41
+ export * from './common/HTTP_HEADERS.js';
42
+ export * from './common/HW_SECURE_ALL.js';
43
+ export * from './common/HW_SECURE_CRYPTO.js';
44
+ export * from './common/HW_SECURE_DECODE.js';
45
+ export * from './common/INDIVIDUALIZATION_REQUEST.js';
46
+ export * from './common/InitializationDataType.js';
47
+ export * from './common/INTERNAL_ERROR.js';
48
+ export * from './common/KEYIDS.js';
49
+ export * from './common/LICENSE_ACQUISITION.js';
50
+ export * from './common/LICENSE_RELEASE.js';
51
+ export * from './common/LICENSE_RENEWAL.js';
52
+ export * from './common/LICENSE_REQUEST.js';
53
+ export * from './common/MediaKeyMessageType.js';
54
+ export * from './common/MediaKeyStatus.js';
55
+ export * from './common/MP4_PROTECTION_SCHEME.js';
56
+ export * from './common/OUTPUT_DOWNSCALED.js';
57
+ export * from './common/OUTPUT_RESTRICTED.js';
58
+ export * from './common/PLAYREADY_KEY_MESSAGE.js';
59
+ export * from './common/PLAYREADY_KEY_SYSTEM.js';
60
+ export * from './common/PLAYREADY_RECOMMENDATION_KEY_SYSTEM.js';
61
+ export * from './common/PLAYREADY_UUID.js';
62
+ export * from './common/RELEASED.js';
63
+ export * from './common/STATUS_PENDING.js';
64
+ export * from './common/SW_SECURE_CRYPTO.js';
65
+ export * from './common/SW_SECURE_DECODE.js';
66
+ export * from './common/TEXT_XML_UTF8.js';
67
+ export * from './common/USABLE.js';
68
+ export * from './common/W3C_CLEAR_KEY_UUID.js';
69
+ export * from './common/WEBM.js';
70
+ export * from './common/WIDEVINE_KEY_SYSTEM.js';
71
+ export * from './common/WIDEVINE_UUID.js';
72
+ export * from './common/WidevineRobustness.js';
73
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,eAAe;AACf,cAAc,qCAAqC,CAAC;AACpD,cAAc,oDAAoD,CAAC;AACnE,cAAc,uBAAuB,CAAC;AACtC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,8CAA8C,CAAC;AAC7D,cAAc,yBAAyB,CAAC;AAExC,mBAAmB;AACnB,cAAc,kDAAkD,CAAC;AACjE,cAAc,mCAAmC,CAAC;AAClD,cAAc,yCAAyC,CAAC;AACxD,cAAc,mDAAmD,CAAC;AAElE,qBAAqB;AACrB,cAAc,8CAA8C,CAAC;AAC7D,cAAc,qCAAqC,CAAC;AACpD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,qBAAqB,CAAC;AACpC,cAAc,mCAAmC,CAAC;AAElD,sBAAsB;AACtB,cAAc,6CAA6C,CAAC;AAC5D,cAAc,6CAA6C,CAAC;AAC5D,cAAc,iCAAiC,CAAC;AAOhD,gBAAgB;AAChB,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,0BAA0B,CAAC;AACzC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,qBAAqB,CAAC;AACpC,cAAc,iCAAiC,CAAC;AAChD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,uCAAuC,CAAC;AACtD,cAAc,oCAAoC,CAAC;AACnD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,oBAAoB,CAAC;AACnC,cAAc,iCAAiC,CAAC;AAChD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,iCAAiC,CAAC;AAChD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,mCAAmC,CAAC;AAClD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,mCAAmC,CAAC;AAClD,cAAc,kCAAkC,CAAC;AACjD,cAAc,iDAAiD,CAAC;AAChE,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sBAAsB,CAAC;AACrC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oBAAoB,CAAC;AACnC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,kBAAkB,CAAC;AACjC,cAAc,iCAAiC,CAAC;AAChD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,gCAAgC,CAAC","sourcesContent":["/**\n * A collection of tools for working with DRM.\n *\n * @packageDocumentation\n *\n * @beta\n */\n\n// common utils\nexport * from './cenc/findCencContentProtection.js';\nexport * from './cenc/getLicenseServerUrlFromContentProtection.js';\nexport * from './cenc/getPsshData.js';\nexport * from './cenc/getPsshForKeySystem.js';\nexport * from './cenc/parseInitDataFromContentProtection.js';\nexport * from './cenc/parsePsshList.js';\n\n// key system utils\nexport * from './keysystem/createMediaKeySystemConfiguration.js';\nexport * from './keysystem/getKeySystemAccess.js';\nexport * from './keysystem/getLegacyKeySystemAccess.js';\nexport * from './keysystem/getSupportedKeySystemConfiguration.js';\n\n// fairplay utilities\nexport * from './fairplay/concatInitDataIdAndCertificate.js';\nexport * from './fairplay/decodeFairPlayLicense.js';\nexport * from './fairplay/extractContentId.js';\nexport * from './fairplay/getId.js';\nexport * from './fairplay/getLicenseServerUrl.js';\n\n// playready utilities\nexport * from './playready/getLicenseRequestFromMessage.js';\nexport * from './playready/getRequestHeadersFromMessage.js';\nexport * from './playready/toBigEndianKeyId.js';\n\n// drm types\nexport type * from './common/ContentProtection.js';\nexport type * from './common/LicenseRequest.js';\nexport type * from './common/MediaKeySystemAccessRequest.js';\n\n// drm constants\nexport * from './common/CBCS.js';\nexport * from './common/CENC.js';\nexport * from './common/CHALLENGE.js';\nexport * from './common/CLEAR_KEY_SYSTEM.js';\nexport * from './common/CLEAR_KEY_UUID.js';\nexport * from './common/CONTENT_TYPE.js';\nexport * from './common/EncryptionScheme.js';\nexport * from './common/EXPIRED.js';\nexport * from './common/FAIRPLAY_KEY_SYSTEM.js';\nexport * from './common/FAIRPLAY_UUID.js';\nexport * from './common/HTTP_HEADERS.js';\nexport * from './common/HW_SECURE_ALL.js';\nexport * from './common/HW_SECURE_CRYPTO.js';\nexport * from './common/HW_SECURE_DECODE.js';\nexport * from './common/INDIVIDUALIZATION_REQUEST.js';\nexport * from './common/InitializationDataType.js';\nexport * from './common/INTERNAL_ERROR.js';\nexport * from './common/KEYIDS.js';\nexport * from './common/LICENSE_ACQUISITION.js';\nexport * from './common/LICENSE_RELEASE.js';\nexport * from './common/LICENSE_RENEWAL.js';\nexport * from './common/LICENSE_REQUEST.js';\nexport * from './common/MediaKeyMessageType.js';\nexport * from './common/MediaKeyStatus.js';\nexport * from './common/MP4_PROTECTION_SCHEME.js';\nexport * from './common/OUTPUT_DOWNSCALED.js';\nexport * from './common/OUTPUT_RESTRICTED.js';\nexport * from './common/PLAYREADY_KEY_MESSAGE.js';\nexport * from './common/PLAYREADY_KEY_SYSTEM.js';\nexport * from './common/PLAYREADY_RECOMMENDATION_KEY_SYSTEM.js';\nexport * from './common/PLAYREADY_UUID.js';\nexport * from './common/RELEASED.js';\nexport * from './common/STATUS_PENDING.js';\nexport * from './common/SW_SECURE_CRYPTO.js';\nexport * from './common/SW_SECURE_DECODE.js';\nexport * from './common/TEXT_XML_UTF8.js';\nexport * from './common/USABLE.js';\nexport * from './common/W3C_CLEAR_KEY_UUID.js';\nexport * from './common/WEBM.js';\nexport * from './common/WIDEVINE_KEY_SYSTEM.js';\nexport * from './common/WIDEVINE_UUID.js';\nexport * from './common/WidevineRobustness.js';\n"]}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Creates a valid KeySystemConfiguration from supported audio and video capabilities.
3
+ *
4
+ * @param supportedAudio - supported audio capabilities.
5
+ * @param supportedVideo - supported video capabilities.
6
+ * @returns KeySystemConfiguration object.
7
+ *
8
+ * @beta
9
+ *
10
+ * @example
11
+ * {@includeCode ../../test/keysystem/createMediaKeySystemConfiguration.test.ts#example}
12
+ */
13
+ export declare function createMediaKeySystemConfiguration(supportedAudio: MediaKeySystemMediaCapability[] | null, supportedVideo: MediaKeySystemMediaCapability[] | null): MediaKeySystemConfiguration;
14
+ //# sourceMappingURL=createMediaKeySystemConfiguration.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createMediaKeySystemConfiguration.d.ts","sourceRoot":"","sources":["../../src/keysystem/createMediaKeySystemConfiguration.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,wBAAgB,iCAAiC,CAChD,cAAc,EAAE,6BAA6B,EAAE,GAAG,IAAI,EACtD,cAAc,EAAE,6BAA6B,EAAE,GAAG,IAAI,GACpD,2BAA2B,CAiB7B"}
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Creates a valid KeySystemConfiguration from supported audio and video capabilities.
3
+ *
4
+ * @param supportedAudio - supported audio capabilities.
5
+ * @param supportedVideo - supported video capabilities.
6
+ * @returns KeySystemConfiguration object.
7
+ *
8
+ * @beta
9
+ *
10
+ * @example
11
+ * {@includeCode ../../test/keysystem/createMediaKeySystemConfiguration.test.ts#example}
12
+ */
13
+ export function createMediaKeySystemConfiguration(supportedAudio, supportedVideo) {
14
+ const config = {};
15
+ if (supportedAudio && supportedAudio.length > 0) {
16
+ config.audioCapabilities = supportedAudio;
17
+ }
18
+ if (supportedVideo && supportedVideo.length > 0) {
19
+ config.videoCapabilities = supportedVideo;
20
+ }
21
+ // default values
22
+ config.distinctiveIdentifier = 'optional';
23
+ config.persistentState = 'optional';
24
+ config.sessionTypes = ['temporary'];
25
+ return config;
26
+ }
27
+ //# sourceMappingURL=createMediaKeySystemConfiguration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createMediaKeySystemConfiguration.js","sourceRoot":"","sources":["../../src/keysystem/createMediaKeySystemConfiguration.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,iCAAiC,CAChD,cAAsD,EACtD,cAAsD;IAEtD,MAAM,MAAM,GAAgC,EAAE,CAAC;IAE/C,IAAI,cAAc,IAAI,cAAc,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACjD,MAAM,CAAC,iBAAiB,GAAG,cAAc,CAAC;IAC3C,CAAC;IAED,IAAI,cAAc,IAAI,cAAc,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACjD,MAAM,CAAC,iBAAiB,GAAG,cAAc,CAAC;IAC3C,CAAC;IAED,iBAAiB;IACjB,MAAM,CAAC,qBAAqB,GAAG,UAAU,CAAC;IAC1C,MAAM,CAAC,eAAe,GAAG,UAAU,CAAC;IACpC,MAAM,CAAC,YAAY,GAAG,CAAC,WAAW,CAAC,CAAC;IAEpC,OAAO,MAAM,CAAC;AACf,CAAC","sourcesContent":["/**\n * Creates a valid KeySystemConfiguration from supported audio and video capabilities.\n *\n * @param supportedAudio - supported audio capabilities.\n * @param supportedVideo - supported video capabilities.\n * @returns KeySystemConfiguration object.\n *\n * @beta\n *\n * @example\n * {@includeCode ../../test/keysystem/createMediaKeySystemConfiguration.test.ts#example}\n */\nexport function createMediaKeySystemConfiguration(\n\tsupportedAudio: MediaKeySystemMediaCapability[] | null,\n\tsupportedVideo: MediaKeySystemMediaCapability[] | null,\n): MediaKeySystemConfiguration {\n\tconst config: MediaKeySystemConfiguration = {};\n\n\tif (supportedAudio && supportedAudio.length > 0) {\n\t\tconfig.audioCapabilities = supportedAudio;\n\t}\n\n\tif (supportedVideo && supportedVideo.length > 0) {\n\t\tconfig.videoCapabilities = supportedVideo;\n\t}\n\n\t// default values\n\tconfig.distinctiveIdentifier = 'optional';\n\tconfig.persistentState = 'optional';\n\tconfig.sessionTypes = ['temporary'];\n\n\treturn config;\n}\n"]}
@@ -0,0 +1,11 @@
1
+ import type { MediaKeySystemAccessRequest } from '../common/MediaKeySystemAccessRequest.js';
2
+ /**
3
+ * Attempts to get key system access using requestMediaKeySystemAccess from EME.
4
+ *
5
+ * @param requests - An array of key system access requests.
6
+ * @returns MediaKeySystemAccess object if successful, or null if no system is supported.
7
+ *
8
+ * @beta
9
+ */
10
+ export declare function getKeySystemAccess(requests: MediaKeySystemAccessRequest[]): Promise<MediaKeySystemAccess | null>;
11
+ //# sourceMappingURL=getKeySystemAccess.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getKeySystemAccess.d.ts","sourceRoot":"","sources":["../../src/keysystem/getKeySystemAccess.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,0CAA0C,CAAC;AAE5F;;;;;;;GAOG;AACH,wBAAsB,kBAAkB,CACvC,QAAQ,EAAE,2BAA2B,EAAE,GACrC,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC,CAUtC"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Attempts to get key system access using requestMediaKeySystemAccess from EME.
3
+ *
4
+ * @param requests - An array of key system access requests.
5
+ * @returns MediaKeySystemAccess object if successful, or null if no system is supported.
6
+ *
7
+ * @beta
8
+ */
9
+ export async function getKeySystemAccess(requests) {
10
+ for (const { keySystem, configurations } of requests) {
11
+ try {
12
+ return await navigator.requestMediaKeySystemAccess(keySystem, configurations);
13
+ }
14
+ catch {
15
+ // legacy approach could be used here
16
+ }
17
+ }
18
+ return null;
19
+ }
20
+ //# sourceMappingURL=getKeySystemAccess.js.map