shaka-player 4.1.3 → 4.2.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 (59) hide show
  1. package/CHANGELOG.md +33 -34
  2. package/demo/common/assets.js +25 -0
  3. package/demo/common/message_ids.js +2 -0
  4. package/demo/config.js +5 -1
  5. package/demo/index.html +1 -1
  6. package/demo/locales/en.json +2 -0
  7. package/demo/locales/source.json +8 -0
  8. package/dist/demo.compiled.debug.js +25 -23
  9. package/dist/demo.compiled.debug.map +3 -3
  10. package/dist/demo.compiled.js +25 -23
  11. package/dist/demo.compiled.map +3 -3
  12. package/dist/deps.js +3 -2
  13. package/dist/locales.js +31 -31
  14. package/dist/receiver.compiled.debug.js +24 -22
  15. package/dist/receiver.compiled.debug.map +3 -3
  16. package/dist/receiver.compiled.js +24 -22
  17. package/dist/receiver.compiled.map +3 -3
  18. package/dist/shaka-player.compiled.d.ts +57 -4
  19. package/dist/shaka-player.compiled.debug.d.ts +57 -4
  20. package/dist/shaka-player.compiled.debug.externs.js +62 -4
  21. package/dist/shaka-player.compiled.debug.js +285 -241
  22. package/dist/shaka-player.compiled.debug.map +4 -4
  23. package/dist/shaka-player.compiled.externs.js +62 -4
  24. package/dist/shaka-player.compiled.js +815 -798
  25. package/dist/shaka-player.compiled.map +4 -4
  26. package/dist/shaka-player.ui.d.ts +57 -4
  27. package/dist/shaka-player.ui.debug.d.ts +57 -4
  28. package/dist/shaka-player.ui.debug.externs.js +62 -4
  29. package/dist/shaka-player.ui.debug.js +283 -239
  30. package/dist/shaka-player.ui.debug.map +4 -4
  31. package/dist/shaka-player.ui.externs.js +62 -4
  32. package/dist/shaka-player.ui.js +979 -960
  33. package/dist/shaka-player.ui.map +4 -4
  34. package/docs/tutorials/fairplay.md +149 -0
  35. package/docs/tutorials/ui.md +6 -6
  36. package/externs/shaka/abr_manager.js +8 -0
  37. package/externs/shaka/manifest.js +43 -0
  38. package/externs/shaka/player.js +13 -2
  39. package/lib/abr/simple_abr_manager.js +72 -4
  40. package/lib/hls/hls_parser.js +117 -25
  41. package/lib/media/drm_engine.js +0 -2
  42. package/lib/media/segment_index.js +8 -0
  43. package/lib/media/segment_reference.js +7 -1
  44. package/lib/media/streaming_engine.js +38 -2
  45. package/lib/net/networking_engine.js +1 -0
  46. package/lib/player.js +8 -1
  47. package/lib/polyfill/patchedmediakeys_apple.js +729 -0
  48. package/lib/text/vtt_text_parser.js +61 -4
  49. package/lib/util/error.js +21 -1
  50. package/lib/util/fairplay_utils.js +100 -2
  51. package/lib/util/platform.js +12 -1
  52. package/lib/util/player_configuration.js +3 -10
  53. package/package.json +1 -1
  54. package/shaka-player.uncompiled.js +1 -0
  55. package/test/hls/hls_parser_unit.js +49 -33
  56. package/test/media/streaming_engine_unit.js +79 -5
  57. package/test/test/util/simple_fakes.js +4 -0
  58. package/test/test/util/streaming_engine_util.js +10 -2
  59. package/test/text/vtt_text_parser_unit.js +26 -0
@@ -464,6 +464,7 @@ declare namespace shaka.abr {
464
464
  init (switchCallback : any ) : any ;
465
465
  playbackRateChanged (rate : any ) : any ;
466
466
  segmentDownloaded (deltaTimeMs : any , numBytes : any ) : any ;
467
+ setMediaElement (mediaElement : any ) : any ;
467
468
  setVariants (variants : any ) : any ;
468
469
  stop ( ) : any ;
469
470
  }
