shaka-player 4.7.13 → 4.8.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 (114) hide show
  1. package/AUTHORS +2 -0
  2. package/CONTRIBUTORS +2 -0
  3. package/LICENSE +54 -0
  4. package/README.md +22 -1
  5. package/dist/controls.css +1 -1
  6. package/dist/controls.css.map +1 -1
  7. package/dist/deps.js +34 -23
  8. package/dist/locales.js +41 -31
  9. package/dist/shaka-player.compiled.d.ts +196 -45
  10. package/dist/shaka-player.compiled.debug.d.ts +196 -45
  11. package/dist/shaka-player.compiled.debug.externs.js +491 -348
  12. package/dist/shaka-player.compiled.debug.js +969 -847
  13. package/dist/shaka-player.compiled.debug.map +4 -4
  14. package/dist/shaka-player.compiled.externs.js +491 -348
  15. package/dist/shaka-player.compiled.js +1238 -1171
  16. package/dist/shaka-player.compiled.map +4 -4
  17. package/dist/shaka-player.ui.d.ts +259 -48
  18. package/dist/shaka-player.ui.debug.d.ts +259 -48
  19. package/dist/shaka-player.ui.debug.externs.js +598 -377
  20. package/dist/shaka-player.ui.debug.js +1185 -980
  21. package/dist/shaka-player.ui.debug.map +4 -4
  22. package/dist/shaka-player.ui.externs.js +598 -377
  23. package/dist/shaka-player.ui.js +1526 -1408
  24. package/dist/shaka-player.ui.map +4 -4
  25. package/externs/device_sensor_event.js +18 -0
  26. package/externs/hisense.js +16 -0
  27. package/externs/playstation.js +31 -0
  28. package/externs/shaka/abr_manager.js +3 -1
  29. package/externs/shaka/ads.js +5 -0
  30. package/externs/shaka/codecs.js +13 -0
  31. package/externs/shaka/manifest.js +58 -6
  32. package/externs/shaka/net.js +13 -1
  33. package/externs/shaka/player.js +184 -13
  34. package/externs/shaka/text.js +19 -0
  35. package/externs/tizen.js +41 -0
  36. package/externs/webos.js +19 -0
  37. package/externs/xbox.js +43 -0
  38. package/lib/abr/simple_abr_manager.js +9 -1
  39. package/lib/ads/ad_manager.js +19 -2
  40. package/lib/ads/client_side_ad_manager.js +5 -3
  41. package/lib/ads/media_tailor_ad_manager.js +9 -0
  42. package/lib/cast/cast_receiver.js +0 -14
  43. package/lib/cast/cast_utils.js +1 -0
  44. package/lib/cea/mp4_cea_parser.js +6 -1
  45. package/lib/dash/content_protection.js +97 -53
  46. package/lib/dash/dash_parser.js +237 -177
  47. package/lib/dash/mpd_utils.js +72 -65
  48. package/lib/dash/segment_base.js +27 -21
  49. package/lib/dash/segment_list.js +18 -16
  50. package/lib/dash/segment_template.js +45 -22
  51. package/lib/hls/hls_parser.js +358 -164
  52. package/lib/media/buffering_observer.js +25 -1
  53. package/lib/media/drm_engine.js +91 -71
  54. package/lib/media/manifest_filterer.js +220 -0
  55. package/lib/media/media_source_engine.js +34 -5
  56. package/lib/media/preload_manager.js +827 -0
  57. package/lib/media/presentation_timeline.js +11 -0
  58. package/lib/media/segment_index.js +93 -47
  59. package/lib/media/segment_prefetch.js +140 -43
  60. package/lib/media/segment_reference.js +43 -8
  61. package/lib/media/segment_utils.js +208 -25
  62. package/lib/media/streaming_engine.js +355 -66
  63. package/lib/mss/content_protection.js +31 -25
  64. package/lib/mss/mss_parser.js +79 -55
  65. package/lib/net/networking_engine.js +49 -4
  66. package/lib/offline/storage.js +3 -3
  67. package/lib/player.js +882 -672
  68. package/lib/polyfill/media_capabilities.js +16 -1
  69. package/lib/text/simple_text_displayer.js +9 -0
  70. package/lib/text/stub_text_displayer.js +7 -0
  71. package/lib/text/text_engine.js +16 -3
  72. package/lib/text/ttml_text_parser.js +116 -114
  73. package/lib/text/ui_text_displayer.js +28 -11
  74. package/lib/text/vtt_text_parser.js +54 -115
  75. package/lib/transmuxer/opus.js +91 -0
  76. package/lib/transmuxer/ts_transmuxer.js +115 -0
  77. package/lib/util/cmcd_manager.js +153 -3
  78. package/lib/util/dom_utils.js +11 -0
  79. package/lib/util/error.js +5 -0
  80. package/lib/util/fake_event.js +2 -0
  81. package/lib/util/manifest_parser_utils.js +97 -3
  82. package/lib/util/mp4_box_parsers.js +346 -17
  83. package/lib/util/mp4_generator.js +23 -0
  84. package/lib/util/periods.js +19 -0
  85. package/lib/util/platform.js +161 -9
  86. package/lib/util/player_configuration.js +79 -13
  87. package/lib/util/stats.js +16 -0
  88. package/lib/util/stream_utils.js +22 -8
  89. package/lib/util/string_utils.js +36 -0
  90. package/lib/util/tXml.js +814 -0
  91. package/lib/util/ts_parser.js +50 -0
  92. package/lib/util/xml_utils.js +10 -338
  93. package/package.json +2 -2
  94. package/shaka-player.uncompiled.js +8 -0
  95. package/ui/controls.js +187 -5
  96. package/ui/enums.js +2 -0
  97. package/ui/externs/ui.js +30 -3
  98. package/ui/gl_matrix/matrix_4x4.js +568 -0
  99. package/ui/gl_matrix/matrix_quaternion.js +45 -0
  100. package/ui/less/containers.less +11 -0
  101. package/ui/locales/en-GB.json +2 -0
  102. package/ui/locales/en.json +2 -0
  103. package/ui/locales/es-419.json +2 -0
  104. package/ui/locales/es.json +2 -0
  105. package/ui/locales/source.json +8 -0
  106. package/ui/recenter_vr.js +126 -0
  107. package/ui/resolution_selection.js +25 -5
  108. package/ui/statistics_button.js +12 -0
  109. package/ui/text_selection.js +1 -1
  110. package/ui/toggle_stereoscopic.js +127 -0
  111. package/ui/ui.js +74 -38
  112. package/ui/vr_manager.js +557 -0
  113. package/ui/vr_utils.js +232 -0
  114. package/ui/vr_webgl.js +697 -0
