@svta/cml-drm 1.0.1 → 1.1.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.
- package/dist/index.d.ts +116 -115
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +185 -102
- package/dist/index.js.map +1 -1
- package/package.json +4 -3
package/dist/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { Encoding, UTF_16, UTF_8, ValueOf } from "@svta/cml-utils";
|
|
|
5
5
|
/**
|
|
6
6
|
* Represents a ContentProtection element in DASH manifest.
|
|
7
7
|
*
|
|
8
|
-
* @
|
|
8
|
+
* @public
|
|
9
9
|
*/
|
|
10
10
|
type ContentProtection = {
|
|
11
11
|
schemeIdUri?: string;
|
|
@@ -21,7 +21,7 @@ type ContentProtection = {
|
|
|
21
21
|
* @param cpArray - Array of ContentProtection elements.
|
|
22
22
|
* @returns The Common Encryption content protection element, or null if not found.
|
|
23
23
|
*
|
|
24
|
-
* @
|
|
24
|
+
* @public
|
|
25
25
|
*
|
|
26
26
|
* @example
|
|
27
27
|
* {@includeCode ../../test/cenc/findCencContentProtection.test.ts#example}
|
|
@@ -36,7 +36,7 @@ declare function findCencContentProtection(cpArray: ContentProtection[]): Conten
|
|
|
36
36
|
* @param schemeIdUri - schemeIdUri we are searching for.
|
|
37
37
|
* @returns The license server URL, and if not found then null.
|
|
38
38
|
*
|
|
39
|
-
* @
|
|
39
|
+
* @public
|
|
40
40
|
*
|
|
41
41
|
* @example
|
|
42
42
|
* {@includeCode ../../test/cenc/getLicenseServerUrlFromContentProtection.test.ts#example}
|
|
@@ -50,7 +50,7 @@ declare function getLicenseServerUrlFromContentProtection(contentProtectionEleme
|
|
|
50
50
|
* @param pssh - The PSSH ArrayBuffer.
|
|
51
51
|
* @returns The data portion of the PSSH.
|
|
52
52
|
*
|
|
53
|
-
* @
|
|
53
|
+
* @public
|
|
54
54
|
*
|
|
55
55
|
* @example
|
|
56
56
|
* {@includeCode ../../test/cenc/getPsshData.test.ts#example}
|
|
@@ -66,7 +66,7 @@ declare function getPsshData(pssh: ArrayBuffer): ArrayBuffer;
|
|
|
66
66
|
* @param initData - 'cenc' initialization data. Concatenated list of PSSH boxes.
|
|
67
67
|
* @returns The PSSH box ArrayBuffer corresponding to the given key system, or null if not found.
|
|
68
68
|
*
|
|
69
|
-
* @
|
|
69
|
+
* @public
|
|
70
70
|
*
|
|
71
71
|
* @example
|
|
72
72
|
* {@includeCode ../../test/cenc/getPsshForKeySystem.test.ts#example}
|
|
@@ -82,7 +82,7 @@ declare function getPsshForKeySystem(uuid: string, initData: ArrayBuffer): Array
|
|
|
82
82
|
* @param BASE64 - The BASE64 reference.
|
|
83
83
|
* @returns init data as an ArrayBuffer, or null if not found.
|
|
84
84
|
*
|
|
85
|
-
* @
|
|
85
|
+
* @public
|
|
86
86
|
*
|
|
87
87
|
* @example
|
|
88
88
|
* {@includeCode ../../test/cenc/parseInitDataFromContentProtection.test.ts#example}
|
|
@@ -101,7 +101,7 @@ declare function parseInitDataFromContentProtection(cpData: ContentProtection, B
|
|
|
101
101
|
* the detected key system UUIDs (e.g. 00000000-0000-0000-0000-0000000000)
|
|
102
102
|
* and a ArrayBuffer (the entire PSSH box) as the property value
|
|
103
103
|
*
|
|
104
|
-
* @
|
|
104
|
+
* @public
|
|
105
105
|
*
|
|
106
106
|
* @example
|
|
107
107
|
* {@includeCode ../../test/cenc/parsePsshList.test.ts#example}
|
|
@@ -116,7 +116,7 @@ declare function parsePsshList(data: ArrayBuffer): Record<string, ArrayBuffer>;
|
|
|
116
116
|
* @param supportedVideo - supported video capabilities.
|
|
117
117
|
* @returns KeySystemConfiguration object.
|
|
118
118
|
*
|
|
119
|
-
* @
|
|
119
|
+
* @public
|
|
120
120
|
*
|
|
121
121
|
* @example
|
|
122
122
|
* {@includeCode ../../test/keysystem/createMediaKeySystemConfiguration.test.ts#example}
|
|
@@ -142,7 +142,7 @@ type MediaKeySystemAccessRequest = {
|
|
|
142
142
|
* @param requests - An array of key system access requests.
|
|
143
143
|
* @returns MediaKeySystemAccess object if successful, or null if no system is supported.
|
|
144
144
|
*
|
|
145
|
-
* @
|
|
145
|
+
* @public
|
|
146
146
|
*/
|
|
147
147
|
declare function getKeySystemAccess(requests: MediaKeySystemAccessRequest[]): Promise<MediaKeySystemAccess | null>;
|
|
148
148
|
//#endregion
|
|
@@ -153,7 +153,7 @@ declare function getKeySystemAccess(requests: MediaKeySystemAccessRequest[]): Pr
|
|
|
153
153
|
* @param requests - An array of key system access requests.
|
|
154
154
|
* @returns A KeySystemAccess object if successful, or null if no system is supported.
|
|
155
155
|
*
|
|
156
|
-
* @
|
|
156
|
+
* @public
|
|
157
157
|
*/
|
|
158
158
|
declare function getLegacyKeySystemAccess(requests: MediaKeySystemAccessRequest[]): MediaKeySystemAccessRequest | null;
|
|
159
159
|
//#endregion
|
|
@@ -165,7 +165,7 @@ declare function getLegacyKeySystemAccess(requests: MediaKeySystemAccessRequest[
|
|
|
165
165
|
* @param configs - An array of key system configurations.
|
|
166
166
|
* @returns The first supported configuration or null if none are supported.
|
|
167
167
|
*
|
|
168
|
-
* @
|
|
168
|
+
* @public
|
|
169
169
|
*/
|
|
170
170
|
declare function getSupportedKeySystemConfiguration(keySystem: string, configs: Iterable<MediaKeySystemConfiguration>): {
|
|
171
171
|
supportedAudio: MediaKeySystemMediaCapability[];
|
|
@@ -181,7 +181,7 @@ declare function getSupportedKeySystemConfiguration(keySystem: string, configs:
|
|
|
181
181
|
* @param cert - The application certificate (Uint8Array)
|
|
182
182
|
* @returns A Uint8Array containing the concatenated data
|
|
183
183
|
*
|
|
184
|
-
* @
|
|
184
|
+
* @public
|
|
185
185
|
*
|
|
186
186
|
* @example
|
|
187
187
|
* {@includeCode ../../test/fairplay/concatInitDataIdAndCertificate.test.ts#example}
|
|
@@ -195,7 +195,7 @@ declare function concatInitDataIdAndCertificate(initData: Uint16Array, id: Uint1
|
|
|
195
195
|
* @param response - The license response, either a base64 string or ArrayBuffer
|
|
196
196
|
* @returns A Uint8Array containing the decoded license
|
|
197
197
|
*
|
|
198
|
-
* @
|
|
198
|
+
* @public
|
|
199
199
|
*
|
|
200
200
|
* @example
|
|
201
201
|
* {@includeCode ../../test/fairplay/decodeFairPlayLicense.test.ts#example}
|
|
@@ -209,7 +209,7 @@ declare function decodeFairPlayLicense(response: string | ArrayBuffer): Uint8Arr
|
|
|
209
209
|
* @param initData - The initialization data (PSSH box)
|
|
210
210
|
* @returns The extracted content ID
|
|
211
211
|
*
|
|
212
|
-
* @
|
|
212
|
+
* @public
|
|
213
213
|
*
|
|
214
214
|
* @example
|
|
215
215
|
* {@includeCode ../../test/fairplay/extractContentId.test.ts#example}
|
|
@@ -225,7 +225,7 @@ declare function extractContentId(initData: ArrayBuffer, encoding?: Encoding): s
|
|
|
225
225
|
* @param queryParam - The query parameter key to extract (default: 'ContentId')
|
|
226
226
|
* @returns The extracted content ID as a string or null if not found
|
|
227
227
|
*
|
|
228
|
-
* @
|
|
228
|
+
* @public
|
|
229
229
|
*
|
|
230
230
|
* @example
|
|
231
231
|
* {@includeCode ../../test/fairplay/getId.test.ts#example}
|
|
@@ -239,7 +239,7 @@ declare function getId(licenseServerUrl: string, initData: ArrayBuffer, queryPar
|
|
|
239
239
|
* @param initData - The initialization data (PSSH box)
|
|
240
240
|
* @returns The license server URL as a string
|
|
241
241
|
*
|
|
242
|
-
* @
|
|
242
|
+
* @public
|
|
243
243
|
*
|
|
244
244
|
* @example
|
|
245
245
|
* {@includeCode ../../test/fairplay/getLicenseServerUrl.test.ts#example}
|
|
@@ -254,7 +254,7 @@ declare function getLicenseServerUrl(initData: Uint16Array): string;
|
|
|
254
254
|
* @param encoding - The message encoding type. Default is UTF-16.
|
|
255
255
|
* @returns The license request as an ArrayBuffer.
|
|
256
256
|
*
|
|
257
|
-
* @
|
|
257
|
+
* @public
|
|
258
258
|
*
|
|
259
259
|
* @example
|
|
260
260
|
* {@includeCode ../../test/playready/getLicenseRequestFromMessage.test.ts#example}
|
|
@@ -269,7 +269,7 @@ declare function getLicenseRequestFromMessage(message: ArrayBuffer, encoding?: E
|
|
|
269
269
|
* @param encoding - The message encoding type. Default is UTF-16.
|
|
270
270
|
* @returns Request headers.
|
|
271
271
|
*
|
|
272
|
-
* @
|
|
272
|
+
* @public
|
|
273
273
|
*
|
|
274
274
|
* @example
|
|
275
275
|
* {@includeCode ../../test/playready/getRequestHeadersFromMessage.test.ts#example}
|
|
@@ -283,7 +283,7 @@ declare function getRequestHeadersFromMessage(message: ArrayBuffer, encoding?: t
|
|
|
283
283
|
* @param keyId - The little-endian key ID to convert.
|
|
284
284
|
* @returns The big-endian representation of the key ID.
|
|
285
285
|
*
|
|
286
|
-
* @
|
|
286
|
+
* @public
|
|
287
287
|
*
|
|
288
288
|
* @example
|
|
289
289
|
* {@includeCode ../../test/playready/toBigEndianKeyId.test.ts#example}
|
|
@@ -297,8 +297,7 @@ declare function toBigEndianKeyId(keyId: ArrayBuffer): ArrayBuffer;
|
|
|
297
297
|
* Contains all data needed to make a license acquisition request
|
|
298
298
|
* to a DRM license server.
|
|
299
299
|
*
|
|
300
|
-
*
|
|
301
|
-
* @beta
|
|
300
|
+
* @public
|
|
302
301
|
*/
|
|
303
302
|
type LicenseRequest = {
|
|
304
303
|
/**
|
|
@@ -340,8 +339,7 @@ type LicenseRequest = {
|
|
|
340
339
|
/**
|
|
341
340
|
* Cipher Block Chaining Sample encryption scheme.
|
|
342
341
|
*
|
|
343
|
-
*
|
|
344
|
-
* @beta
|
|
342
|
+
* @public
|
|
345
343
|
*/
|
|
346
344
|
declare const CBCS = "cbcs";
|
|
347
345
|
//#endregion
|
|
@@ -349,8 +347,7 @@ declare const CBCS = "cbcs";
|
|
|
349
347
|
/**
|
|
350
348
|
* Common Encryption scheme.
|
|
351
349
|
*
|
|
352
|
-
*
|
|
353
|
-
* @beta
|
|
350
|
+
* @public
|
|
354
351
|
*/
|
|
355
352
|
declare const CENC = "cenc";
|
|
356
353
|
//#endregion
|
|
@@ -358,8 +355,7 @@ declare const CENC = "cenc";
|
|
|
358
355
|
/**
|
|
359
356
|
* License Challenge.
|
|
360
357
|
*
|
|
361
|
-
*
|
|
362
|
-
* @beta
|
|
358
|
+
* @public
|
|
363
359
|
*/
|
|
364
360
|
declare const CHALLENGE = "Challenge";
|
|
365
361
|
//#endregion
|
|
@@ -367,8 +363,7 @@ declare const CHALLENGE = "Challenge";
|
|
|
367
363
|
/**
|
|
368
364
|
* Clear Key System.
|
|
369
365
|
*
|
|
370
|
-
*
|
|
371
|
-
* @beta
|
|
366
|
+
* @public
|
|
372
367
|
*/
|
|
373
368
|
declare const CLEAR_KEY_SYSTEM = "org.w3.clearkey";
|
|
374
369
|
//#endregion
|
|
@@ -376,8 +371,7 @@ declare const CLEAR_KEY_SYSTEM = "org.w3.clearkey";
|
|
|
376
371
|
/**
|
|
377
372
|
* Clear Key UUID.
|
|
378
373
|
*
|
|
379
|
-
*
|
|
380
|
-
* @beta
|
|
374
|
+
* @public
|
|
381
375
|
*/
|
|
382
376
|
declare const CLEAR_KEY_UUID = "e2719d58-a985-b3c9-781a-b030af78d30e";
|
|
383
377
|
//#endregion
|
|
@@ -385,8 +379,7 @@ declare const CLEAR_KEY_UUID = "e2719d58-a985-b3c9-781a-b030af78d30e";
|
|
|
385
379
|
/**
|
|
386
380
|
* Content-Type header.
|
|
387
381
|
*
|
|
388
|
-
*
|
|
389
|
-
* @beta
|
|
382
|
+
* @public
|
|
390
383
|
*/
|
|
391
384
|
declare const CONTENT_TYPE = "Content-Type";
|
|
392
385
|
//#endregion
|
|
@@ -394,8 +387,7 @@ declare const CONTENT_TYPE = "Content-Type";
|
|
|
394
387
|
/**
|
|
395
388
|
* Encryption schemes.
|
|
396
389
|
*
|
|
397
|
-
*
|
|
398
|
-
* @beta
|
|
390
|
+
* @public
|
|
399
391
|
*/
|
|
400
392
|
declare const EncryptionScheme: {
|
|
401
393
|
readonly CENC: typeof CENC;
|
|
@@ -404,8 +396,7 @@ declare const EncryptionScheme: {
|
|
|
404
396
|
/**
|
|
405
397
|
* Encryption schemes.
|
|
406
398
|
*
|
|
407
|
-
*
|
|
408
|
-
* @beta
|
|
399
|
+
* @public
|
|
409
400
|
*/
|
|
410
401
|
type EncryptionScheme = ValueOf<typeof EncryptionScheme>;
|
|
411
402
|
//#endregion
|
|
@@ -413,8 +404,7 @@ type EncryptionScheme = ValueOf<typeof EncryptionScheme>;
|
|
|
413
404
|
/**
|
|
414
405
|
* Expired Media Key Status.
|
|
415
406
|
*
|
|
416
|
-
*
|
|
417
|
-
* @beta
|
|
407
|
+
* @public
|
|
418
408
|
*/
|
|
419
409
|
declare const EXPIRED = "expired";
|
|
420
410
|
//#endregion
|
|
@@ -422,8 +412,7 @@ declare const EXPIRED = "expired";
|
|
|
422
412
|
/**
|
|
423
413
|
* FairPlay Key System.
|
|
424
414
|
*
|
|
425
|
-
*
|
|
426
|
-
* @beta
|
|
415
|
+
* @public
|
|
427
416
|
*/
|
|
428
417
|
declare const FAIRPLAY_KEY_SYSTEM = "com.apple.fps.1_0";
|
|
429
418
|
//#endregion
|
|
@@ -431,8 +420,7 @@ declare const FAIRPLAY_KEY_SYSTEM = "com.apple.fps.1_0";
|
|
|
431
420
|
/**
|
|
432
421
|
* FairPlay UUID.
|
|
433
422
|
*
|
|
434
|
-
*
|
|
435
|
-
* @beta
|
|
423
|
+
* @public
|
|
436
424
|
*/
|
|
437
425
|
declare const FAIRPLAY_UUID = "29701fe4-3cc7-4a34-8c5b-ae90c7439a47";
|
|
438
426
|
//#endregion
|
|
@@ -440,8 +428,7 @@ declare const FAIRPLAY_UUID = "29701fe4-3cc7-4a34-8c5b-ae90c7439a47";
|
|
|
440
428
|
/**
|
|
441
429
|
* Playready HTTP Headers.
|
|
442
430
|
*
|
|
443
|
-
*
|
|
444
|
-
* @beta
|
|
431
|
+
* @public
|
|
445
432
|
*/
|
|
446
433
|
declare const HTTP_HEADERS = "HttpHeaders";
|
|
447
434
|
//#endregion
|
|
@@ -449,8 +436,7 @@ declare const HTTP_HEADERS = "HttpHeaders";
|
|
|
449
436
|
/**
|
|
450
437
|
* Hardware Secure All Robustness.
|
|
451
438
|
*
|
|
452
|
-
*
|
|
453
|
-
* @beta
|
|
439
|
+
* @public
|
|
454
440
|
*/
|
|
455
441
|
declare const HW_SECURE_ALL = "HW_SECURE_ALL";
|
|
456
442
|
//#endregion
|
|
@@ -458,8 +444,7 @@ declare const HW_SECURE_ALL = "HW_SECURE_ALL";
|
|
|
458
444
|
/**
|
|
459
445
|
* Hardware Secure Crypto Robustness.
|
|
460
446
|
*
|
|
461
|
-
*
|
|
462
|
-
* @beta
|
|
447
|
+
* @public
|
|
463
448
|
*/
|
|
464
449
|
declare const HW_SECURE_CRYPTO = "HW_SECURE_CRYPTO";
|
|
465
450
|
//#endregion
|
|
@@ -467,8 +452,7 @@ declare const HW_SECURE_CRYPTO = "HW_SECURE_CRYPTO";
|
|
|
467
452
|
/**
|
|
468
453
|
* Hardware Secure Decode Robustness.
|
|
469
454
|
*
|
|
470
|
-
*
|
|
471
|
-
* @beta
|
|
455
|
+
* @public
|
|
472
456
|
*/
|
|
473
457
|
declare const HW_SECURE_DECODE = "HW_SECURE_DECODE";
|
|
474
458
|
//#endregion
|
|
@@ -476,8 +460,7 @@ declare const HW_SECURE_DECODE = "HW_SECURE_DECODE";
|
|
|
476
460
|
/**
|
|
477
461
|
* Individualization Request.
|
|
478
462
|
*
|
|
479
|
-
*
|
|
480
|
-
* @beta
|
|
463
|
+
* @public
|
|
481
464
|
*/
|
|
482
465
|
declare const INDIVIDUALIZATION_REQUEST = "individualization-request";
|
|
483
466
|
//#endregion
|
|
@@ -485,8 +468,7 @@ declare const INDIVIDUALIZATION_REQUEST = "individualization-request";
|
|
|
485
468
|
/**
|
|
486
469
|
* Key IDs.
|
|
487
470
|
*
|
|
488
|
-
*
|
|
489
|
-
* @beta
|
|
471
|
+
* @public
|
|
490
472
|
*/
|
|
491
473
|
declare const KEYIDS = "keyids";
|
|
492
474
|
//#endregion
|
|
@@ -494,8 +476,7 @@ declare const KEYIDS = "keyids";
|
|
|
494
476
|
/**
|
|
495
477
|
* WEBM.
|
|
496
478
|
*
|
|
497
|
-
*
|
|
498
|
-
* @beta
|
|
479
|
+
* @public
|
|
499
480
|
*/
|
|
500
481
|
declare const WEBM = "webm";
|
|
501
482
|
//#endregion
|
|
@@ -503,8 +484,7 @@ declare const WEBM = "webm";
|
|
|
503
484
|
/**
|
|
504
485
|
* Initialization Data Type.
|
|
505
486
|
*
|
|
506
|
-
*
|
|
507
|
-
* @beta
|
|
487
|
+
* @public
|
|
508
488
|
*/
|
|
509
489
|
declare const InitializationDataType: {
|
|
510
490
|
readonly CENC: typeof CENC;
|
|
@@ -515,8 +495,7 @@ declare const InitializationDataType: {
|
|
|
515
495
|
/**
|
|
516
496
|
* Initialization Data Type.
|
|
517
497
|
*
|
|
518
|
-
*
|
|
519
|
-
* @beta
|
|
498
|
+
* @public
|
|
520
499
|
*/
|
|
521
500
|
type InitializationDataType = ValueOf<typeof InitializationDataType>;
|
|
522
501
|
//#endregion
|
|
@@ -524,8 +503,7 @@ type InitializationDataType = ValueOf<typeof InitializationDataType>;
|
|
|
524
503
|
/**
|
|
525
504
|
* Internal Error Media Key Status.
|
|
526
505
|
*
|
|
527
|
-
*
|
|
528
|
-
* @beta
|
|
506
|
+
* @public
|
|
529
507
|
*/
|
|
530
508
|
declare const INTERNAL_ERROR = "internal-error";
|
|
531
509
|
//#endregion
|
|
@@ -533,8 +511,7 @@ declare const INTERNAL_ERROR = "internal-error";
|
|
|
533
511
|
/**
|
|
534
512
|
* License Acquisition.
|
|
535
513
|
*
|
|
536
|
-
*
|
|
537
|
-
* @beta
|
|
514
|
+
* @public
|
|
538
515
|
*/
|
|
539
516
|
declare const LICENSE_ACQUISITION = "LicenseAcquisition";
|
|
540
517
|
//#endregion
|
|
@@ -542,8 +519,7 @@ declare const LICENSE_ACQUISITION = "LicenseAcquisition";
|
|
|
542
519
|
/**
|
|
543
520
|
* License Release.
|
|
544
521
|
*
|
|
545
|
-
*
|
|
546
|
-
* @beta
|
|
522
|
+
* @public
|
|
547
523
|
*/
|
|
548
524
|
declare const LICENSE_RELEASE = "license-release";
|
|
549
525
|
//#endregion
|
|
@@ -551,8 +527,7 @@ declare const LICENSE_RELEASE = "license-release";
|
|
|
551
527
|
/**
|
|
552
528
|
* License Renewal.
|
|
553
529
|
*
|
|
554
|
-
*
|
|
555
|
-
* @beta
|
|
530
|
+
* @public
|
|
556
531
|
*/
|
|
557
532
|
declare const LICENSE_RENEWAL = "license-renewal";
|
|
558
533
|
//#endregion
|
|
@@ -560,8 +535,7 @@ declare const LICENSE_RENEWAL = "license-renewal";
|
|
|
560
535
|
/**
|
|
561
536
|
* License Request.
|
|
562
537
|
*
|
|
563
|
-
*
|
|
564
|
-
* @beta
|
|
538
|
+
* @public
|
|
565
539
|
*/
|
|
566
540
|
declare const LICENSE_REQUEST = "license-request";
|
|
567
541
|
//#endregion
|
|
@@ -569,8 +543,7 @@ declare const LICENSE_REQUEST = "license-request";
|
|
|
569
543
|
/**
|
|
570
544
|
* Media Key Message Types.
|
|
571
545
|
*
|
|
572
|
-
*
|
|
573
|
-
* @beta
|
|
546
|
+
* @public
|
|
574
547
|
*/
|
|
575
548
|
declare const MediaKeyMessageType$1: {
|
|
576
549
|
readonly LICENSE_REQUEST: typeof LICENSE_REQUEST;
|
|
@@ -581,8 +554,7 @@ declare const MediaKeyMessageType$1: {
|
|
|
581
554
|
/**
|
|
582
555
|
* Media Key Message Types.
|
|
583
556
|
*
|
|
584
|
-
*
|
|
585
|
-
* @beta
|
|
557
|
+
* @public
|
|
586
558
|
*/
|
|
587
559
|
type MediaKeyMessageType$1 = ValueOf<typeof MediaKeyMessageType$1>;
|
|
588
560
|
//#endregion
|
|
@@ -590,8 +562,7 @@ type MediaKeyMessageType$1 = ValueOf<typeof MediaKeyMessageType$1>;
|
|
|
590
562
|
/**
|
|
591
563
|
* Output Downscaled Media Key Status.
|
|
592
564
|
*
|
|
593
|
-
*
|
|
594
|
-
* @beta
|
|
565
|
+
* @public
|
|
595
566
|
*/
|
|
596
567
|
declare const OUTPUT_DOWNSCALED = "output-downscaled";
|
|
597
568
|
//#endregion
|
|
@@ -599,8 +570,7 @@ declare const OUTPUT_DOWNSCALED = "output-downscaled";
|
|
|
599
570
|
/**
|
|
600
571
|
* Output Restricted Media Key Status.
|
|
601
572
|
*
|
|
602
|
-
*
|
|
603
|
-
* @beta
|
|
573
|
+
* @public
|
|
604
574
|
*/
|
|
605
575
|
declare const OUTPUT_RESTRICTED = "output-restricted";
|
|
606
576
|
//#endregion
|
|
@@ -608,8 +578,7 @@ declare const OUTPUT_RESTRICTED = "output-restricted";
|
|
|
608
578
|
/**
|
|
609
579
|
* Released Media Key Status.
|
|
610
580
|
*
|
|
611
|
-
*
|
|
612
|
-
* @beta
|
|
581
|
+
* @public
|
|
613
582
|
*/
|
|
614
583
|
declare const RELEASED = "released";
|
|
615
584
|
//#endregion
|
|
@@ -617,8 +586,7 @@ declare const RELEASED = "released";
|
|
|
617
586
|
/**
|
|
618
587
|
* Status Pending Media Key Status.
|
|
619
588
|
*
|
|
620
|
-
*
|
|
621
|
-
* @beta
|
|
589
|
+
* @public
|
|
622
590
|
*/
|
|
623
591
|
declare const STATUS_PENDING = "status-pending";
|
|
624
592
|
//#endregion
|
|
@@ -626,8 +594,7 @@ declare const STATUS_PENDING = "status-pending";
|
|
|
626
594
|
/**
|
|
627
595
|
* Usable Media Key Status.
|
|
628
596
|
*
|
|
629
|
-
*
|
|
630
|
-
* @beta
|
|
597
|
+
* @public
|
|
631
598
|
*/
|
|
632
599
|
declare const USABLE = "usable";
|
|
633
600
|
//#endregion
|
|
@@ -635,8 +602,7 @@ declare const USABLE = "usable";
|
|
|
635
602
|
/**
|
|
636
603
|
* Media Key Statuses.
|
|
637
604
|
*
|
|
638
|
-
*
|
|
639
|
-
* @beta
|
|
605
|
+
* @public
|
|
640
606
|
*/
|
|
641
607
|
declare const MediaKeyStatus: {
|
|
642
608
|
readonly USABLE: typeof USABLE;
|
|
@@ -650,8 +616,7 @@ declare const MediaKeyStatus: {
|
|
|
650
616
|
/**
|
|
651
617
|
* Media Key Statuses.
|
|
652
618
|
*
|
|
653
|
-
*
|
|
654
|
-
* @beta
|
|
619
|
+
* @public
|
|
655
620
|
*/
|
|
656
621
|
type MediaKeyStatus = ValueOf<typeof MediaKeyStatus>;
|
|
657
622
|
//#endregion
|
|
@@ -659,7 +624,7 @@ type MediaKeyStatus = ValueOf<typeof MediaKeyStatus>;
|
|
|
659
624
|
/**
|
|
660
625
|
* The DASH MP4 Protection Scheme schemeIdUri.
|
|
661
626
|
*
|
|
662
|
-
* @
|
|
627
|
+
* @public
|
|
663
628
|
*/
|
|
664
629
|
declare const MP4_PROTECTION_SCHEME = "urn:mpeg:dash:mp4protection:2011";
|
|
665
630
|
//#endregion
|
|
@@ -667,8 +632,7 @@ declare const MP4_PROTECTION_SCHEME = "urn:mpeg:dash:mp4protection:2011";
|
|
|
667
632
|
/**
|
|
668
633
|
* Playready Key Message.
|
|
669
634
|
*
|
|
670
|
-
*
|
|
671
|
-
* @beta
|
|
635
|
+
* @public
|
|
672
636
|
*/
|
|
673
637
|
declare const PLAYREADY_KEY_MESSAGE = "PlayReadyKeyMessage";
|
|
674
638
|
//#endregion
|
|
@@ -676,8 +640,7 @@ declare const PLAYREADY_KEY_MESSAGE = "PlayReadyKeyMessage";
|
|
|
676
640
|
/**
|
|
677
641
|
* Playready Key System.
|
|
678
642
|
*
|
|
679
|
-
*
|
|
680
|
-
* @beta
|
|
643
|
+
* @public
|
|
681
644
|
*/
|
|
682
645
|
declare const PLAYREADY_KEY_SYSTEM = "com.microsoft.playready";
|
|
683
646
|
//#endregion
|
|
@@ -685,8 +648,7 @@ declare const PLAYREADY_KEY_SYSTEM = "com.microsoft.playready";
|
|
|
685
648
|
/**
|
|
686
649
|
* Playready Recommendation Key System.
|
|
687
650
|
*
|
|
688
|
-
*
|
|
689
|
-
* @beta
|
|
651
|
+
* @public
|
|
690
652
|
*/
|
|
691
653
|
declare const PLAYREADY_RECOMMENDATION_KEY_SYSTEM = "com.microsoft.playready.recommendation";
|
|
692
654
|
//#endregion
|
|
@@ -694,8 +656,7 @@ declare const PLAYREADY_RECOMMENDATION_KEY_SYSTEM = "com.microsoft.playready.rec
|
|
|
694
656
|
/**
|
|
695
657
|
* Playready UUID.
|
|
696
658
|
*
|
|
697
|
-
*
|
|
698
|
-
* @beta
|
|
659
|
+
* @public
|
|
699
660
|
*/
|
|
700
661
|
declare const PLAYREADY_UUID = "9a04f079-9840-4286-ab92-e65be0885f95";
|
|
701
662
|
//#endregion
|
|
@@ -703,8 +664,7 @@ declare const PLAYREADY_UUID = "9a04f079-9840-4286-ab92-e65be0885f95";
|
|
|
703
664
|
/**
|
|
704
665
|
* Software Secure Crypto Robustness.
|
|
705
666
|
*
|
|
706
|
-
*
|
|
707
|
-
* @beta
|
|
667
|
+
* @public
|
|
708
668
|
*/
|
|
709
669
|
declare const SW_SECURE_CRYPTO = "SW_SECURE_CRYPTO";
|
|
710
670
|
//#endregion
|
|
@@ -712,8 +672,7 @@ declare const SW_SECURE_CRYPTO = "SW_SECURE_CRYPTO";
|
|
|
712
672
|
/**
|
|
713
673
|
* Software Secure Decode Robustness.
|
|
714
674
|
*
|
|
715
|
-
*
|
|
716
|
-
* @beta
|
|
675
|
+
* @public
|
|
717
676
|
*/
|
|
718
677
|
declare const SW_SECURE_DECODE = "SW_SECURE_DECODE";
|
|
719
678
|
//#endregion
|
|
@@ -721,8 +680,7 @@ declare const SW_SECURE_DECODE = "SW_SECURE_DECODE";
|
|
|
721
680
|
/**
|
|
722
681
|
* XML formatted, UTF-8 encoded, text header.
|
|
723
682
|
*
|
|
724
|
-
*
|
|
725
|
-
* @beta
|
|
683
|
+
* @public
|
|
726
684
|
*/
|
|
727
685
|
declare const TEXT_XML_UTF8 = "text/xml; charset=utf-8";
|
|
728
686
|
//#endregion
|
|
@@ -730,8 +688,7 @@ declare const TEXT_XML_UTF8 = "text/xml; charset=utf-8";
|
|
|
730
688
|
/**
|
|
731
689
|
* W3C Clear Key UUID.
|
|
732
690
|
*
|
|
733
|
-
*
|
|
734
|
-
* @beta
|
|
691
|
+
* @public
|
|
735
692
|
*/
|
|
736
693
|
declare const W3C_CLEAR_KEY_UUID = "1077efec-c0b2-4d02-ace3-3c1e52e2fb4b";
|
|
737
694
|
//#endregion
|
|
@@ -739,8 +696,7 @@ declare const W3C_CLEAR_KEY_UUID = "1077efec-c0b2-4d02-ace3-3c1e52e2fb4b";
|
|
|
739
696
|
/**
|
|
740
697
|
* Widevine Key System.
|
|
741
698
|
*
|
|
742
|
-
*
|
|
743
|
-
* @beta
|
|
699
|
+
* @public
|
|
744
700
|
*/
|
|
745
701
|
declare const WIDEVINE_KEY_SYSTEM = "com.widevine.alpha";
|
|
746
702
|
//#endregion
|
|
@@ -748,8 +704,7 @@ declare const WIDEVINE_KEY_SYSTEM = "com.widevine.alpha";
|
|
|
748
704
|
/**
|
|
749
705
|
* Widevine UUID.
|
|
750
706
|
*
|
|
751
|
-
*
|
|
752
|
-
* @beta
|
|
707
|
+
* @public
|
|
753
708
|
*/
|
|
754
709
|
declare const WIDEVINE_UUID = "edef8ba9-79d6-4ace-a3c8-27dcd51d21ed";
|
|
755
710
|
//#endregion
|
|
@@ -757,8 +712,7 @@ declare const WIDEVINE_UUID = "edef8ba9-79d6-4ace-a3c8-27dcd51d21ed";
|
|
|
757
712
|
/**
|
|
758
713
|
* Widevine Robustness.
|
|
759
714
|
*
|
|
760
|
-
*
|
|
761
|
-
* @beta
|
|
715
|
+
* @public
|
|
762
716
|
*/
|
|
763
717
|
declare const WidevineRobustness: {
|
|
764
718
|
readonly SW_SECURE_CRYPTO: typeof SW_SECURE_CRYPTO;
|
|
@@ -770,10 +724,57 @@ declare const WidevineRobustness: {
|
|
|
770
724
|
/**
|
|
771
725
|
* Widevine Robustness.
|
|
772
726
|
*
|
|
773
|
-
*
|
|
774
|
-
* @beta
|
|
727
|
+
* @public
|
|
775
728
|
*/
|
|
776
729
|
type WidevineRobustness = ValueOf<typeof WidevineRobustness>;
|
|
777
730
|
//#endregion
|
|
778
|
-
|
|
731
|
+
//#region src/ensureEncryptedInit.d.ts
|
|
732
|
+
/**
|
|
733
|
+
* Options for the `ensureEncryptedInit` function.
|
|
734
|
+
*
|
|
735
|
+
* @public
|
|
736
|
+
*/
|
|
737
|
+
type EnsureEncryptedInitOptions = {
|
|
738
|
+
/**
|
|
739
|
+
* Whether to prepend the encrypted entries to the sample table.
|
|
740
|
+
*
|
|
741
|
+
* @defaultValue `true`
|
|
742
|
+
*/
|
|
743
|
+
prepend: boolean;
|
|
744
|
+
/**
|
|
745
|
+
* Whether to include the original init segment in the result.
|
|
746
|
+
*
|
|
747
|
+
* @defaultValue `true`
|
|
748
|
+
*/
|
|
749
|
+
includeOriginal: boolean;
|
|
750
|
+
/**
|
|
751
|
+
* The scheme type to use for the encryption. Defaults to `cenc`.
|
|
752
|
+
*
|
|
753
|
+
* @defaultValue `1667591779`
|
|
754
|
+
*/
|
|
755
|
+
schemeType: number;
|
|
756
|
+
/**
|
|
757
|
+
* The default KID to use for the encryption.
|
|
758
|
+
*
|
|
759
|
+
* @defaultValue `[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]`
|
|
760
|
+
*/
|
|
761
|
+
defaultKid: number[];
|
|
762
|
+
};
|
|
763
|
+
/**
|
|
764
|
+
* Ensures that the init segment is encrypted. Used on platforms that have issues playing unencrypted
|
|
765
|
+
* content before playing encrypted content. Both prepend and includeOriginal are optional.
|
|
766
|
+
*
|
|
767
|
+
* @param init - The init segment to ensure is encrypted.
|
|
768
|
+
* @param options - The options for the encryption.
|
|
769
|
+
*
|
|
770
|
+
* @returns The encrypted init segment.
|
|
771
|
+
*
|
|
772
|
+
* @public
|
|
773
|
+
*
|
|
774
|
+
* @example
|
|
775
|
+
* {@includeCode ../test/ensureEncryptedInit.test.ts#example}
|
|
776
|
+
*/
|
|
777
|
+
declare function ensureEncryptedInit(init: Uint8Array<ArrayBuffer>, options?: Partial<EnsureEncryptedInitOptions>): Uint8Array<ArrayBuffer>;
|
|
778
|
+
//#endregion
|
|
779
|
+
export { CBCS, CENC, CHALLENGE, CLEAR_KEY_SYSTEM, CLEAR_KEY_UUID, CONTENT_TYPE, ContentProtection, EXPIRED, EncryptionScheme, EnsureEncryptedInitOptions, FAIRPLAY_KEY_SYSTEM, FAIRPLAY_UUID, HTTP_HEADERS, HW_SECURE_ALL, HW_SECURE_CRYPTO, HW_SECURE_DECODE, INDIVIDUALIZATION_REQUEST, INTERNAL_ERROR, InitializationDataType, KEYIDS, LICENSE_ACQUISITION, LICENSE_RELEASE, LICENSE_RENEWAL, LICENSE_REQUEST, LicenseRequest, MP4_PROTECTION_SCHEME, MediaKeyMessageType$1 as MediaKeyMessageType, MediaKeyStatus, MediaKeySystemAccessRequest, OUTPUT_DOWNSCALED, OUTPUT_RESTRICTED, PLAYREADY_KEY_MESSAGE, PLAYREADY_KEY_SYSTEM, PLAYREADY_RECOMMENDATION_KEY_SYSTEM, PLAYREADY_UUID, RELEASED, STATUS_PENDING, SW_SECURE_CRYPTO, SW_SECURE_DECODE, TEXT_XML_UTF8, USABLE, W3C_CLEAR_KEY_UUID, WEBM, WIDEVINE_KEY_SYSTEM, WIDEVINE_UUID, WidevineRobustness, concatInitDataIdAndCertificate, createMediaKeySystemConfiguration, decodeFairPlayLicense, ensureEncryptedInit, extractContentId, findCencContentProtection, getId, getKeySystemAccess, getLegacyKeySystemAccess, getLicenseRequestFromMessage, getLicenseServerUrl, getLicenseServerUrlFromContentProtection, getPsshData, getPsshForKeySystem, getRequestHeadersFromMessage, getSupportedKeySystemConfiguration, parseInitDataFromContentProtection, parsePsshList, toBigEndianKeyId };
|
|
779
780
|
//# sourceMappingURL=index.d.ts.map
|