shaka-player 4.1.3 → 4.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/.github/workflows/selenium-lab-tests.yaml +158 -53
  2. package/CHANGELOG.md +39 -29
  3. package/demo/common/assets.js +25 -0
  4. package/demo/common/message_ids.js +2 -0
  5. package/demo/config.js +5 -1
  6. package/demo/index.html +1 -1
  7. package/demo/locales/en.json +2 -0
  8. package/demo/locales/source.json +8 -0
  9. package/dist/controls.css +1 -1
  10. package/dist/controls.css.map +1 -1
  11. package/dist/demo.compiled.debug.js +25 -23
  12. package/dist/demo.compiled.debug.map +3 -3
  13. package/dist/demo.compiled.js +25 -23
  14. package/dist/demo.compiled.map +3 -3
  15. package/dist/deps.js +3 -2
  16. package/dist/locales.js +32 -32
  17. package/dist/receiver.compiled.debug.js +24 -22
  18. package/dist/receiver.compiled.debug.map +3 -3
  19. package/dist/receiver.compiled.js +24 -22
  20. package/dist/receiver.compiled.map +3 -3
  21. package/dist/shaka-player.compiled.d.ts +57 -6
  22. package/dist/shaka-player.compiled.debug.d.ts +57 -6
  23. package/dist/shaka-player.compiled.debug.externs.js +62 -6
  24. package/dist/shaka-player.compiled.debug.js +305 -262
  25. package/dist/shaka-player.compiled.debug.map +4 -4
  26. package/dist/shaka-player.compiled.externs.js +62 -6
  27. package/dist/shaka-player.compiled.js +817 -801
  28. package/dist/shaka-player.compiled.map +4 -4
  29. package/dist/shaka-player.ui.d.ts +57 -6
  30. package/dist/shaka-player.ui.debug.d.ts +57 -6
  31. package/dist/shaka-player.ui.debug.externs.js +62 -6
  32. package/dist/shaka-player.ui.debug.js +308 -265
  33. package/dist/shaka-player.ui.debug.map +4 -4
  34. package/dist/shaka-player.ui.externs.js +62 -6
  35. package/dist/shaka-player.ui.js +942 -925
  36. package/dist/shaka-player.ui.map +4 -4
  37. package/docs/tutorials/fairplay.md +149 -0
  38. package/docs/tutorials/ui.md +6 -6
  39. package/externs/shaka/abr_manager.js +8 -0
  40. package/externs/shaka/manifest.js +43 -0
  41. package/externs/shaka/player.js +13 -2
  42. package/lib/abr/simple_abr_manager.js +72 -4
  43. package/lib/hls/hls_parser.js +138 -96
  44. package/lib/media/drm_engine.js +0 -2
  45. package/lib/media/segment_index.js +8 -0
  46. package/lib/media/segment_reference.js +7 -1
  47. package/lib/media/streaming_engine.js +38 -2
  48. package/lib/net/networking_engine.js +1 -0
  49. package/lib/player.js +20 -1
  50. package/lib/polyfill/patchedmediakeys_apple.js +729 -0
  51. package/lib/text/ui_text_displayer.js +8 -0
  52. package/lib/text/vtt_text_parser.js +61 -4
  53. package/lib/util/error.js +23 -11
  54. package/lib/util/fairplay_utils.js +100 -2
  55. package/lib/util/platform.js +12 -1
  56. package/lib/util/player_configuration.js +4 -10
  57. package/package.json +1 -1
  58. package/shaka-player.uncompiled.js +1 -0
  59. package/test/hls/hls_parser_unit.js +101 -34
  60. package/test/media/drm_engine_unit.js +29 -0
  61. package/test/media/streaming_engine_unit.js +79 -5
  62. package/test/player_src_equals_integration.js +2 -0
  63. package/test/player_unit.js +39 -1
  64. package/test/test/assets/small.mp4 +0 -0
  65. package/test/test/util/simple_fakes.js +4 -0
  66. package/test/test/util/streaming_engine_util.js +10 -2
  67. package/test/text/vtt_text_parser_unit.js +26 -0
  68. package/ui/less/ad_controls.less +4 -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.ui.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.ui.externs.js