@@ -32,11 +32,11 @@ shaka.media.InitSegmentReference = class {
32
32
  * the quality of the media associated with this init segment.
33
33
  * @param {(null|number)=} timescale
34
34
  * @param {(null|BufferSource)=} segmentData
35
- * @param {?shaka.extern.aes128Key=} aes128Key
35
+ * @param {?shaka.extern.aesKey=} aesKey
36
36
  * The segment's AES-128-CBC full segment encryption key and iv.
37
37
  */
38
38
  constructor(uris, startByte, endByte, mediaQuality = null, timescale = null,
39
- segmentData = null, aes128Key = null) {
39
+ segmentData = null, aesKey = null) {
40
40
  /** @type {function():!Array.<string>} */
41
41
  this.getUris = uris;
42
42
 
@@ -55,8 +55,8 @@ shaka.media.InitSegmentReference = class {
55
55
  /** @type {BufferSource|null} */
56
56
  this.segmentData = segmentData;
57
57
 
58
- /** @type {?shaka.extern.aes128Key} */
59
- this.aes128Key = aes128Key;
58
+ /** @type {?shaka.extern.aesKey} */
59
+ this.aesKey = aesKey;
60
60
 
61
61
  /** @type {?string} */
62
62
  this.codecs = null;
@@ -206,7 +206,7 @@ shaka.media.SegmentReference = class {
206
206
  * @param {shaka.media.SegmentReference.Status=} status
207
207
  * The segment status is used to indicate that a segment does not exist or is
208
208
  * not available.
209
- * @param {?shaka.extern.aes128Key=} aes128Key
209
+ * @param {?shaka.extern.aesKey=} aesKey
210
210
  * The segment's AES-128-CBC full segment encryption key and iv.
211
211
  * @param {boolean=} allPartialSegments
212
212
  * Indicate if the segment has all partial segments
@@ -216,7 +216,7 @@ shaka.media.SegmentReference = class {
216
216
  timestampOffset, appendWindowStart, appendWindowEnd,
217
217
  partialReferences = [], tilesLayout = '', tileDuration = null,
218
218
  syncTime = null, status = shaka.media.SegmentReference.Status.AVAILABLE,
219
- aes128Key = null, allPartialSegments = false) {
219
+ aesKey = null, allPartialSegments = false) {
220
220
  // A preload hinted Partial Segment has the same startTime and endTime.
221
221
  goog.asserts.assert(startTime <= endTime,
222
222
  'startTime must be less than or equal to endTime');
@@ -288,8 +288,8 @@ shaka.media.SegmentReference = class {
288
288
  /** @type {boolean} */
289
289
  this.byterangeOptimization = false;
290
290
 
291
- /** @type {?shaka.extern.aes128Key} */
292
- this.aes128Key = aes128Key;
291
+ /** @type {?shaka.extern.aesKey} */
292
+ this.aesKey = aesKey;
293
293
 
294
294
  /** @type {?shaka.media.SegmentReference.ThumbnailSprite} */
295
295
  this.thumbnailSprite = null;
@@ -320,6 +320,9 @@ shaka.media.SegmentReference = class {
320
320
 
321
321
  /** @type {?string} */
322
322
  this.mimeType = null;
323
+
324
+ /** @type {BufferSource|null} */
325
+ this.segmentData = null;
323
326
  }
324
327
 
325
328
  /**
@@ -598,6 +601,38 @@ shaka.media.SegmentReference = class {
598
601
  this.offset(offset);
599
602
  }
600
603
  }
604
+
605
+ /**
606
+ * Set the segment data.
607
+ *
608
+ * @param {!BufferSource} segmentData
609
+ * @export
610
+ */
611
+ setSegmentData(segmentData) {
612
+ this.segmentData = segmentData;
613
+ }
614
+
615
+ /**
616
+ * Return the segment data.
617
+ *
618
+ * @return {?BufferSource}
619
+ * @export
620
+ */
621
+ getSegmentData() {
622
+ return this.segmentData;
623
+ }
624
+
625
+ /**
626
+ * Updates the init segment reference and propagates the update to all partial
627
+ * references.
628
+ * @param {shaka.media.InitSegmentReference} initSegmentReference
629
+ */
630
+ updateInitSegmentReference(initSegmentReference) {
631
+ this.initSegmentReference = initSegmentReference;
632
+ for (const partialReference of this.partialReferences) {
633
+ partialReference.updateInitSegmentReference(initSegmentReference);
634
+ }
635
+ }
601
636
  };
602
637
 
603
638
 
@@ -8,8 +8,10 @@ goog.provide('shaka.media.SegmentUtils');
8
8
 
9
9
  goog.require('goog.asserts');
10
10
  goog.require('shaka.log');
11
+ goog.require('shaka.media.Capabilities');
11
12
  goog.require('shaka.media.ClosedCaptionParser');
12
13
  goog.require('shaka.util.BufferUtils');
14
+ goog.require('shaka.util.ManifestParserUtils');
13
15
  goog.require('shaka.util.MimeUtils');
14
16
  goog.require('shaka.util.Mp4BoxParsers');
15
17
  goog.require('shaka.util.Mp4Parser');
@@ -38,6 +40,7 @@ shaka.media.SegmentUtils = class {
38
40
  channelCount: null,
39
41
  sampleRate: null,
40
42
  closedCaptions: new Map(),
43
+ videoRange: null,
41
44
  };
42
45
  }
43
46
 
@@ -121,6 +124,7 @@ shaka.media.SegmentUtils = class {
121
124
  channelCount: null,
122
125
  sampleRate: null,
123
126
  closedCaptions: closedCaptions,
127
+ videoRange: null,
124
128
  };
125
129
  }
126
130
 
@@ -133,7 +137,8 @@ shaka.media.SegmentUtils = class {
133
137
  const Mp4Parser = shaka.util.Mp4Parser;
134
138
  const SegmentUtils = shaka.media.SegmentUtils;
135
139
 
136
- const codecs = [];
140
+ const audioCodecs = [];
141
+ const videoCodecs = [];
137
142
 
138
143
  let hasAudio = false;
139
144
  let hasVideo = false;
@@ -143,38 +148,38 @@ shaka.media.SegmentUtils = class {
143
148
  switch (codecLC) {
144
149
  case 'avc1':
145
150
  case 'avc3':
146
- codecs.push(codecLC + '.42E01E');
151
+ videoCodecs.push(codecLC + '.42E01E');
147
152
  hasVideo = true;
148
153
  break;
149
154
  case 'hev1':
150
155
  case 'hvc1':
151
- codecs.push(codecLC + '.1.6.L93.90');
156
+ videoCodecs.push(codecLC + '.1.6.L93.90');
152
157
  hasVideo = true;
153
158
  break;
154
159
  case 'dvh1':
155
160
  case 'dvhe':
156
- codecs.push(codecLC + '.05.04');
161
+ videoCodecs.push(codecLC + '.05.04');
157
162
  hasVideo = true;
158
163
  break;
159
164
  case 'vp09':
160
- codecs.push(codecLC + '.00.10.08');
165
+ videoCodecs.push(codecLC + '.00.10.08');
161
166
  hasVideo = true;
162
167
  break;
163
168
  case 'av01':
164
- codecs.push(codecLC + '.0.01M.08');
169
+ videoCodecs.push(codecLC + '.0.01M.08');
165
170
  hasVideo = true;
166
171
  break;
167
172
  case 'mp4a':
168
173
  // We assume AAC, but this can be wrong since mp4a supports
169
174
  // others codecs
170
- codecs.push('mp4a.40.2');
175
+ audioCodecs.push('mp4a.40.2');
171
176
  hasAudio = true;
172
177
  break;
173
178
  case 'ac-3':
174
179
  case 'ec-3':
175
180
  case 'opus':
176
181
  case 'flac':
177
- codecs.push(codecLC);
182
+ audioCodecs.push(codecLC);
178
183
  hasAudio = true;
179
184
  break;
180
185
  }
@@ -192,6 +197,11 @@ shaka.media.SegmentUtils = class {
192
197
  let channelCount = null;
193
198
  /** @type {?number} */
194
199
  let sampleRate = null;
200
+ /** @type {?string} */
201
+ let realVideoRange = null;
202
+
203
+ /** @type {?string} */
204
+ let baseBox;
195
205
 
196
206
  new Mp4Parser()
197
207
  .box('moov', Mp4Parser.children)
@@ -232,7 +242,7 @@ shaka.media.SegmentUtils = class {
232
242
  })
233
243
  .box('esds', (box) => {
234
244
  const parsedESDSBox = shaka.util.Mp4BoxParsers.parseESDS(box.reader);
235
- codecs.push(parsedESDSBox.codec);
245
+ audioCodecs.push(parsedESDSBox.codec);
236
246
  hasAudio = true;
237
247
  })
238
248
  .box('ac-3', codecBoxParser)
@@ -244,23 +254,110 @@ shaka.media.SegmentUtils = class {
244
254
  // VIDEO
245
255
  // These are the various boxes that signal a codec.
246
256
  .box('avc1', (box) => {
247
- const parsedAVCBox =
248
- shaka.util.Mp4BoxParsers.parseAVC(box.reader, box.name);
249
- codecs.push(parsedAVCBox.codec);
250
- hasVideo = true;
257
+ baseBox = box.name;
258
+ Mp4Parser.visualSampleEntry(box);
251
259
  })
252
260
  .box('avc3', (box) => {
253
- const parsedAVCBox =
254
- shaka.util.Mp4BoxParsers.parseAVC(box.reader, box.name);
255
- codecs.push(parsedAVCBox.codec);
261
+ baseBox = box.name;
262
+ Mp4Parser.visualSampleEntry(box);
263
+ })
264
+ .box('hev1', (box) => {
265
+ baseBox = box.name;
266
+ Mp4Parser.visualSampleEntry(box);
267
+ })
268
+ .box('hvc1', (box) => {
269
+ baseBox = box.name;
270
+ Mp4Parser.visualSampleEntry(box);
271
+ })
272
+ .box('dva1', (box) => {
273
+ baseBox = box.name;
274
+ Mp4Parser.visualSampleEntry(box);
275
+ })
276
+ .box('dvav', (box) => {
277
+ baseBox = box.name;
278
+ Mp4Parser.visualSampleEntry(box);
279
+ })
280
+ .box('dvh1', (box) => {
281
+ baseBox = box.name;
282
+ Mp4Parser.visualSampleEntry(box);
283
+ })
284
+ .box('dvhe', (box) => {
285
+ baseBox = box.name;
286
+ Mp4Parser.visualSampleEntry(box);
287
+ })
288
+ .box('vp09', (box) => {
289
+ baseBox = box.name;
290
+ Mp4Parser.visualSampleEntry(box);
291
+ })
292
+ .box('av01', (box) => {
293
+ baseBox = box.name;
294
+ Mp4Parser.visualSampleEntry(box);
295
+ })
296
+ .box('avcC', (box) => {
297
+ let codecBase = baseBox || '';
298
+ switch (baseBox) {
299
+ case 'dvav':
300
+ codecBase = 'avc3';
301
+ break;
302
+ case 'dva1':
303
+ codecBase = 'avc1';
304
+ break;
305
+ }
306
+ const parsedAVCCBox = shaka.util.Mp4BoxParsers.parseAVCC(
307
+ codecBase, box.reader, box.name);
308
+ videoCodecs.push(parsedAVCCBox.codec);
309
+ hasVideo = true;
310
+ })
311
+ .box('hvcC', (box) => {
312
+ let codecBase = baseBox || '';
313
+ switch (baseBox) {
314
+ case 'dvh1':
315
+ codecBase = 'hvc1';
316
+ break;
317
+ case 'dvhe':
318
+ codecBase = 'hev1';
319
+ break;
320
+ }
321
+ const parsedHVCCBox = shaka.util.Mp4BoxParsers.parseHVCC(
322
+ codecBase, box.reader, box.name);
323
+ videoCodecs.push(parsedHVCCBox.codec);
324
+ hasVideo = true;
325
+ })
326
+ .box('dvcC', (box) => {
327
+ let codecBase = baseBox || '';
328
+ switch (baseBox) {
329
+ case 'hvc1':
330
+ codecBase = 'dvh1';
331
+ break;
332
+ case 'hev1':
333
+ codecBase = 'dvhe';
334
+ break;
335
+ case 'avc1':
336
+ codecBase = 'dva1';
337
+ break;
338
+ case 'avc3':
339
+ codecBase = 'dvav';
340
+ break;
341
+ }
342
+ const parsedDVCCBox = shaka.util.Mp4BoxParsers.parseDVCC(
343
+ codecBase, box.reader, box.name);
344
+ videoCodecs.push(parsedDVCCBox.codec);
345
+ hasVideo = true;
346
+ })
347
+ .fullBox('vpcC', (box) => {
348
+ const codecBase = baseBox || '';
349
+ const parsedVPCCBox = shaka.util.Mp4BoxParsers.parseVPCC(
350
+ codecBase, box.reader, box.name);
351
+ videoCodecs.push(parsedVPCCBox.codec);
352
+ hasVideo = true;
353
+ })
354
+ .box('av1C', (box) => {
355
+ const codecBase = baseBox || '';
356
+ const parsedAV1CBox = shaka.util.Mp4BoxParsers.parseAV1C(
357
+ codecBase, box.reader, box.name);
358
+ videoCodecs.push(parsedAV1CBox.codec);
256
359
  hasVideo = true;
257
360
  })
258
- .box('hev1', codecBoxParser)
259
- .box('hvc1', codecBoxParser)
260
- .box('dvh1', codecBoxParser)
261
- .box('dvhe', codecBoxParser)
262
- .box('vp09', codecBoxParser)
263
- .box('av01', codecBoxParser)
264
361
 
265
362
  // This signals an encrypted sample, which we can go inside of to
266
363
  // find the codec used.
@@ -273,8 +370,13 @@ shaka.media.SegmentUtils = class {
273
370
  addCodec(codec);
274
371
  })
275
372
 
373
+ .box('colr', (box) => {
374
+ const {videoRange} = shaka.util.Mp4BoxParsers.parseCOLR(box.reader);
375
+ realVideoRange = videoRange;
376
+ })
377
+
276
378
  .parse(initData || data, /* partialOkay= */ true);
277
- if (!codecs.length) {
379
+ if (!audioCodecs.length && !videoCodecs.length) {
278
380
  return null;
279
381
  }
280
382
  const onlyAudio = hasAudio && !hasVideo;
@@ -290,19 +392,45 @@ shaka.media.SegmentUtils = class {
290
392
  }
291
393
  captionParser.reset();
292
394
  }
395
+ const codecs = audioCodecs.concat(videoCodecs);
293
396
  return {
294
397
  type: onlyAudio ? 'audio' : 'video',
295
398
  mimeType: onlyAudio ? 'audio/mp4' : 'video/mp4',
296
- codecs: SegmentUtils.filterDuplicateCodecs_(codecs).join(', '),
399
+ codecs: SegmentUtils.codecsFiltering(codecs).join(', '),
297
400
  language: language,
298
401
  height: height,
299
402
  width: width,
300
403
  channelCount: channelCount,
301
404
  sampleRate: sampleRate,
302
405
  closedCaptions: closedCaptions,
406
+ videoRange: realVideoRange,
303
407
  };
304
408
  }
305
409
 
410
+ /**
411
+ * @param {!Array.<string>} codecs
412
+ * @return {!Array.<string>} codecs
413
+ */
414
+ static codecsFiltering(codecs) {
415
+ const ContentType = shaka.util.ManifestParserUtils.ContentType;
416
+ const ManifestParserUtils = shaka.util.ManifestParserUtils;
417
+ const SegmentUtils = shaka.media.SegmentUtils;
418
+ const allCodecs = SegmentUtils.filterDuplicateCodecs_(codecs);
419
+ const audioCodecs =
420
+ ManifestParserUtils.guessAllCodecsSafe(ContentType.AUDIO, allCodecs);
421
+ const videoCodecs =
422
+ ManifestParserUtils.guessAllCodecsSafe(ContentType.VIDEO, allCodecs);
423
+ const textCodecs =
424
+ ManifestParserUtils.guessAllCodecsSafe(ContentType.TEXT, allCodecs);
425
+ const validVideoCodecs = SegmentUtils.chooseBetterCodecs_(videoCodecs);
426
+ const finalCodecs =
427
+ audioCodecs.concat(validVideoCodecs).concat(textCodecs);
428
+ if (allCodecs.length && !finalCodecs.length) {
429
+ return allCodecs;
430
+ }
431
+ return finalCodecs;
432
+ }
433
+
306
434
  /**
307
435
  * @param {!Array.<string>} codecs
308
436
  * @return {!Array.<string>} codecs
@@ -323,6 +451,59 @@ shaka.media.SegmentUtils = class {
323
451
  }
324
452
  return ret;
325
453
  }
454
+
455
+ /**
456
+ * Prioritizes Dolby Vision if supported. This is necessary because with
457
+ * Dolby Vision we could have hvcC and dvcC boxes at the same time.
458
+ *
459
+ * @param {!Array.<string>} codecs
460
+ * @return {!Array.<string>} codecs
461
+ * @private
462
+ */
463
+ static chooseBetterCodecs_(codecs) {
464
+ if (codecs.length <= 1) {
465
+ return codecs;
466
+ }
467
+ const dolbyVision = codecs.find((codec) => {
468
+ return codec.startsWith('dvh1.') || codec.startsWith('dvhe.');
469
+ });
470
+ if (!dolbyVision) {
471
+ return codecs;
472
+ }
473
+ const type = `video/mp4; codecs="${dolbyVision}"'`;
474
+ if (shaka.media.Capabilities.isTypeSupported(type)) {
475
+ return [dolbyVision];
476
+ }
477
+ return codecs.filter((codec) => codec != dolbyVision);
478
+ }
479
+
480
+ /**
481
+ * @param {!BufferSource} data
482
+ * @return {?string}
483
+ */
484
+ static getDefaultKID(data) {
485
+ const Mp4Parser = shaka.util.Mp4Parser;
486
+
487
+ let defaultKID = null;
488
+ new Mp4Parser()
489
+ .box('moov', Mp4Parser.children)
490
+ .box('trak', Mp4Parser.children)
491
+ .box('mdia', Mp4Parser.children)
492
+ .box('minf', Mp4Parser.children)
493
+ .box('stbl', Mp4Parser.children)
494
+ .fullBox('stsd', Mp4Parser.sampleDescription)
495
+ .box('encv', Mp4Parser.visualSampleEntry)
496
+ .box('enca', Mp4Parser.audioSampleEntry)
497
+ .box('sinf', Mp4Parser.children)
498
+ .box('schi', Mp4Parser.children)
499
+ .fullBox('tenc', (box) => {
500
+ const parsedTENCBox = shaka.util.Mp4BoxParsers.parseTENC(box.reader);
501
+ defaultKID = parsedTENCBox.defaultKID;
502
+ })
503
+
504
+ .parse(data, /* partialOkay= */ true);
505
+ return defaultKID;
506
+ }
326
507
  };
327
508
 
328
509
 
@@ -336,7 +517,8 @@ shaka.media.SegmentUtils = class {
336
517
  * width: ?string,
337
518
  * channelCount: ?number,
338
519
  * sampleRate: ?number,
339
- * closedCaptions: Map.<string, string>
520
+ * closedCaptions: Map.<string, string>,
521
+ * videoRange: ?string
340
522
  * }}
341
523
  *
342
524
  * @property {string} type
@@ -348,5 +530,6 @@ shaka.media.SegmentUtils = class {
348
530
  * @property {?number} channelCount
349
531
  * @property {?number} sampleRate
350
532
  * @property {Map.<string, string>} closedCaptions
533
+ * @property {?string} videoRange
351
534
  */
352
535
  shaka.media.SegmentUtils.BasicInfo;