shaka-player 3.1.5 → 3.2.3

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 (134) hide show
  1. package/CHANGELOG.md +129 -6
  2. package/README.md +4 -4
  3. package/build/types/polyfill +1 -0
  4. package/demo/common/asset.js +9 -7
  5. package/demo/common/assets.js +10 -1
  6. package/demo/common/message_ids.js +2 -1
  7. package/demo/config.js +5 -2
  8. package/demo/index.html +1 -1
  9. package/demo/locales/en.json +2 -1
  10. package/demo/locales/source.json +8 -4
  11. package/demo/main.js +2 -1
  12. package/dist/demo.compiled.debug.js +14 -14
  13. package/dist/demo.compiled.debug.map +2 -2
  14. package/dist/demo.compiled.js +14 -14
  15. package/dist/demo.compiled.map +2 -2
  16. package/dist/deps.js +21 -20
  17. package/dist/locales.js +30 -30
  18. package/dist/receiver.compiled.debug.js +8 -8
  19. package/dist/receiver.compiled.debug.map +2 -2
  20. package/dist/receiver.compiled.js +8 -8
  21. package/dist/receiver.compiled.map +2 -2
  22. package/dist/shaka-player.compiled.d.ts +63 -10
  23. package/dist/shaka-player.compiled.debug.d.ts +63 -10
  24. package/dist/shaka-player.compiled.debug.externs.js +786 -716
  25. package/dist/shaka-player.compiled.debug.js +563 -534
  26. package/dist/shaka-player.compiled.debug.map +4 -4
  27. package/dist/shaka-player.compiled.externs.js +786 -716
  28. package/dist/shaka-player.compiled.js +820 -809
  29. package/dist/shaka-player.compiled.map +4 -4
  30. package/dist/shaka-player.ui.d.ts +63 -10
  31. package/dist/shaka-player.ui.debug.d.ts +63 -10
  32. package/dist/shaka-player.ui.debug.externs.js +542 -472
  33. package/dist/shaka-player.ui.debug.js +594 -566
  34. package/dist/shaka-player.ui.debug.map +4 -4
  35. package/dist/shaka-player.ui.externs.js +542 -472
  36. package/dist/shaka-player.ui.js +938 -927
  37. package/dist/shaka-player.ui.map +4 -4
  38. package/docs/tutorials/ui.md +5 -5
  39. package/externs/aria.js +6 -0
  40. package/externs/shaka/ads.js +24 -1
  41. package/externs/shaka/manifest.js +6 -1
  42. package/externs/shaka/offline.js +5 -0
  43. package/externs/shaka/player.js +61 -9
  44. package/externs/shaka/text.js +10 -10
  45. package/externs/texttrack.js +3 -0
  46. package/lib/ads/ad_manager.js +16 -15
  47. package/lib/ads/client_side_ad_manager.js +6 -2
  48. package/lib/ads/server_side_ad_manager.js +19 -2
  49. package/lib/cast/cast_proxy.js +8 -0
  50. package/lib/cast/cast_utils.js +6 -1
  51. package/lib/cea/cea608_data_channel.js +56 -56
  52. package/lib/cea/cea608_memory.js +33 -33
  53. package/lib/cea/cea708_service.js +43 -43
  54. package/lib/cea/cea708_window.js +38 -38
  55. package/lib/cea/cea_decoder.js +13 -14
  56. package/lib/cea/cea_utils.js +23 -23
  57. package/lib/cea/dtvcc_packet_builder.js +7 -7
  58. package/lib/cea/i_caption_decoder.js +2 -3
  59. package/lib/cea/i_cea_parser.js +2 -2
  60. package/lib/cea/mp4_cea_parser.js +6 -6
  61. package/lib/dash/dash_parser.js +5 -0
  62. package/lib/hls/hls_parser.js +159 -12
  63. package/lib/media/closed_caption_parser.js +1 -2
  64. package/lib/media/drm_engine.js +162 -192
  65. package/lib/media/segment_index.js +4 -1
  66. package/lib/media/segment_reference.js +37 -2
  67. package/lib/media/streaming_engine.js +6 -6
  68. package/lib/net/networking_engine.js +1 -0
  69. package/lib/offline/download_manager.js +1 -2
  70. package/lib/offline/indexeddb/v1_storage_cell.js +1 -0
  71. package/lib/offline/indexeddb/v2_storage_cell.js +1 -0
  72. package/lib/offline/manifest_converter.js +3 -1
  73. package/lib/offline/storage.js +12 -14
  74. package/lib/player.js +426 -149
  75. package/lib/polyfill/aria.js +82 -0
  76. package/lib/routing/walker.js +2 -3
  77. package/lib/text/srt_text_parser.js +4 -4
  78. package/lib/text/text_engine.js +2 -2
  79. package/lib/text/vtt_text_parser.js +2 -2
  80. package/lib/text/web_vtt_generator.js +55 -12
  81. package/lib/util/error.js +6 -0
  82. package/lib/util/manifest_parser_utils.js +1 -0
  83. package/lib/util/mp4_box_parsers.js +20 -20
  84. package/lib/util/multi_map.js +8 -0
  85. package/lib/util/player_configuration.js +13 -1
  86. package/lib/util/stream_utils.js +168 -88
  87. package/lib/util/xml_utils.js +31 -12
  88. package/package.json +1 -1
  89. package/roadmap.md +24 -22
  90. package/shaka-player.uncompiled.js +1 -0
  91. package/test/cast/cast_utils_unit.js +1 -0
  92. package/test/cea/cea608_memory_unit.js +1 -1
  93. package/test/cea/cea708_service_unit.js +8 -8
  94. package/test/cea/cea708_window_unit.js +6 -6
  95. package/test/cea/cea_decoder_unit.js +1 -1
  96. package/test/cea/dtvcc_packet_builder_unit.js +2 -2
  97. package/test/dash/dash_parser_manifest_unit.js +43 -1
  98. package/test/hls/hls_parser_unit.js +250 -0
  99. package/test/media/drm_engine_integration.js +86 -12
  100. package/test/media/drm_engine_unit.js +310 -450
  101. package/test/offline/manifest_convert_unit.js +2 -0
  102. package/test/offline/storage_integration.js +9 -19
  103. package/test/player_integration.js +85 -0
  104. package/test/player_src_equals_integration.js +85 -0
  105. package/test/player_unit.js +25 -37
  106. package/test/test/assets/chapters.srt +11 -0
  107. package/test/test/assets/chapters.vtt +10 -0
  108. package/test/test/assets/chapters2.vtt +10 -0
  109. package/test/test/util/cea_utils.js +12 -12
  110. package/test/test/util/fake_ad_manager.js +7 -0
  111. package/test/test/util/manifest_generator.js +2 -0
  112. package/test/test/util/manifest_parser_util.js +3 -1
  113. package/test/text/web_vtt_generator_unit.js +81 -7
  114. package/test/util/stream_utils_unit.js +118 -10
  115. package/ui/airplay_button.js +1 -1
  116. package/ui/audio_language_selection.js +2 -5
  117. package/ui/cast_button.js +4 -6
  118. package/ui/constants.js +0 -3
  119. package/ui/fast_forward_button.js +2 -3
  120. package/ui/fullscreen_button.js +1 -3
  121. package/ui/language_utils.js +1 -1
  122. package/ui/loop_button.js +1 -3
  123. package/ui/mute_button.js +1 -3
  124. package/ui/overflow_menu.js +2 -3
  125. package/ui/pip_button.js +5 -7
  126. package/ui/playback_rate_selection.js +3 -6
  127. package/ui/presentation_time.js +1 -3
  128. package/ui/resolution_selection.js +4 -7
  129. package/ui/rewind_button.js +2 -3
  130. package/ui/seek_bar.js +2 -4
  131. package/ui/spacer.js +1 -1
  132. package/ui/text_selection.js +8 -11
  133. package/ui/ui_utils.js +1 -1
  134. package/ui/volume_bar.js +1 -3