1535
1548
  declare namespace shaka.polyfill {
1536
1549
  class PatchedMediaKeysNop {
1537
1550
  private noStructuralTyping_shaka_polyfill_PatchedMediaKeysNop : any;
@@ -2689,11 +2702,12 @@ declare namespace shaka.util.Error {
2689
2702
  FAILED_TO_CREATE_CDM = 6002.0 ,
2690
2703
  FAILED_TO_CREATE_SESSION = 6005.0 ,
2691
2704
  FAILED_TO_GENERATE_LICENSE_REQUEST = 6006.0 ,
2692
- HLS_AES_128_ENCRYPTION_NOT_SUPPORTED = 4034.0 ,
2705
+ HLS_AES_128_INVALID_IV_LENGTH = 4043.0 ,
2706
+ HLS_AES_128_INVALID_KEY_LENGTH = 4044.0 ,
2693
2707
  HLS_COULD_NOT_GUESS_CODECS = 4025.0 ,
2694
- HLS_INTERNAL_SKIP_STREAM = 4035.0 ,
2695
2708
  HLS_INVALID_PLAYLIST_HIERARCHY = 4017.0 ,
2696
2709
  HLS_KEYFORMATS_NOT_SUPPORTED = 4026.0 ,
2710
+ HLS_MSE_ENCRYPTED_LEGACY_APPLE_MEDIA_KEYS_NOT_SUPPORTED = 4041.0 ,
2697
2711
  HLS_MSE_ENCRYPTED_MP2T_NOT_SUPPORTED = 4040.0 ,
2698
2712
  HLS_MULTIPLE_MEDIA_INIT_SECTIONS_FOUND = 4020.0 ,
2699
2713
  HLS_PLAYLIST_HEADER_MISSING = 4015.0 ,
@@ -2736,6 +2750,7 @@ declare namespace shaka.util.Error {
2736
2750
  NO_RECOGNIZED_KEY_SYSTEMS = 6000.0 ,
2737
2751
  NO_VARIANTS = 4036.0 ,
2738
2752
  NO_VIDEO_ELEMENT = 7002.0 ,
2753
+ NO_WEB_CRYPTO_API = 4042.0 ,
2739
2754
  OBJECT_DESTROYED = 7003.0 ,
2740
2755
  OFFLINE_SESSION_REMOVED = 6013.0 ,
2741
2756
  OPERATION_ABORTED = 7001.0 ,
@@ -2831,11 +2846,27 @@ declare namespace shaka.util {
2831
2846
  * Common FairPlay response transform for some DRMs providers.
2832
2847
  */
2833
2848
  static commonFairPlayResponse (type : shaka.net.NetworkingEngine.RequestType , response : shaka.extern.Response ) : any ;
2849
+ /**
2850
+ * Conax FairPlay request.
2851
+ */
2852
+ static conaxFairPlayRequest (type : shaka.net.NetworkingEngine.RequestType , request : shaka.extern.Request ) : any ;
2853
+ /**
2854
+ * Conax initDataTransform configuration.
2855
+ */
2856
+ static conaxInitDataTransform (initData : Uint8Array , initDataType : string , drmInfo : shaka.extern.DrmInfo | null ) : any ;
2834
2857
  /**
2835
2858
  * Using the default method, extract a content ID from the init data. This is
2836
2859
  * based on the FairPlay example documentation.
2837
2860
  */
2838
2861
  static defaultGetContentId (initData : ArrayBuffer | ArrayBufferView ) : string ;
2862
+ /**
2863
+ * EZDRM FairPlay request.
2864
+ */
2865
+ static ezdrmFairPlayRequest (type : shaka.net.NetworkingEngine.RequestType , request : shaka.extern.Request ) : any ;
2866
+ /**
2867
+ * EZDRM initDataTransform configuration.
2868
+ */
2869
+ static ezdrmInitDataTransform (initData : Uint8Array , initDataType : string , drmInfo : shaka.extern.DrmInfo | null ) : any ;
2839
2870
  /**
2840
2871
  * Transforms the init data buffer using the given data. The format is:
2841
2872
  * <pre>
@@ -2854,9 +2885,13 @@ declare namespace shaka.util {
2854
2885
  */
2855
2886
  static isFairPlaySupported ( ) : Promise < boolean > ;
2856
2887
  /**
2857
- * SPC FairPlay request.
2888
+ * Verimatrix FairPlay request.
2889
+ */
2890
+ static verimatrixFairPlayRequest (type : shaka.net.NetworkingEngine.RequestType , request : shaka.extern.Request ) : any ;
2891
+ /**
2892
+ * Verimatrix initDataTransform configuration.
2858
2893
  */
2859
- static spcFairPlayRequest (type : shaka.net.NetworkingEngine.RequestType , request : shaka.extern.Request ) : any ;
2894
+ static verimatrixInitDataTransform (initData : Uint8Array , initDataType : string , drmInfo : shaka.extern.DrmInfo | null ) : any ;
2860
2895
  }
2861
2896
  }
2862
2897
  // Generated from /home/runner/work/shaka-player/shaka-player/dist/shaka-player.ui.externs.js
@@ -3765,6 +3800,10 @@ declare namespace shaka.extern {
3765
3800
  * @param numBytes The total number of bytes transferred.
3766
3801
  */
3767
3802
  segmentDownloaded (deltaTimeMs : number , numBytes : number ) : any ;
3803
+ /**
3804
+ * Set media element.
3805
+ */
3806
+ setMediaElement (mediaElement : HTMLMediaElement | null ) : any ;
3768
3807
  /**
3769
3808
  * Updates manager's variants collection.
3770
3809
  */
@@ -3900,6 +3939,18 @@ declare namespace shaka.extern {
3900
3939
  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 } ;
3901
3940
  }
3902
3941
  // Generated from /home/runner/work/shaka-player/shaka-player/externs/shaka/manifest.js
3942
+ declare namespace shaka.extern {
3943
+ /**
3944
+ * A function that fetches the crypto keys for AES-128.
3945
+ * Returns a promise that resolves when the keys have been fetched.
3946
+ */
3947
+ type FetchCryptoKeysFunction = ( ) => Promise < any > ;
3948
+ }
3949
+ // Generated from /home/runner/work/shaka-player/shaka-player/externs/shaka/manifest.js
3950
+ declare namespace shaka.extern {
3951
+ type HlsAes128Key = { cryptoKey ? : webCrypto.CryptoKey | null , fetchKey ? : shaka.extern.CreateSegmentIndexFunction , firstMediaSequenceNumber : number , iv ? : Uint8Array , method : string } ;
3952
+ }
3953
+ // Generated from /home/runner/work/shaka-player/shaka-player/externs/shaka/manifest.js
3903
3954
  declare namespace shaka.extern {
3904
3955
  type InitDataOverride = { initData : Uint8Array , initDataType : string , keyId : string | null } ;
3905
3956
  }
@@ -4253,7 +4304,7 @@ declare namespace shaka.extern {
4253
4304
  }
4254
4305
  // Generated from /home/runner/work/shaka-player/shaka-player/externs/shaka/player.js
4255
4306
  declare namespace shaka.extern {
4256
- type AbrConfiguration = { advanced : shaka.extern.AdvancedAbrConfiguration , bandwidthDowngradeTarget : number , bandwidthUpgradeTarget : number , defaultBandwidthEstimate : number , enabled : boolean , restrictions : shaka.extern.Restrictions , switchInterval : number , useNetworkInformation : boolean } ;
4307
+ 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 } ;
4257
4308
  }
4258
4309
  // Generated from /home/runner/work/shaka-player/shaka-player/externs/shaka/player.js
4259
4310
  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.ui.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.ui.debug.externs.js
1535
1548
  declare namespace shaka.polyfill {
1536
1549
  class PatchedMediaKeysNop {
1537
1550
  private noStructuralTyping_shaka_polyfill_PatchedMediaKeysNop : any;
@@ -2689,11 +2702,12 @@ declare namespace shaka.util.Error {
2689
2702
  FAILED_TO_CREATE_CDM = 6002.0 ,
2690
2703
  FAILED_TO_CREATE_SESSION = 6005.0 ,
2691
2704
  FAILED_TO_GENERATE_LICENSE_REQUEST = 6006.0 ,
2692
- HLS_AES_128_ENCRYPTION_NOT_SUPPORTED = 4034.0 ,
2705
+ HLS_AES_128_INVALID_IV_LENGTH = 4043.0 ,
2706
+ HLS_AES_128_INVALID_KEY_LENGTH = 4044.0 ,
2693
2707
  HLS_COULD_NOT_GUESS_CODECS = 4025.0 ,
2694
- HLS_INTERNAL_SKIP_STREAM = 4035.0 ,
2695
2708
  HLS_INVALID_PLAYLIST_HIERARCHY = 4017.0 ,
2696
2709
  HLS_KEYFORMATS_NOT_SUPPORTED = 4026.0 ,
2710
+ HLS_MSE_ENCRYPTED_LEGACY_APPLE_MEDIA_KEYS_NOT_SUPPORTED = 4041.0 ,
2697
2711
  HLS_MSE_ENCRYPTED_MP2T_NOT_SUPPORTED = 4040.0 ,
2698
2712
  HLS_MULTIPLE_MEDIA_INIT_SECTIONS_FOUND = 4020.0 ,
2699
2713
  HLS_PLAYLIST_HEADER_MISSING = 4015.0 ,
@@ -2736,6 +2750,7 @@ declare namespace shaka.util.Error {
2736
2750
  NO_RECOGNIZED_KEY_SYSTEMS = 6000.0 ,
2737
2751
  NO_VARIANTS = 4036.0 ,
2738
2752
  NO_VIDEO_ELEMENT = 7002.0 ,
2753
+ NO_WEB_CRYPTO_API = 4042.0 ,
2739
2754
  OBJECT_DESTROYED = 7003.0 ,
2740
2755
  OFFLINE_SESSION_REMOVED = 6013.0 ,
2741
2756
  OPERATION_ABORTED = 7001.0 ,
@@ -2831,11 +2846,27 @@ declare namespace shaka.util {
2831
2846
  * Common FairPlay response transform for some DRMs providers.
2832
2847
  */
2833
2848
  static commonFairPlayResponse (type : shaka.net.NetworkingEngine.RequestType , response : shaka.extern.Response ) : any ;
2849
+ /**
2850
+ * Conax FairPlay request.
2851
+ */
2852
+ static conaxFairPlayRequest (type : shaka.net.NetworkingEngine.RequestType , request : shaka.extern.Request ) : any ;
2853
+ /**
2854
+ * Conax initDataTransform configuration.
2855
+ */
2856
+ static conaxInitDataTransform (initData : Uint8Array , initDataType : string , drmInfo : shaka.extern.DrmInfo | null ) : any ;
2834
2857
  /**
2835
2858
  * Using the default method, extract a content ID from the init data. This is
2836
2859
  * based on the FairPlay example documentation.
2837
2860
  */
2838
2861
  static defaultGetContentId (initData : ArrayBuffer | ArrayBufferView ) : string ;
2862
+ /**
2863
+ * EZDRM FairPlay request.
2864
+ */
2865
+ static ezdrmFairPlayRequest (type : shaka.net.NetworkingEngine.RequestType , request : shaka.extern.Request ) : any ;
2866
+ /**
2867
+ * EZDRM initDataTransform configuration.
2868
+ */
2869
+ static ezdrmInitDataTransform (initData : Uint8Array , initDataType : string , drmInfo : shaka.extern.DrmInfo | null ) : any ;
2839
2870
  /**
2840
2871
  * Transforms the init data buffer using the given data. The format is:
2841
2872
  * <pre>
@@ -2854,9 +2885,13 @@ declare namespace shaka.util {
2854
2885
  */
2855
2886
  static isFairPlaySupported ( ) : Promise < boolean > ;
2856
2887
  /**
2857
- * SPC FairPlay request.
2888
+ * Verimatrix FairPlay request.
2889
+ */
2890
+ static verimatrixFairPlayRequest (type : shaka.net.NetworkingEngine.RequestType , request : shaka.extern.Request ) : any ;
2891
+ /**
2892
+ * Verimatrix initDataTransform configuration.
2858
2893
  */
2859
- static spcFairPlayRequest (type : shaka.net.NetworkingEngine.RequestType , request : shaka.extern.Request ) : any ;
2894
+ static verimatrixInitDataTransform (initData : Uint8Array , initDataType : string , drmInfo : shaka.extern.DrmInfo | null ) : any ;
2860
2895
  }
2861
2896
  }
2862
2897
  // Generated from /home/runner/work/shaka-player/shaka-player/dist/shaka-player.ui.debug.externs.js
@@ -3765,6 +3800,10 @@ declare namespace shaka.extern {
3765
3800
  * @param numBytes The total number of bytes transferred.
3766
3801
  */
3767
3802
  segmentDownloaded (deltaTimeMs : number , numBytes : number ) : any ;
3803
+ /**
3804
+ * Set media element.
3805
+ */
3806
+ setMediaElement (mediaElement : HTMLMediaElement | null ) : any ;
3768
3807
  /**
3769
3808
  * Updates manager's variants collection.
3770
3809
  */
@@ -3900,6 +3939,18 @@ declare namespace shaka.extern {
3900
3939
  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 } ;
3901
3940
  }
3902
3941
  // Generated from /home/runner/work/shaka-player/shaka-player/externs/shaka/manifest.js
3942
+ declare namespace shaka.extern {
3943
+ /**
3944
+ * A function that fetches the crypto keys for AES-128.
3945
+ * Returns a promise that resolves when the keys have been fetched.
3946
+ */
3947
+ type FetchCryptoKeysFunction = ( ) => Promise < any > ;
3948
+ }
3949
+ // Generated from /home/runner/work/shaka-player/shaka-player/externs/shaka/manifest.js
3950
+ declare namespace shaka.extern {
3951
+ type HlsAes128Key = { cryptoKey ? : webCrypto.CryptoKey | null , fetchKey ? : shaka.extern.CreateSegmentIndexFunction , firstMediaSequenceNumber : number , iv ? : Uint8Array , method : string } ;
3952
+ }
3953
+ // Generated from /home/runner/work/shaka-player/shaka-player/externs/shaka/manifest.js
3903
3954
  declare namespace shaka.extern {
3904
3955
  type InitDataOverride = { initData : Uint8Array , initDataType : string , keyId : string | null } ;
3905
3956
  }
@@ -4253,7 +4304,7 @@ declare namespace shaka.extern {
4253
4304
  }
4254
4305
  // Generated from /home/runner/work/shaka-player/shaka-player/externs/shaka/player.js
4255
4306
  declare namespace shaka.extern {
4256
- type AbrConfiguration = { advanced : shaka.extern.AdvancedAbrConfiguration , bandwidthDowngradeTarget : number , bandwidthUpgradeTarget : number , defaultBandwidthEstimate : number , enabled : boolean , restrictions : shaka.extern.Restrictions , switchInterval : number , useNetworkInformation : boolean } ;
4307
+ 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 } ;
4257
4308
  }
4258
4309
  // Generated from /home/runner/work/shaka-player/shaka-player/externs/shaka/player.js
4259
4310
  declare namespace shaka.extern {
@@ -258,13 +258,15 @@ shaka.util.Error.Code = {
258
258
  'DASH_XLINK_DEPTH_LIMIT': 4028,
259
259
  'CONTENT_UNSUPPORTED_BY_BROWSER': 4032,
260
260
  'CANNOT_ADD_EXTERNAL_TEXT_TO_LIVE_STREAM': 4033,
261
- 'HLS_AES_128_ENCRYPTION_NOT_SUPPORTED': 4034,
262
- 'HLS_INTERNAL_SKIP_STREAM': 4035,
263
261
  'NO_VARIANTS': 4036,
264
262
  'PERIOD_FLATTENING_FAILED': 4037,
265
263
  'INCONSISTENT_DRM_ACROSS_PERIODS': 4038,
266
264
  'HLS_VARIABLE_NOT_FOUND': 4039,
267
265
  'HLS_MSE_ENCRYPTED_MP2T_NOT_SUPPORTED': 4040,
266
+ 'HLS_MSE_ENCRYPTED_LEGACY_APPLE_MEDIA_KEYS_NOT_SUPPORTED': 4041,
267
+ 'NO_WEB_CRYPTO_API': 4042,
268
+ 'HLS_AES_128_INVALID_IV_LENGTH': 4043,
269
+ 'HLS_AES_128_INVALID_KEY_LENGTH': 4044,
268
270
  'STREAMING_ENGINE_STARTUP_INVALID_STATE': 5006,
269
271
  'NO_RECOGNIZED_KEY_SYSTEMS': 6000,
270
272
  'REQUESTED_KEY_SYSTEM_CONFIG_UNAVAILABLE': 6001,
@@ -1207,6 +1209,10 @@ shaka.abr.SimpleAbrManager = class {
1207
1209
  * @override
1208
1210
  */
1209
1211
  playbackRateChanged(rate) {}
1212
+ /**
1213
+ * @override
1214
+ */
1215
+ setMediaElement(mediaElement) {}
1210
1216
  /**
1211
1217
  * @override
1212
1218
  */
@@ -1440,7 +1446,8 @@ shaka.net.NetworkingEngine.RequestType = {
1440
1446
  'LICENSE': 2,
1441
1447
  'APP': 3,
1442
1448
  'TIMING': 4,
1443
- 'SERVER_CERTIFICATE': 5
1449
+ 'SERVER_CERTIFICATE': 5,
1450
+ 'KEY': 6
1444
1451
  };
1445
1452
  /**
1446
1453
  * Priority level for network scheme plugins.
@@ -1809,8 +1816,10 @@ shaka.media.SegmentReference = class {
1809
1816
  * @param {shaka.media.SegmentReference.Status=} status
1810
1817
  * The segment status is used to indicate that a segment does not exist or is
1811
1818
  * not available.
1819
+ * @param {?shaka.extern.HlsAes128Key=} hlsAes128Key
1820
+ * The segment's AES-128-CBC full segment encryption key and iv.
1812
1821
  */
1813
- constructor(startTime, endTime, uris, startByte, endByte, initSegmentReference, timestampOffset, appendWindowStart, appendWindowEnd, partialReferences, tilesLayout, tileDuration, syncTime, status) {}
1822
+ constructor(startTime, endTime, uris, startByte, endByte, initSegmentReference, timestampOffset, appendWindowStart, appendWindowEnd, partialReferences, tilesLayout, tileDuration, syncTime, status, hlsAes128Key) {}
1814
1823
  /**
1815
1824
  * Creates and returns the URIs of the resource containing the segment.
1816
1825
  * @return {!Array.<string>}
@@ -2157,6 +2166,10 @@ shaka.media.SegmentIterator = class {
2157
2166
  * @param {number} partialSegmentIndex
2158
2167
  */
2159
2168
  constructor(segmentIndex, index, partialSegmentIndex) {}
2169
+ /**
2170
+ * @return {number}
2171
+ */
2172
+ currentPosition() {}
2160
2173
  /**
2161
2174
  * @return {shaka.media.SegmentReference}
2162
2175
  */
@@ -3827,6 +3840,16 @@ shaka.polyfill.Orientation = class {
3827
3840
  */
3828
3841
  static install() {}
3829
3842
  };
3843
+ /**
3844
+ * @summary A polyfill to implement modern, standardized EME on top of Apple's
3845
+ * prefixed EME in Safari.
3846
+ */
3847
+ shaka.polyfill.PatchedMediaKeysApple = class {
3848
+ /**
3849
+ * Installs the polyfill if needed.
3850
+ */
3851
+ static install() {}
3852
+ };
3830
3853
  /**
3831
3854
  * @summary A polyfill to stub out
3832
3855
  * {@link https://bit.ly/EmeMar15 EME draft 12 March 2015} on browsers without
@@ -4106,11 +4129,44 @@ shaka.util.FairPlayUtils = class {
4106
4129
  */
4107
4130
  static initDataTransform(initData, contentId, cert) {}
4108
4131
  /**
4109
- * SPC FairPlay request.
4132
+ * Verimatrix initDataTransform configuration.
4133
+ * @param {!Uint8Array} initData
4134
+ * @param {string} initDataType
4135
+ * @param {?shaka.extern.DrmInfo} drmInfo
4136
+ */
4137
+ static verimatrixInitDataTransform(initData, initDataType, drmInfo) {}
4138
+ /**
4139
+ * EZDRM initDataTransform configuration.
4140
+ * @param {!Uint8Array} initData
4141
+ * @param {string} initDataType
4142
+ * @param {?shaka.extern.DrmInfo} drmInfo
4143
+ */
4144
+ static ezdrmInitDataTransform(initData, initDataType, drmInfo) {}
4145
+ /**
4146
+ * Conax initDataTransform configuration.
4147
+ * @param {!Uint8Array} initData
4148
+ * @param {string} initDataType
4149
+ * @param {?shaka.extern.DrmInfo} drmInfo
4150
+ */
4151
+ static conaxInitDataTransform(initData, initDataType, drmInfo) {}
4152
+ /**
4153
+ * Verimatrix FairPlay request.
4154
+ * @param {shaka.net.NetworkingEngine.RequestType} type
4155
+ * @param {shaka.extern.Request} request
4156
+ */
4157
+ static verimatrixFairPlayRequest(type, request) {}
4158
+ /**
4159
+ * EZDRM FairPlay request.
4160
+ * @param {shaka.net.NetworkingEngine.RequestType} type
4161
+ * @param {shaka.extern.Request} request
4162
+ */
4163
+ static ezdrmFairPlayRequest(type, request) {}
4164
+ /**
4165
+ * Conax FairPlay request.
4110
4166
  * @param {shaka.net.NetworkingEngine.RequestType} type
4111
4167
  * @param {shaka.extern.Request} request
4112
4168
  */
4113
- static spcFairPlayRequest(type, request) {}
4169
+ static conaxFairPlayRequest(type, request) {}
4114
4170
  /**
4115
4171
  * Common FairPlay response transform for some DRMs providers.
4116
4172
  * @param {shaka.net.NetworkingEngine.RequestType} type