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
@@ -597,13 +597,15 @@ shaka.util.Error.Code = {
597
597
  'DASH_XLINK_DEPTH_LIMIT': 4028,
598
598
  'CONTENT_UNSUPPORTED_BY_BROWSER': 4032,
599
599
  'CANNOT_ADD_EXTERNAL_TEXT_TO_LIVE_STREAM': 4033,
600
- 'HLS_AES_128_ENCRYPTION_NOT_SUPPORTED': 4034,
601
- 'HLS_INTERNAL_SKIP_STREAM': 4035,
602
600
  'NO_VARIANTS': 4036,
603
601
  'PERIOD_FLATTENING_FAILED': 4037,
604
602
  'INCONSISTENT_DRM_ACROSS_PERIODS': 4038,
605
603
  'HLS_VARIABLE_NOT_FOUND': 4039,
606
604
  'HLS_MSE_ENCRYPTED_MP2T_NOT_SUPPORTED': 4040,
605
+ 'HLS_MSE_ENCRYPTED_LEGACY_APPLE_MEDIA_KEYS_NOT_SUPPORTED': 4041,
606
+ 'NO_WEB_CRYPTO_API': 4042,
607
+ 'HLS_AES_128_INVALID_IV_LENGTH': 4043,
608
+ 'HLS_AES_128_INVALID_KEY_LENGTH': 4044,
607
609
  'STREAMING_ENGINE_STARTUP_INVALID_STATE': 5006,
608
610
  'NO_RECOGNIZED_KEY_SYSTEMS': 6000,
609
611
  'REQUESTED_KEY_SYSTEM_CONFIG_UNAVAILABLE': 6001,
@@ -1023,6 +1025,10 @@ shaka.abr.SimpleAbrManager = class {
1023
1025
  * @override
1024
1026
  */
1025
1027
  playbackRateChanged(rate) {}
1028
+ /**
1029
+ * @override
1030
+ */
1031
+ setMediaElement(mediaElement) {}
1026
1032
  /**
1027
1033
  * @override
1028
1034
  */
@@ -1333,7 +1339,8 @@ shaka.net.NetworkingEngine.RequestType = {
1333
1339
  'LICENSE': 2,
1334
1340
  'APP': 3,
1335
1341
  'TIMING': 4,
1336
- 'SERVER_CERTIFICATE': 5
1342
+ 'SERVER_CERTIFICATE': 5,
1343
+ 'KEY': 6
1337
1344
  };
1338
1345
  /**
1339
1346
  * Priority level for network scheme plugins.
@@ -1702,8 +1709,10 @@ shaka.media.SegmentReference = class {
1702
1709
  * @param {shaka.media.SegmentReference.Status=} status
1703
1710
  * The segment status is used to indicate that a segment does not exist or is
1704
1711
  * not available.
1712
+ * @param {?shaka.extern.HlsAes128Key=} hlsAes128Key
1713
+ * The segment's AES-128-CBC full segment encryption key and iv.
1705
1714
  */
1706
- constructor(startTime, endTime, uris, startByte, endByte, initSegmentReference, timestampOffset, appendWindowStart, appendWindowEnd, partialReferences, tilesLayout, tileDuration, syncTime, status) {}
1715
+ constructor(startTime, endTime, uris, startByte, endByte, initSegmentReference, timestampOffset, appendWindowStart, appendWindowEnd, partialReferences, tilesLayout, tileDuration, syncTime, status, hlsAes128Key) {}
1707
1716
  /**
1708
1717
  * Creates and returns the URIs of the resource containing the segment.
1709
1718
  * @return {!Array.<string>}
@@ -2050,6 +2059,10 @@ shaka.media.SegmentIterator = class {
2050
2059
  * @param {number} partialSegmentIndex
2051
2060
  */
2052
2061
  constructor(segmentIndex, index, partialSegmentIndex) {}
2062
+ /**
2063
+ * @return {number}
2064
+ */
2065
+ currentPosition() {}
2053
2066
  /**
2054
2067
  * @return {shaka.media.SegmentReference}
2055
2068
  */
@@ -3720,6 +3733,16 @@ shaka.polyfill.Orientation = class {
3720
3733
  */
3721
3734
  static install() {}
3722
3735
  };
3736
+ /**
3737
+ * @summary A polyfill to implement modern, standardized EME on top of Apple's
3738
+ * prefixed EME in Safari.
3739
+ */
3740
+ shaka.polyfill.PatchedMediaKeysApple = class {
3741
+ /**
3742
+ * Installs the polyfill if needed.
3743
+ */
3744
+ static install() {}
3745
+ };
3723
3746
  /**
3724
3747
  * @summary A polyfill to stub out
3725
3748
  * {@link https://bit.ly/EmeMar15 EME draft 12 March 2015} on browsers without
@@ -3999,11 +4022,44 @@ shaka.util.FairPlayUtils = class {
3999
4022
  */
4000
4023
  static initDataTransform(initData, contentId, cert) {}
4001
4024
  /**
4002
- * SPC FairPlay request.
4025
+ * Verimatrix initDataTransform configuration.
4026
+ * @param {!Uint8Array} initData
4027
+ * @param {string} initDataType
4028
+ * @param {?shaka.extern.DrmInfo} drmInfo
4029
+ */
4030
+ static verimatrixInitDataTransform(initData, initDataType, drmInfo) {}
4031
+ /**
4032
+ * EZDRM initDataTransform configuration.
4033
+ * @param {!Uint8Array} initData
4034
+ * @param {string} initDataType
4035
+ * @param {?shaka.extern.DrmInfo} drmInfo
4036
+ */
4037
+ static ezdrmInitDataTransform(initData, initDataType, drmInfo) {}
4038
+ /**
4039
+ * Conax initDataTransform configuration.
4040
+ * @param {!Uint8Array} initData
4041
+ * @param {string} initDataType
4042
+ * @param {?shaka.extern.DrmInfo} drmInfo
4043
+ */
4044
+ static conaxInitDataTransform(initData, initDataType, drmInfo) {}
4045
+ /**
4046
+ * Verimatrix FairPlay request.
4047
+ * @param {shaka.net.NetworkingEngine.RequestType} type
4048
+ * @param {shaka.extern.Request} request
4049
+ */
4050
+ static verimatrixFairPlayRequest(type, request) {}
4051
+ /**
4052
+ * EZDRM FairPlay request.
4053
+ * @param {shaka.net.NetworkingEngine.RequestType} type
4054
+ * @param {shaka.extern.Request} request
4055
+ */
4056
+ static ezdrmFairPlayRequest(type, request) {}
4057
+ /**
4058
+ * Conax FairPlay request.
4003
4059
  * @param {shaka.net.NetworkingEngine.RequestType} type
4004
4060
  * @param {shaka.extern.Request} request
4005
4061
  */
4006
- static spcFairPlayRequest(type, request) {}
4062
+ static conaxFairPlayRequest(type, request) {}
4007
4063
  /**
4008
4064
  * Common FairPlay response transform for some DRMs providers.
4009
4065
  * @param {shaka.net.NetworkingEngine.RequestType} type