@@ -0,0 +1,82 @@
1
+ /*! @license
2
+ * Shaka Player
3
+ * Copyright 2016 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+
7
+ goog.provide('shaka.polyfill.Aria');
8
+
9
+ goog.require('shaka.log');
10
+ goog.require('shaka.polyfill');
11
+
12
+ /**
13
+ * @summary A polyfill to add support for the ARIAMixin interface mixin, for
14
+ * browsers that do not implement it (e.g. Firefox).
15
+ * Note that IE also does not support ARIAMixin, but this polyfill does not work
16
+ * for that platform, as it relies on getters and setters.
17
+ * @see https://w3c.github.io/aria/#ARIAMixin
18
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/Element
19
+ * @export
20
+ */
21
+ shaka.polyfill.Aria = class {
22
+ /**
23
+ * Install the polyfill if needed.
24
+ * @export
25
+ */
26
+ static install() {
27
+ // eslint-disable-next-line no-restricted-syntax
28
+ if (Object.getOwnPropertyDescriptor(Element.prototype, 'ariaHidden')) {
29
+ shaka.log.info('Using native ARIAMixin interface.');
30
+ return;
31
+ }
32
+ shaka.log.info('ARIAMixin interface not detected. Installing polyfill.');
33
+
34
+ // Define a list of all of the ARIAMixin properties that we have externs
35
+ // for.
36
+ const attributes = [
37
+ 'ariaHidden',
38
+ 'ariaLabel',
39
+ 'ariaPressed',
40
+ 'ariaSelected',
41
+ ];
42
+
43
+ // Add each attribute, one by one.
44
+ for (const attribute of attributes) {
45
+ shaka.polyfill.Aria.addARIAMixinAttribute_(attribute);
46
+ }
47
+ }
48
+
49
+ /**
50
+ * Adds an attribute with the given name.
51
+ * @param {string} name The name of the attribute, in camelCase.
52
+ * @private
53
+ */
54
+ static addARIAMixinAttribute_(name) {
55
+ const baseName = name.toLowerCase().replace(/^aria/, '');
56
+ // NOTE: All the attributes listed in the method above begin with "aria".
57
+ // However, to add extra protection against the possibility of XSS attacks
58
+ // through this method, this enforces "aria-" at the beginning of the
59
+ // snake-case name, even if somehow "aria" were missing from the input.
60
+ const snakeCaseName = `aria-${baseName}`;
61
+
62
+ /* eslint-disable no-restricted-syntax */
63
+ Object.defineProperty(Element.prototype, name, {
64
+ get() {
65
+ const element = /** @type {!Element} */ (this);
66
+ return element.getAttribute(snakeCaseName);
67
+ },
68
+ set(value) {
69
+ const element = /** @type {!Element} */ (this);
70
+ if (value == null || value == undefined) {
71
+ element.removeAttribute(snakeCaseName);
72
+ } else {
73
+ element.setAttribute(snakeCaseName, value);
74
+ }
75
+ },
76
+ });
77
+ /* eslint-enable no-restricted-syntax */
78
+ }
79
+ };
80
+
81
+
82
+ shaka.polyfill.register(shaka.polyfill.Aria.install);
@@ -5,7 +5,6 @@
5
5
  */