@@ -1102,6 +1103,7 @@ declare namespace shaka.media {
1102
1103
  */
1103
1104
  constructor (segmentIndex : shaka.media.SegmentIndex | null , index : number , partialSegmentIndex : number ) ;
1104
1105
  current ( ) : shaka.media.SegmentReference | null ;
1106
+ currentPosition ( ) : number ;
1105
1107
  next ( ) : any ;
1106
1108
  }
1107
1109
  }
@@ -1113,7 +1115,7 @@ declare namespace shaka.media {
1113
1115
  */
1114
1116
  class SegmentReference {
1115
1117
  private noStructuralTyping_shaka_media_SegmentReference : any;
1116
- constructor (startTime : number , endTime : number , uris : ( ) => string [] , startByte : number , endByte : number | null , initSegmentReference : shaka.media.InitSegmentReference | null , timestampOffset : number , appendWindowStart : number , appendWindowEnd : number , partialReferences ? : shaka.media.SegmentReference [] , tilesLayout ? : string | null , tileDuration ? : number | null , syncTime ? : number | null , status ? : shaka.media.SegmentReference.Status ) ;
1118
+ constructor (startTime : number , endTime : number , uris : ( ) => string [] , startByte : number , endByte : number | null , initSegmentReference : shaka.media.InitSegmentReference | null , timestampOffset : number , appendWindowStart : number , appendWindowEnd : number , partialReferences ? : shaka.media.SegmentReference [] , tilesLayout ? : string | null , tileDuration ? : number | null , syncTime ? : number | null , status ? : shaka.media.SegmentReference.Status , hlsAes128Key ? : shaka.extern.HlsAes128Key | null ) ;
1117
1119
  /**
1118
1120
  * Returns the offset from the start of the resource to the end of the
1119
1121
  * segment, inclusive. A value of null indicates that the segment extends to
@@ -1332,6 +1334,7 @@ declare namespace shaka.net.NetworkingEngine {
1332
1334
  */
1333
1335
  enum RequestType {
1334
1336
  APP = 3.0 ,
1337
+ KEY = 6.0 ,
1335
1338
  LICENSE = 2.0 ,
1336
1339
  MANIFEST = 0.0 ,
1337
1340
  SEGMENT = 1.0 ,
@@ -1532,6 +1535,16 @@ declare namespace shaka.polyfill {
1532
1535
  }
1533
1536
  }
1534
1537
  // Generated from /home/runner/work/shaka-player/shaka-player/dist/shaka-player.compiled.externs.js
1538
+ declare namespace shaka.polyfill {
1539
+ class PatchedMediaKeysApple {
1540
+ private noStructuralTyping_shaka_polyfill_PatchedMediaKeysApple : any;
1541
+ /**
1542
+ * Installs the polyfill if needed.
1543
+ */
1544
+ static install ( ) : any ;
1545
+ }
1546
+ }
1547
+ // Generated from /home/runner/work/shaka-player/shaka-player/dist/shaka-player.compiled.externs.js
1535
1548
  declare namespace shaka.polyfill {
1536
1549
  class PatchedMediaKeysNop {
1537
1550
  private noStructuralTyping_shaka_polyfill_PatchedMediaKeysNop : any;
@@ -2223,10 +2236,13 @@ declare namespace shaka.util.Error {
2223
2236
  FAILED_TO_CREATE_SESSION = 6005.0 ,
2224
2237
  FAILED_TO_GENERATE_LICENSE_REQUEST = 6006.0 ,
2225
2238
  HLS_AES_128_ENCRYPTION_NOT_SUPPORTED = 4034.0 ,
2239
+ HLS_AES_128_INVALID_IV_LENGTH = 4043.0 ,
2240
+ HLS_AES_128_INVALID_KEY_LENGTH = 4044.0 ,
2226
2241
  HLS_COULD_NOT_GUESS_CODECS = 4025.0 ,
2227
2242
  HLS_INTERNAL_SKIP_STREAM = 4035.0 ,
2228
2243
  HLS_INVALID_PLAYLIST_HIERARCHY = 4017.0 ,
2229
2244
  HLS_KEYFORMATS_NOT_SUPPORTED = 4026.0 ,
2245
+ HLS_MSE_ENCRYPTED_LEGACY_APPLE_MEDIA_KEYS_NOT_SUPPORTED = 4041.0 ,
2230
2246
  HLS_MSE_ENCRYPTED_MP2T_NOT_SUPPORTED = 4040.0 ,
2231
2247
  HLS_MULTIPLE_MEDIA_INIT_SECTIONS_FOUND = 4020.0 ,
2232
2248
  HLS_PLAYLIST_HEADER_MISSING = 4015.0 ,
@@ -2269,6 +2285,7 @@ declare namespace shaka.util.Error {
2269
2285
  NO_RECOGNIZED_KEY_SYSTEMS = 6000.0 ,
2270
2286
  NO_VARIANTS = 4036.0 ,
2271
2287
  NO_VIDEO_ELEMENT = 7002.0 ,
2288
+ NO_WEB_CRYPTO_API = 4042.0 ,
2272
2289
  OBJECT_DESTROYED = 7003.0 ,
2273
2290
  OFFLINE_SESSION_REMOVED = 6013.0 ,
2274
2291
  OPERATION_ABORTED = 7001.0 ,
@@ -2364,11 +2381,27 @@ declare namespace shaka.util {
2364
2381
  * Common FairPlay response transform for some DRMs providers.
2365
2382
  */
2366
2383
  static commonFairPlayResponse (type : shaka.net.NetworkingEngine.RequestType , response : shaka.extern.Response ) : any ;
2384
+ /**
2385
+ * Conax FairPlay request.
2386
+ */
2387
+ static conaxFairPlayRequest (type : shaka.net.NetworkingEngine.RequestType , request : shaka.extern.Request ) : any ;
2388
+ /**
2389
+ * Conax initDataTransform configuration.
2390
+ */
2391
+ static conaxInitDataTransform (initData : Uint8Array , initDataType : string , drmInfo : shaka.extern.DrmInfo | null ) : any ;
2367
2392
  /**
2368
2393
  * Using the default method, extract a content ID from the init data. This is
2369
2394
  * based on the FairPlay example documentation.
2370
2395
  */
2371
2396
  static defaultGetContentId (initData : ArrayBuffer | ArrayBufferView ) : string ;
2397
+ /**
2398
+ * EZDRM FairPlay request.
2399
+ */
2400
+ static ezdrmFairPlayRequest (type : shaka.net.NetworkingEngine.RequestType , request : shaka.extern.Request ) : any ;
2401
+ /**
2402
+ * EZDRM initDataTransform configuration.
2403
+ */
2404
+ static ezdrmInitDataTransform (initData : Uint8Array , initDataType : string , drmInfo : shaka.extern.DrmInfo | null ) : any ;
2372
2405
  /**
2373
2406
  * Transforms the init data buffer using the given data. The format is:
2374
2407
  * <pre>
@@ -2387,9 +2420,13 @@ declare namespace shaka.util {
2387
2420
  */
2388
2421
  static isFairPlaySupported ( ) : Promise < boolean > ;
2389
2422
  /**
2390
- * SPC FairPlay request.
2423
+ * Verimatrix FairPlay request.
2424
+ */
2425
+ static verimatrixFairPlayRequest (type : shaka.net.NetworkingEngine.RequestType , request : shaka.extern.Request ) : any ;
2426
+ /**
2427
+ * Verimatrix initDataTransform configuration.
2391
2428
  */
2392
- static spcFairPlayRequest (type : shaka.net.NetworkingEngine.RequestType , request : shaka.extern.Request ) : any ;
2429
+ static verimatrixInitDataTransform (initData : Uint8Array , initDataType : string , drmInfo : shaka.extern.DrmInfo | null ) : any ;
2393
2430
  }
2394
2431
  }
2395
2432
  // Generated from /home/runner/work/shaka-player/shaka-player/dist/shaka-player.compiled.externs.js
@@ -3298,6 +3335,10 @@ declare namespace shaka.extern {
3298
3335
  * @param numBytes The total number of bytes transferred.
3299
3336
  */
3300
3337
  segmentDownloaded (deltaTimeMs : number , numBytes : number ) : any ;
3338
+ /**
3339
+ * Set media element.
3340
+ */
3341
+ setMediaElement (mediaElement : HTMLMediaElement | null ) : any ;
3301
3342
  /**
3302
3343
  * Updates manager's variants collection.
3303
3344
  */
@@ -3433,6 +3474,18 @@ declare namespace shaka.extern {
3433
3474
  type DrmInfo = { audioRobustness : string , distinctiveIdentifierRequired : boolean , initData : shaka.extern.InitDataOverride [] | null , keyIds : Set < string > | null , keySystem : string , licenseServerUri : string , persistentStateRequired : boolean , serverCertificate : Uint8Array | null , serverCertificateUri : string , sessionType : string , videoRobustness : string } ;
3434
3475
  }
3435
3476
  // Generated from /home/runner/work/shaka-player/shaka-player/externs/shaka/manifest.js
3477
+ declare namespace shaka.extern {
3478
+ /**
3479
+ * A function that fetches the crypto keys for AES-128.
3480
+ * Returns a promise that resolves when the keys have been fetched.
3481
+ */
3482
+ type FetchCryptoKeysFunction = ( ) => Promise < any > ;
3483
+ }
3484
+ // Generated from /home/runner/work/shaka-player/shaka-player/externs/shaka/manifest.js
3485
+ declare namespace shaka.extern {
3486
+ type HlsAes128Key = { cryptoKey ? : webCrypto.CryptoKey | null , fetchKey ? : shaka.extern.CreateSegmentIndexFunction , firstMediaSequenceNumber : number , iv ? : Uint8Array , method : string } ;
3487
+ }
3488
+ // Generated from /home/runner/work/shaka-player/shaka-player/externs/shaka/manifest.js
3436
3489
  declare namespace shaka.extern {
3437
3490
  type InitDataOverride = { initData : Uint8Array , initDataType : string , keyId : string | null } ;
3438
3491
  }
@@ -3786,7 +3839,7 @@ declare namespace shaka.extern {
3786
3839
  }
3787
3840
  // Generated from /home/runner/work/shaka-player/shaka-player/externs/shaka/player.js
3788
3841
  declare namespace shaka.extern {
3789
- type AbrConfiguration = { advanced : shaka.extern.AdvancedAbrConfiguration , bandwidthDowngradeTarget : number , bandwidthUpgradeTarget : number , defaultBandwidthEstimate : number , enabled : boolean , restrictions : shaka.extern.Restrictions , switchInterval : number , useNetworkInformation : boolean } ;
3842
+ type AbrConfiguration = { advanced : shaka.extern.AdvancedAbrConfiguration , bandwidthDowngradeTarget : number , bandwidthUpgradeTarget : number , defaultBandwidthEstimate : number , enabled : boolean , ignoreDevicePixelRatio : boolean , restrictToElementSize : boolean , restrictions : shaka.extern.Restrictions , switchInterval : number , useNetworkInformation : boolean } ;
3790
3843
  }
3791
3844
  // Generated from /home/runner/work/shaka-player/shaka-player/externs/shaka/player.js
3792
3845
  declare namespace shaka.extern {
@@ -464,6 +464,7 @@ declare namespace shaka.abr {
464
464
  init (switchCallback : any ) : any ;
465
465
  playbackRateChanged (rate : any ) : any ;
466
466
  segmentDownloaded (deltaTimeMs : any , numBytes : any ) : any ;
467
+ setMediaElement (mediaElement : any ) : any ;
467
468
  setVariants (variants : any ) : any ;
468
469
  stop ( ) : any ;
469
470
  }
@@ -1102,6 +1103,7 @@ declare namespace shaka.media {
1102
1103
  */
1103
1104
  constructor (segmentIndex : shaka.media.SegmentIndex | null , index : number , partialSegmentIndex : number ) ;
1104
1105
  current ( ) : shaka.media.SegmentReference | null ;
1106
+ currentPosition ( ) : number ;
1105
1107
  next ( ) : any ;
1106
1108
  }
1107
1109
  }
@@ -1113,7 +1115,7 @@ declare namespace shaka.media {
1113
1115
  */
1114
1116
  class SegmentReference {
1115
1117
  private noStructuralTyping_shaka_media_SegmentReference : any;
1116
- constructor (startTime : number , endTime : number , uris : ( ) => string [] , startByte : number , endByte : number | null , initSegmentReference : shaka.media.InitSegmentReference | null , timestampOffset : number , appendWindowStart : number , appendWindowEnd : number , partialReferences ? : shaka.media.SegmentReference [] , tilesLayout ? : string | null , tileDuration ? : number | null , syncTime ? : number | null , status ? : shaka.media.SegmentReference.Status ) ;
1118
+ constructor (startTime : number , endTime : number , uris : ( ) => string [] , startByte : number , endByte : number | null , initSegmentReference : shaka.media.InitSegmentReference | null , timestampOffset : number , appendWindowStart : number , appendWindowEnd : number , partialReferences ? : shaka.media.SegmentReference [] , tilesLayout ? : string | null , tileDuration ? : number | null , syncTime ? : number | null , status ? : shaka.media.SegmentReference.Status , hlsAes128Key ? : shaka.extern.HlsAes128Key | null ) ;
1117
1119
  /**
1118
1120
  * Returns the offset from the start of the resource to the end of the
1119
1121
  * segment, inclusive. A value of null indicates that the segment extends to
@@ -1332,6 +1334,7 @@ declare namespace shaka.net.NetworkingEngine {
1332
1334
  */
1333
1335
  enum RequestType {
1334
1336
  APP = 3.0 ,
1337
+ KEY = 6.0 ,
1335
1338
  LICENSE = 2.0 ,
1336
1339
  MANIFEST = 0.0 ,
1337
1340
  SEGMENT = 1.0 ,
@@ -1532,6 +1535,16 @@ declare namespace shaka.polyfill {
1532
1535
  }
1533
1536
  }
1534
1537
  // Generated from /home/runner/work/shaka-player/shaka-player/dist/shaka-player.compiled.debug.externs.js
1538
+ declare namespace shaka.polyfill {
1539
+ class PatchedMediaKeysApple {
1540
+ private noStructuralTyping_shaka_polyfill_PatchedMediaKeysApple : any;
1541
+ /**
1542
+ * Installs the polyfill if needed.
1543
+ */
1544
+ static install ( ) : any ;
1545
+ }
1546
+ }
1547
+ // Generated from /home/runner/work/shaka-player/shaka-player/dist/shaka-player.compiled.debug.externs.js
1535
1548
  declare namespace shaka.polyfill {
1536
1549
  class PatchedMediaKeysNop {
1537
1550
  private noStructuralTyping_shaka_polyfill_PatchedMediaKeysNop : any;
@@ -2223,10 +2236,13 @@ declare namespace shaka.util.Error {
2223
2236
  FAILED_TO_CREATE_SESSION = 6005.0 ,
2224
2237
  FAILED_TO_GENERATE_LICENSE_REQUEST = 6006.0 ,
2225
2238
  HLS_AES_128_ENCRYPTION_NOT_SUPPORTED = 4034.0 ,
2239
+ HLS_AES_128_INVALID_IV_LENGTH = 4043.0 ,
2240
+ HLS_AES_128_INVALID_KEY_LENGTH = 4044.0 ,
2226
2241
  HLS_COULD_NOT_GUESS_CODECS = 4025.0 ,
2227
2242
  HLS_INTERNAL_SKIP_STREAM = 4035.0 ,
2228
2243
  HLS_INVALID_PLAYLIST_HIERARCHY = 4017.0 ,
2229
2244
  HLS_KEYFORMATS_NOT_SUPPORTED = 4026.0 ,
2245
+ HLS_MSE_ENCRYPTED_LEGACY_APPLE_MEDIA_KEYS_NOT_SUPPORTED = 4041.0 ,
2230
2246
  HLS_MSE_ENCRYPTED_MP2T_NOT_SUPPORTED = 4040.0 ,
2231
2247
  HLS_MULTIPLE_MEDIA_INIT_SECTIONS_FOUND = 4020.0 ,
2232
2248
  HLS_PLAYLIST_HEADER_MISSING = 4015.0 ,
@@ -2269,6 +2285,7 @@ declare namespace shaka.util.Error {
2269
2285
  NO_RECOGNIZED_KEY_SYSTEMS = 6000.0 ,
2270
2286
  NO_VARIANTS = 4036.0 ,
2271
2287
  NO_VIDEO_ELEMENT = 7002.0 ,
2288
+ NO_WEB_CRYPTO_API = 4042.0 ,
2272
2289
  OBJECT_DESTROYED = 7003.0 ,
2273
2290
  OFFLINE_SESSION_REMOVED = 6013.0 ,
2274
2291
  OPERATION_ABORTED = 7001.0 ,
@@ -2364,11 +2381,27 @@ declare namespace shaka.util {
2364
2381
  * Common FairPlay response transform for some DRMs providers.
2365
2382
  */
2366
2383
  static commonFairPlayResponse (type : shaka.net.NetworkingEngine.RequestType , response : shaka.extern.Response ) : any ;
2384
+ /**
2385
+ * Conax FairPlay request.
2386
+ */
2387
+ static conaxFairPlayRequest (type : shaka.net.NetworkingEngine.RequestType , request : shaka.extern.Request ) : any ;
2388
+ /**
2389
+ * Conax initDataTransform configuration.
2390
+ */
2391
+ static conaxInitDataTransform (initData : Uint8Array , initDataType : string , drmInfo : shaka.extern.DrmInfo | null ) : any ;
2367
2392
  /**
2368
2393
  * Using the default method, extract a content ID from the init data. This is
2369
2394
  * based on the FairPlay example documentation.
2370
2395
  */
2371
2396
  static defaultGetContentId (initData : ArrayBuffer | ArrayBufferView ) : string ;
2397
+ /**
2398
+ * EZDRM FairPlay request.
2399
+ */
2400
+ static ezdrmFairPlayRequest (type : shaka.net.NetworkingEngine.RequestType , request : shaka.extern.Request ) : any ;
2401
+ /**
2402
+ * EZDRM initDataTransform configuration.
2403
+ */
2404
+ static ezdrmInitDataTransform (initData : Uint8Array , initDataType : string , drmInfo : shaka.extern.DrmInfo | null ) : any ;
2372
2405
  /**
2373
2406
  * Transforms the init data buffer using the given data. The format is:
2374
2407
  * <pre>
@@ -2387,9 +2420,13 @@ declare namespace shaka.util {
2387
2420
  */
2388
2421
  static isFairPlaySupported ( ) : Promise < boolean > ;
2389
2422
  /**
2390
- * SPC FairPlay request.
2423
+ * Verimatrix FairPlay request.
2424
+ */
2425
+ static verimatrixFairPlayRequest (type : shaka.net.NetworkingEngine.RequestType , request : shaka.extern.Request ) : any ;
2426
+ /**
2427
+ * Verimatrix initDataTransform configuration.
2391
2428
  */
2392
- static spcFairPlayRequest (type : shaka.net.NetworkingEngine.RequestType , request : shaka.extern.Request ) : any ;
2429
+ static verimatrixInitDataTransform (initData : Uint8Array , initDataType : string , drmInfo : shaka.extern.DrmInfo | null ) : any ;
2393
2430
  }
2394
2431
  }
2395
2432
  // Generated from /home/runner/work/shaka-player/shaka-player/dist/shaka-player.compiled.debug.externs.js
@@ -3298,6 +3335,10 @@ declare namespace shaka.extern {
3298
3335
  * @param numBytes The total number of bytes transferred.
3299
3336
  */
3300
3337
  segmentDownloaded (deltaTimeMs : number , numBytes : number ) : any ;
3338
+ /**
3339
+ * Set media element.
3340
+ */
3341
+ setMediaElement (mediaElement : HTMLMediaElement | null ) : any ;
3301
3342
  /**
3302
3343
  * Updates manager's variants collection.
3303
3344
  */
@@ -3433,6 +3474,18 @@ declare namespace shaka.extern {
3433
3474
  type DrmInfo = { audioRobustness : string , distinctiveIdentifierRequired : boolean , initData : shaka.extern.InitDataOverride [] | null , keyIds : Set < string > | null , keySystem : string , licenseServerUri : string , persistentStateRequired : boolean , serverCertificate : Uint8Array | null , serverCertificateUri : string , sessionType : string , videoRobustness : string } ;
3434
3475
  }
3435
3476
  // Generated from /home/runner/work/shaka-player/shaka-player/externs/shaka/manifest.js
3477
+ declare namespace shaka.extern {
3478
+ /**
3479
+ * A function that fetches the crypto keys for AES-128.
3480
+ * Returns a promise that resolves when the keys have been fetched.
3481
+ */
3482
+ type FetchCryptoKeysFunction = ( ) => Promise < any > ;
3483
+ }
3484
+ // Generated from /home/runner/work/shaka-player/shaka-player/externs/shaka/manifest.js
3485
+ declare namespace shaka.extern {
3486
+ type HlsAes128Key = { cryptoKey ? : webCrypto.CryptoKey | null , fetchKey ? : shaka.extern.CreateSegmentIndexFunction , firstMediaSequenceNumber : number , iv ? : Uint8Array , method : string } ;
3487
+ }
3488
+ // Generated from /home/runner/work/shaka-player/shaka-player/externs/shaka/manifest.js
3436
3489
  declare namespace shaka.extern {
3437
3490
  type InitDataOverride = { initData : Uint8Array , initDataType : string , keyId : string | null } ;
3438
3491
  }
@@ -3786,7 +3839,7 @@ declare namespace shaka.extern {
3786
3839
  }
3787
3840
  // Generated from /home/runner/work/shaka-player/shaka-player/externs/shaka/player.js
3788
3841
  declare namespace shaka.extern {
3789
- type AbrConfiguration = { advanced : shaka.extern.AdvancedAbrConfiguration , bandwidthDowngradeTarget : number , bandwidthUpgradeTarget : number , defaultBandwidthEstimate : number , enabled : boolean , restrictions : shaka.extern.Restrictions , switchInterval : number , useNetworkInformation : boolean } ;
3842
+ type AbrConfiguration = { advanced : shaka.extern.AdvancedAbrConfiguration , bandwidthDowngradeTarget : number , bandwidthUpgradeTarget : number , defaultBandwidthEstimate : number , enabled : boolean , ignoreDevicePixelRatio : boolean , restrictToElementSize : boolean , restrictions : shaka.extern.Restrictions , switchInterval : number , useNetworkInformation : boolean } ;
3790
3843
  }
3791
3844
  // Generated from /home/runner/work/shaka-player/shaka-player/externs/shaka/player.js
3792
3845
  declare namespace shaka.extern {
@@ -604,6 +604,10 @@ shaka.util.Error.Code = {
604
604
  'INCONSISTENT_DRM_ACROSS_PERIODS': 4038,
605
605
  'HLS_VARIABLE_NOT_FOUND': 4039,
606
606
  'HLS_MSE_ENCRYPTED_MP2T_NOT_SUPPORTED': 4040,
607
+ 'HLS_MSE_ENCRYPTED_LEGACY_APPLE_MEDIA_KEYS_NOT_SUPPORTED': 4041,
608
+ 'NO_WEB_CRYPTO_API': 4042,
609
+ 'HLS_AES_128_INVALID_IV_LENGTH': 4043,
610
+ 'HLS_AES_128_INVALID_KEY_LENGTH': 4044,
607
611
  'STREAMING_ENGINE_STARTUP_INVALID_STATE': 5006,
608
612
  'NO_RECOGNIZED_KEY_SYSTEMS': 6000,
609
613
  'REQUESTED_KEY_SYSTEM_CONFIG_UNAVAILABLE': 6001,
@@ -1023,6 +1027,10 @@ shaka.abr.SimpleAbrManager = class {
1023
1027
  * @override
1024
1028
  */
1025
1029
  playbackRateChanged(rate) {}
1030
+ /**
1031
+ * @override
1032
+ */
1033
+ setMediaElement(mediaElement) {}
1026
1034
  /**
1027
1035
  * @override
1028
1036
  */
@@ -1333,7 +1341,8 @@ shaka.net.NetworkingEngine.RequestType = {
1333
1341
  'LICENSE': 2,
1334
1342
  'APP': 3,
1335
1343
  'TIMING': 4,
1336
- 'SERVER_CERTIFICATE': 5
1344
+ 'SERVER_CERTIFICATE': 5,
1345
+ 'KEY': 6
1337
1346
  };
1338
1347
  /**
1339
1348
  * Priority level for network scheme plugins.
@@ -1702,8 +1711,10 @@ shaka.media.SegmentReference = class {
1702
1711
  * @param {shaka.media.SegmentReference.Status=} status
1703
1712
  * The segment status is used to indicate that a segment does not exist or is
1704
1713
  * not available.
1714
+ * @param {?shaka.extern.HlsAes128Key=} hlsAes128Key
1715
+ * The segment's AES-128-CBC full segment encryption key and iv.
1705
1716
  */
1706
- constructor(startTime, endTime, uris, startByte, endByte, initSegmentReference, timestampOffset, appendWindowStart, appendWindowEnd, partialReferences, tilesLayout, tileDuration, syncTime, status) {}
1717
+ constructor(startTime, endTime, uris, startByte, endByte, initSegmentReference, timestampOffset, appendWindowStart, appendWindowEnd, partialReferences, tilesLayout, tileDuration, syncTime, status, hlsAes128Key) {}
1707
1718
  /**
1708
1719
  * Creates and returns the URIs of the resource containing the segment.
1709
1720
  * @return {!Array.<string>}
@@ -2050,6 +2061,10 @@ shaka.media.SegmentIterator = class {
2050
2061
  * @param {number} partialSegmentIndex
2051
2062
  */
2052
2063
  constructor(segmentIndex, index, partialSegmentIndex) {}
2064
+ /**
2065
+ * @return {number}
2066
+ */
2067
+ currentPosition() {}
2053
2068
  /**
2054
2069
  * @return {shaka.media.SegmentReference}
2055
2070
  */
@@ -3720,6 +3735,16 @@ shaka.polyfill.Orientation = class {
3720
3735
  */
3721
3736
  static install() {}
3722
3737
  };
3738
+ /**
3739
+ * @summary A polyfill to implement modern, standardized EME on top of Apple's
3740
+ * prefixed EME in Safari.
3741
+ */
3742
+ shaka.polyfill.PatchedMediaKeysApple = class {
3743
+ /**
3744
+ * Installs the polyfill if needed.
3745
+ */
3746
+ static install() {}
3747
+ };
3723
3748
  /**
3724
3749
  * @summary A polyfill to stub out
3725
3750
  * {@link https://bit.ly/EmeMar15 EME draft 12 March 2015} on browsers without
@@ -3999,11 +4024,44 @@ shaka.util.FairPlayUtils = class {
3999
4024
  */
4000
4025
  static initDataTransform(initData, contentId, cert) {}
4001
4026
  /**
4002
- * SPC FairPlay request.
4027
+ * Verimatrix initDataTransform configuration.
4028
+ * @param {!Uint8Array} initData
4029
+ * @param {string} initDataType
4030
+ * @param {?shaka.extern.DrmInfo} drmInfo
4031
+ */
4032
+ static verimatrixInitDataTransform(initData, initDataType, drmInfo) {}
4033
+ /**
4034
+ * EZDRM initDataTransform configuration.
4035
+ * @param {!Uint8Array} initData
4036
+ * @param {string} initDataType
4037
+ * @param {?shaka.extern.DrmInfo} drmInfo
4038
+ */
4039
+ static ezdrmInitDataTransform(initData, initDataType, drmInfo) {}
4040
+ /**
4041
+ * Conax initDataTransform configuration.
4042
+ * @param {!Uint8Array} initData
4043
+ * @param {string} initDataType
4044
+ * @param {?shaka.extern.DrmInfo} drmInfo
4045
+ */
4046
+ static conaxInitDataTransform(initData, initDataType, drmInfo) {}
4047
+ /**
4048
+ * Verimatrix FairPlay request.
4049
+ * @param {shaka.net.NetworkingEngine.RequestType} type
4050
+ * @param {shaka.extern.Request} request
4051
+ */
4052
+ static verimatrixFairPlayRequest(type, request) {}
4053
+ /**
4054
+ * EZDRM FairPlay request.
4055
+ * @param {shaka.net.NetworkingEngine.RequestType} type
4056
+ * @param {shaka.extern.Request} request
4057
+ */
4058
+ static ezdrmFairPlayRequest(type, request) {}
4059
+ /**
4060
+ * Conax FairPlay request.
4003
4061
  * @param {shaka.net.NetworkingEngine.RequestType} type
4004
4062
  * @param {shaka.extern.Request} request
4005
4063
  */
4006
- static spcFairPlayRequest(type, request) {}
4064
+ static conaxFairPlayRequest(type, request) {}
4007
4065
  /**
4008
4066
  * Common FairPlay response transform for some DRMs providers.
4009
4067
  * @param {shaka.net.NetworkingEngine.RequestType} type