6
6
 
7
7
  goog.provide('shaka.routing.Walker');
8
- goog.provide('shaka.routing.Walker.Implementation');
9
8
 
10
9
  goog.require('goog.asserts');
11
10
  goog.require('shaka.routing.Node');
@@ -81,7 +80,7 @@ shaka.routing.Walker = class {
81
80
  * new work is added (and this is not null) it can be resolved. The only
82
81
  * time when this should be non-null is when we are waiting for more work.
83
82
  *
84
- * @private {shaka.util.PublicPromise}
83
+ * @private {?shaka.util.PublicPromise}
85
84
  */
86
85
  this.waitForWork_ = null;
87
86
 
@@ -91,7 +90,7 @@ shaka.routing.Walker = class {
91
90
  /** @private {?shaka.routing.Walker.ActiveRoute_} */
92
91
  this.currentRoute_ = null;
93
92
 
94
- /** @private {shaka.util.AbortableOperation} */
93
+ /** @private {?shaka.util.AbortableOperation} */
95
94
  this.currentStep_ = null;
96
95
 
97
96
  /**
@@ -57,8 +57,8 @@ shaka.text.SrtTextParser = class {
57
57
  /**
58
58
  * Convert a SRT format to WebVTT
59
59
  *
60
- * @param {!string} data
61
- * @return {!string}
60
+ * @param {string} data
61
+ * @return {string}
62
62
  * @export
63
63
  */
64
64
  static srt2webvtt(data) {
@@ -87,8 +87,8 @@ shaka.text.SrtTextParser = class {
87
87
  /**
88
88
  * Convert a SRT cue into WebVTT cue
89
89
  *
90
- * @param {!string} caption
91
- * @return {!string}
90
+ * @param {string} caption
91
+ * @return {string}
92
92
  * @private
93
93
  */
94
94
  static convertSrtCue_(caption) {
@@ -12,7 +12,7 @@ goog.require('shaka.util.BufferUtils');
12
12
  goog.require('shaka.util.Functional');
13
13
  goog.require('shaka.util.IDestroyable');
14
14
  goog.require('shaka.util.MimeUtils');
15
- goog.requireType('shaka.cea.ICaptionDecoder.ClosedCaption');
15
+ goog.requireType('shaka.cea.ICaptionDecoder');
16
16
 
17
17
 
18
18
  // TODO: revisit this when Closure Compiler supports partially-exported classes.
@@ -24,7 +24,7 @@ goog.requireType('shaka.cea.ICaptionDecoder.ClosedCaption');
24
24
  shaka.text.TextEngine = class {
25
25
  /** @param {shaka.extern.TextDisplayer} displayer */
26
26
  constructor(displayer) {
27
- /** @private {shaka.extern.TextParser} */
27
+ /** @private {?shaka.extern.TextParser} */
28
28
  this.parser_ = null;
29
29
 
30
30
  /** @private {shaka.extern.TextDisplayer} */
@@ -464,8 +464,8 @@ shaka.text.VttTextParser = class {
464
464
  }
465
465
 
466
466
  /**
467
- * @param {!string} value
468
- * @param {!string} defaultValue
467
+ * @param {string} value
468
+ * @param {string} defaultValue
469
469
  * @private
470
470
  */
471
471
  static getOrDefault_(value, defaultValue) {
@@ -17,9 +17,10 @@ goog.require('shaka.text.Cue');
17
17
  shaka.text.WebVttGenerator = class {
18
18
  /**
19
19
  * @param {!Array.<!shaka.text.Cue>} cues
20
+ * @param {!Array.<!shaka.extern.AdCuePoint>} adCuePoints
20
21
  * @return {string}
21
22
  */
22
- static convert(cues) {
23
+ static convert(cues, adCuePoints) {
23
24
  // Flatten nested cue payloads recursively. If a cue has nested cues,
24
25
  // their contents should be combined and replace the payload of the parent.
25
26
  const flattenPayload = (cue) => {
@@ -64,6 +65,25 @@ shaka.text.WebVttGenerator = class {
64
65
  }
65
66
  };
66
67
 
68
+ const webvttTimeString = (time) => {
69
+ let newTime = time;
70
+ for (const adCuePoint of adCuePoints) {
71
+ if (adCuePoint.end && adCuePoint.start < time) {
72
+ const offset = adCuePoint.end - adCuePoint.start;
73
+ newTime += offset;
74
+ }
75
+ }
76
+ const hours = Math.floor(newTime / 3600);
77
+ const minutes = Math.floor(newTime / 60 % 60);
78
+ const seconds = Math.floor(newTime % 60);
79
+ const milliseconds = Math.floor(newTime * 1000 % 1000);
80
+ return (hours < 10 ? '0' : '') + hours + ':' +
81
+ (minutes < 10 ? '0' : '') + minutes + ':' +
82
+ (seconds < 10 ? '0' : '') + seconds + '.' +
83
+ (milliseconds < 100 ? (milliseconds < 10 ? '00' : '0') : '') +
84
+ milliseconds;
85
+ };
86
+
67
87
  // We don't want to modify the array or objects passed in, since we don't
68
88
  // technically own them. So we build a new array and replace certain items
69
89
  // in it if they need to be flattened.
@@ -80,19 +100,42 @@ shaka.text.WebVttGenerator = class {
80
100
 
81
101
  let webvttString = 'WEBVTT\n\n';
82
102
  for (const cue of flattenedCues) {
83
- const webvttTimeString = (time) => {
84
- const hours = Math.floor(time / 3600);
85
- const minutes = Math.floor(time / 60 % 60);
86
- const seconds = Math.floor(time % 60);
87
- const milliseconds = Math.floor(time * 1000 % 1000);
88
- return (hours < 10 ? '0' : '') + hours + ':' +
89
- (minutes < 10 ? '0' : '') + minutes + ':' +
90
- (seconds < 10 ? '0' : '') + seconds + '.' +
91
- (milliseconds < 100 ? (milliseconds < 10 ? '00' : '0') : '') +
92
- milliseconds;
103
+ const webvttSettings = (cue) => {
104
+ const settings = [];
105
+ const Cue = shaka.text.Cue;
106
+ switch (cue.textAlign) {
107
+ case Cue.textAlign.LEFT:
108
+ settings.push('align:left');
109
+ break;
110
+ case Cue.textAlign.RIGHT:
111
+ settings.push('align:right');
112
+ break;
113
+ case Cue.textAlign.CENTER:
114
+ settings.push('align:middle');
115
+ break;
116
+ case Cue.textAlign.START:
117
+ settings.push('align:start');
118
+ break;
119
+ case Cue.textAlign.END:
120
+ settings.push('align:end');
121
+ break;
122
+ }
123
+ switch (cue.writingMode) {
124
+ case Cue.writingMode.VERTICAL_LEFT_TO_RIGHT:
125
+ settings.push('vertical:lr');
126
+ break;
127
+ case Cue.writingMode.VERTICAL_RIGHT_TO_LEFT:
128
+ settings.push('vertical:rl');
129
+ break;
130
+ }
131
+
132
+ if (settings.length) {
133
+ return ' ' + settings.join(' ');
134
+ }
135
+ return '';
93
136
  };
94
137
  webvttString += webvttTimeString(cue.startTime) + ' --> ' +
95
- webvttTimeString(cue.endTime) + '\n';
138
+ webvttTimeString(cue.endTime) + webvttSettings(cue) + '\n';
96
139
  webvttString += cue.payload + '\n\n';
97
140
  }
98
141
  return webvttString;
package/lib/util/error.js CHANGED
@@ -814,6 +814,12 @@ shaka.util.Error.Code = {
814
814
  */
815
815
  'INIT_DATA_TRANSFORM_ERROR': 6016,
816
816
 
817
+ /**
818
+ * The server certificate request failed.
819
+ * <br> error.data[0] is a shaka.util.Error from the networking engine.
820
+ */
821
+ 'SERVER_CERTIFICATE_REQUEST_FAILED': 6017,
822
+
817
823
 
818
824
  /**
819
825
  * The call to Player.load() was interrupted by a call to Player.unload()
@@ -55,6 +55,7 @@ shaka.util.ManifestParserUtils = class {
55
55
  audioRobustness: '',
56
56
  videoRobustness: '',
57
57
  serverCertificate: null,
58
+ serverCertificateUri: '',
58
59
  sessionType: '',
59
60
  initData: initData || [],
60
61
  keyIds: new Set(),
@@ -14,7 +14,7 @@ shaka.util.Mp4BoxParsers = class {
14
14
  /**
15
15
  * Parses a TFHD Box.
16
16
  * @param {!shaka.util.DataViewReader} reader
17
- * @param {!number} flags
17
+ * @param {number} flags
18
18
  * @return {!shaka.util.ParsedTFHDBox}
19
19
  */
20
20
  static parseTFHD(reader, flags) {
@@ -53,7 +53,7 @@ shaka.util.Mp4BoxParsers = class {
53
53
  /**
54
54
  * Parses a TFDT Box.
55
55
  * @param {!shaka.util.DataViewReader} reader
56
- * @param {!number} version
56
+ * @param {number} version
57
57
  * @return {!shaka.util.ParsedTFDTBox}
58
58
  */
59
59
  static parseTFDT(reader, version) {
@@ -68,7 +68,7 @@ shaka.util.Mp4BoxParsers = class {
68
68
  /**
69
69
  * Parses a MDHD Box.
70
70
  * @param {!shaka.util.DataViewReader} reader
71
- * @param {!number} version
71
+ * @param {number} version
72
72
  * @return {!shaka.util.ParsedMDHDBox}
73
73
  */
74
74
  static parseMDHD(reader, version) {
@@ -107,8 +107,8 @@ shaka.util.Mp4BoxParsers = class {
107
107
  /**
108
108
  * Parses a TRUN Box.
109
109
  * @param {!shaka.util.DataViewReader} reader
110
- * @param {!number} version
111
- * @param {!number} flags
110
+ * @param {number} version
111
+ * @param {number} flags
112
112
  * @return {!shaka.util.ParsedTRUNBox}
113
113
  */
114
114
  static parseTRUN(reader, version, flags) {
@@ -168,7 +168,7 @@ shaka.util.Mp4BoxParsers = class {
168
168
  /**
169
169
  * Parses a TKHD Box.
170
170
  * @param {!shaka.util.DataViewReader} reader
171
- * @param {!number} version
171
+ * @param {number} version
172
172
  * @return {!shaka.util.ParsedTKHDBox}
173
173
  */
174
174
  static parseTKHD(reader, version) {
@@ -192,12 +192,12 @@ shaka.util.Mp4BoxParsers = class {
192
192
 
193
193
  /**
194
194
  * @typedef {{
195
- * trackId: !number,
195
+ * trackId: number,
196
196
  * defaultSampleDuration: ?number,
197
197
  * defaultSampleSize: ?number
198
198
  * }}
199
199
  *
200
- * @property {!number} trackId
200
+ * @property {number} trackId
201
201
  * As per the spec: an integer that uniquely identifies this
202
202
  * track over the entire life‐time of this presentation
203
203
  * @property {?number} defaultSampleDuration
@@ -213,10 +213,10 @@ shaka.util.ParsedTFHDBox;
213
213
 
214
214
  /**
215
215
  * @typedef {{
216
- * baseMediaDecodeTime: !number
216
+ * baseMediaDecodeTime: number
217
217
  * }}
218
218
  *
219
- * @property {!number} baseMediaDecodeTime
219
+ * @property {number} baseMediaDecodeTime
220
220
  * As per the spec: the absolute decode time, measured on the media
221
221
  * timeline, of the first sample in decode order in the track fragment
222
222
  *
@@ -226,10 +226,10 @@ shaka.util.ParsedTFDTBox;
226
226
 
227
227
  /**
228
228
  * @typedef {{
229
- * timescale: !number
229
+ * timescale: number
230
230
  * }}
231
231
  *
232
- * @property {!number} timescale
232
+ * @property {number} timescale
233
233
  * As per the spec: an integer that specifies the time‐scale for this media;
234
234
  * this is the number of time units that pass in one second
235
235
  *
@@ -239,13 +239,13 @@ shaka.util.ParsedMDHDBox;
239
239
 
240
240
  /**
241
241
  * @typedef {{
242
- * defaultSampleDuration: !number,
243
- * defaultSampleSize: !number
242
+ * defaultSampleDuration: number,
243
+ * defaultSampleSize: number
244
244
  * }}
245
245
  *
246
- * @property {!number} defaultSampleDuration
246
+ * @property {number} defaultSampleDuration
247
247
  * The default sample duration to be used in track fragments
248
- * @property {!number} defaultSampleSize
248
+ * @property {number} defaultSampleSize
249
249
  * The default sample size to be used in track fragments
250
250
  *
251
251
  * @exportDoc
@@ -254,11 +254,11 @@ shaka.util.ParsedTREXBox;
254
254
 
255
255
  /**
256
256
  * @typedef {{
257
- * sampleCount: !number,
257
+ * sampleCount: number,
258
258
  * sampleData: !Array.<shaka.util.ParsedTRUNSample>
259
259
  * }}
260
260
  *
261
- * @property {!number} sampleCount
261
+ * @property {number} sampleCount
262
262
  * As per the spec: the number of samples being added in this run;
263
263
  * @property {!Array.<shaka.util.ParsedTRUNSample>} sampleData
264
264
  * An array of size <sampleCount> containing data for each sample
@@ -290,10 +290,10 @@ shaka.util.ParsedTRUNSample;
290
290
 
291
291
  /**
292
292
  * @typedef {{
293
- * trackId: !number
293
+ * trackId: number
294
294
  * }}
295
295
  *
296
- * @property {!number} trackId
296
+ * @property {number} trackId
297
297
  * Unique ID indicative of this track
298
298
  *
299
299
  * @exportDoc
@@ -102,4 +102,12 @@ shaka.util.MultiMap = class {
102
102
  size() {
103
103
  return Object.keys(this.map_).length;
104
104
  }
105
+
106
+ /**
107
+ * Get a list of all the keys.
108
+ * @return {!Array.<string>}
109
+ */
110
+ keys() {
111
+ return Object.keys(this.map_);
112
+ }
105
113
  };
@@ -75,6 +75,7 @@ shaka.util.PlayerConfiguration = class {
75
75
  initDataTransform: shaka.media.DrmEngine.defaultInitDataTransform,
76
76
  logLicenseExchange: false,
77
77
  updateExpirationTime: 1,
78
+ preferredKeySystems: [],
78
79
  };
79
80
 
80
81
  const manifest = {
@@ -108,9 +109,16 @@ shaka.util.PlayerConfiguration = class {
108
109
  'urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb':
109
110
  'com.adobe.primetime',
110
111
  },
112
+ // Need some operation in the callback or else closure may remove calls
113
+ // to the function as it would be a no-op. The operation can't just be
114
+ // a log message, because those are stripped in the compiled build.
115
+ manifestPreprocessor: (element) => {
116
+ return element;
117
+ },
111
118
  },
112
119
  hls: {
113
120
  ignoreTextStreamFailures: false,
121
+ ignoreImageStreamFailures: false,
114
122
  useFullSegmentsForStartTime: false,
115
123
  },
116
124
  };
@@ -154,6 +162,7 @@ shaka.util.PlayerConfiguration = class {
154
162
  autoLowLatencyMode: false,
155
163
  forceHTTPS: false,
156
164
  preferNativeHls: false,
165
+ updateIntervalSeconds: 1,
157
166
  };
158
167
 
159
168
  // Some browsers will stop earlier than others before a gap (e.g., Edge
@@ -241,7 +250,10 @@ shaka.util.PlayerConfiguration = class {
241
250
  preferredVariantRole: '',
242
251
  preferredTextRole: '',
243
252
  preferredAudioChannelCount: 2,
253
+ preferredVideoCodecs: [],
254
+ preferredAudioCodecs: [],
244
255
  preferForcedSubs: false,
256
+ preferredDecodingAttributes: [],
245
257
  restrictions: {
246
258
  minWidth: 0,
247
259
  maxWidth: Infinity,
@@ -256,7 +268,6 @@ shaka.util.PlayerConfiguration = class {
256
268
  },
257
269
  playRangeStart: 0,
258
270
  playRangeEnd: Infinity,
259
- useMediaCapabilities: false,
260
271
  textDisplayFactory: () => null,
261
272
  };
262
273
 
@@ -293,6 +304,7 @@ shaka.util.PlayerConfiguration = class {
293
304
  audioRobustness: '',
294
305
  sessionType: '',
295
306
  serverCertificate: new Uint8Array(0),
307
+ serverCertificateUri: '',
296
308
  individualizationServer: '',
297
309
  },
298
310
  };