shaka-player 3.3.4 → 4.0.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 (184) hide show
  1. package/.github/workflows/build-and-test.yaml +0 -1
  2. package/.github/workflows/demo-version-index.yaml +8 -0
  3. package/.github/workflows/release-please.yaml +23 -2
  4. package/.github/workflows/selenium-lab-tests.yaml +0 -1
  5. package/.github/workflows/sync-labels.yaml +33 -0
  6. package/.github/workflows/update-issues.yaml +29 -0
  7. package/.github/workflows/validate-pr-title.yaml +35 -0
  8. package/AUTHORS +1 -0
  9. package/CHANGELOG.md +198 -32
  10. package/CONTRIBUTORS +1 -0
  11. package/README.md +10 -7
  12. package/app-engine/demo-version-index/README.md +3 -3
  13. package/app-engine/demo-version-index/app.yaml +27 -1
  14. package/app-engine/demo-version-index/generate.py +164 -0
  15. package/app-engine/demo-version-index/main.py +4 -155
  16. package/app-engine/demo-version-index/requirements.txt +0 -1
  17. package/build/README.md +2 -2
  18. package/build/compiler.py +1 -1
  19. package/build/generateTsDefs.py +0 -2
  20. package/build/shaka-lab.yaml +0 -2
  21. package/build/test.py +7 -1
  22. package/build/types/core +0 -1
  23. package/build/types/polyfill +0 -3
  24. package/demo/common/asset.js +17 -1
  25. package/demo/common/assets.js +29 -0
  26. package/demo/common/message_ids.js +6 -3
  27. package/demo/config.js +10 -11
  28. package/demo/custom.js +39 -0
  29. package/demo/demo_utils.js +0 -1
  30. package/demo/locales/en.json +6 -3
  31. package/demo/locales/source.json +22 -10
  32. package/demo/main.js +9 -6
  33. package/demo/search.js +2 -1
  34. package/dist/controls.css +1 -1
  35. package/dist/demo.compiled.debug.js +71 -64
  36. package/dist/demo.compiled.debug.map +3 -3
  37. package/dist/demo.compiled.js +71 -64
  38. package/dist/demo.compiled.map +3 -3
  39. package/dist/demo.css +1 -1
  40. package/dist/demo.css.map +1 -1
  41. package/dist/deps.js +16 -20
  42. package/dist/locales.js +31 -29
  43. package/dist/receiver.compiled.debug.js +32 -28
  44. package/dist/receiver.compiled.debug.map +3 -3
  45. package/dist/receiver.compiled.js +32 -28
  46. package/dist/receiver.compiled.map +3 -3
  47. package/dist/shaka-player.compiled.d.ts +78 -83
  48. package/dist/shaka-player.compiled.debug.d.ts +78 -83
  49. package/dist/shaka-player.compiled.debug.externs.js +126 -126
  50. package/dist/shaka-player.compiled.debug.js +426 -483
  51. package/dist/shaka-player.compiled.debug.map +4 -4
  52. package/dist/shaka-player.compiled.externs.js +126 -126
  53. package/dist/shaka-player.compiled.js +838 -856
  54. package/dist/shaka-player.compiled.map +4 -4
  55. package/dist/shaka-player.ui.d.ts +80 -83
  56. package/dist/shaka-player.ui.debug.d.ts +80 -83
  57. package/dist/shaka-player.ui.debug.externs.js +134 -126
  58. package/dist/shaka-player.ui.debug.js +488 -543
  59. package/dist/shaka-player.ui.debug.map +4 -4
  60. package/dist/shaka-player.ui.externs.js +134 -126
  61. package/dist/shaka-player.ui.js +980 -994
  62. package/dist/shaka-player.ui.map +4 -4
  63. package/docs/tutorials/config.md +0 -2
  64. package/docs/tutorials/drm-config.md +5 -0
  65. package/docs/tutorials/fairplay.md +7 -22
  66. package/docs/tutorials/faq.md +0 -11
  67. package/docs/tutorials/index.json +2 -8
  68. package/docs/tutorials/plugins.md +1 -3
  69. package/docs/tutorials/upgrade.md +83 -11
  70. package/externs/polyfill.js +15 -0
  71. package/externs/shaka/manifest.js +5 -1
  72. package/externs/shaka/net.js +12 -0
  73. package/externs/shaka/offline.js +5 -1
  74. package/externs/shaka/player.js +39 -32
  75. package/externs/shaka/text.js +12 -12
  76. package/externs/sourcebuffer.js +15 -0
  77. package/lib/ads/client_side_ad.js +13 -2
  78. package/lib/ads/client_side_ad_manager.js +22 -4
  79. package/lib/cast/cast_utils.js +0 -1
  80. package/lib/dash/content_protection.js +85 -5
  81. package/lib/dash/dash_parser.js +1 -1
  82. package/lib/hls/hls_parser.js +378 -743
  83. package/lib/hls/manifest_text_parser.js +2 -3
  84. package/lib/media/drm_engine.js +102 -53
  85. package/lib/media/gap_jumping_controller.js +10 -45
  86. package/lib/media/media_source_engine.js +87 -15
  87. package/lib/media/playhead.js +2 -5
  88. package/lib/media/presentation_timeline.js +1 -2
  89. package/lib/media/segment_index.js +13 -46
  90. package/lib/media/segment_reference.js +47 -1
  91. package/lib/media/streaming_engine.js +29 -11
  92. package/lib/media/time_ranges_utils.js +4 -9
  93. package/lib/net/networking_engine.js +3 -0
  94. package/lib/offline/indexeddb/v1_storage_cell.js +1 -0
  95. package/lib/offline/indexeddb/v2_storage_cell.js +1 -0
  96. package/lib/offline/manifest_converter.js +1 -0
  97. package/lib/offline/storage.js +100 -132
  98. package/lib/player.js +17 -201
  99. package/lib/polyfill/media_capabilities.js +12 -6
  100. package/lib/polyfill/mediasource.js +0 -28
  101. package/lib/polyfill/patchedmediakeys_nop.js +2 -0
  102. package/lib/polyfill/patchedmediakeys_webkit.js +2 -0
  103. package/lib/text/cue.js +0 -6
  104. package/lib/text/lrc_text_parser.js +8 -0
  105. package/lib/text/mp4_ttml_parser.js +8 -0
  106. package/lib/text/mp4_vtt_parser.js +8 -0
  107. package/lib/text/sbv_text_parser.js +8 -0
  108. package/lib/text/simple_text_displayer.js +1 -7
  109. package/lib/text/srt_text_parser.js +8 -0
  110. package/lib/text/ssa_text_parser.js +8 -0
  111. package/lib/text/text_engine.js +19 -3
  112. package/lib/text/ttml_text_parser.js +8 -0
  113. package/lib/text/ui_text_displayer.js +1 -7
  114. package/lib/text/vtt_text_parser.js +24 -2
  115. package/lib/text/web_vtt_generator.js +1 -7
  116. package/lib/util/error.js +9 -13
  117. package/lib/util/fairplay_utils.js +109 -0
  118. package/lib/util/functional.js +0 -42
  119. package/lib/util/mime_utils.js +2 -0
  120. package/lib/util/platform.js +45 -0
  121. package/lib/util/player_configuration.js +12 -6
  122. package/lib/util/pssh.js +23 -4
  123. package/lib/util/stream_utils.js +92 -22
  124. package/lib/util/uint8array_utils.js +0 -16
  125. package/lib/util/xml_utils.js +1 -1
  126. package/package.json +1 -1
  127. package/roadmap.md +19 -19
  128. package/shaka-player.uncompiled.js +0 -3
  129. package/test/cast/cast_utils_unit.js +1 -0
  130. package/test/dash/dash_parser_content_protection_unit.js +44 -0
  131. package/test/dash/dash_parser_manifest_unit.js +0 -24
  132. package/test/dash/dash_parser_segment_template_unit.js +3 -4
  133. package/test/demo/demo_unit.js +2 -1
  134. package/test/hls/hls_live_unit.js +99 -220
  135. package/test/hls/hls_parser_unit.js +515 -432
  136. package/test/media/drm_engine_unit.js +86 -120
  137. package/test/media/media_source_engine_integration.js +26 -3
  138. package/test/media/media_source_engine_unit.js +7 -6
  139. package/test/media/playhead_unit.js +27 -191
  140. package/test/media/segment_index_unit.js +15 -25
  141. package/test/media/streaming_engine_integration.js +4 -39
  142. package/test/media/streaming_engine_unit.js +3 -2
  143. package/test/media/time_ranges_utils_unit.js +0 -5
  144. package/test/offline/manifest_convert_unit.js +34 -4
  145. package/test/offline/offline_manifest_parser_unit.js +1 -0
  146. package/test/offline/storage_integration.js +5 -4
  147. package/test/player_external.js +0 -6
  148. package/test/player_integration.js +16 -0
  149. package/test/player_unit.js +26 -0
  150. package/test/test/util/fake_media_source_engine.js +11 -4
  151. package/test/test/util/manifest_generator.js +3 -1
  152. package/test/test/util/manifest_parser_util.js +4 -1
  153. package/test/test/util/offline_utils.js +1 -0
  154. package/test/test/util/streaming_engine_util.js +1 -0
  155. package/test/test/util/test_scheme.js +24 -1
  156. package/test/test/util/util.js +4 -4
  157. package/test/text/cue_integration.js +2 -2
  158. package/test/text/lrc_text_parser_unit.js +6 -7
  159. package/test/text/mp4_ttml_parser_unit.js +6 -4
  160. package/test/text/mp4_vtt_parser_unit.js +6 -5
  161. package/test/text/sbv_text_parser_unit.js +5 -6
  162. package/test/text/srt_text_parser_unit.js +5 -6
  163. package/test/text/ssa_text_parser_unit.js +17 -29
  164. package/test/text/text_engine_unit.js +45 -5
  165. package/test/text/ttml_text_parser_unit.js +77 -77
  166. package/test/text/vtt_text_parser_unit.js +55 -57
  167. package/test/ui/ui_integration.js +0 -16
  168. package/test/ui/ui_unit.js +27 -0
  169. package/test/util/cmcd_manager_unit.js +3 -0
  170. package/test/util/stream_utils_unit.js +23 -7
  171. package/ui/controls.js +65 -40
  172. package/ui/fullscreen_button.js +26 -6
  173. package/ui/less/containers.less +3 -3
  174. package/ui/locales/en.json +1 -0
  175. package/ui/locales/source.json +5 -0
  176. package/ui/resolution_selection.js +31 -33
  177. package/ui/ui.js +0 -17
  178. package/docs/tutorials/upgrade-v2-5.md +0 -441
  179. package/docs/tutorials/upgrade-v3.md +0 -38
  180. package/lib/polyfill/mathround.js +0 -49
  181. package/lib/polyfill/patchedmediakeys_apple.js +0 -744
  182. package/lib/polyfill/patchedmediakeys_ms.js +0 -698
  183. package/lib/util/mutex.js +0 -52
  184. package/test/util/functional_unit.js +0 -82
@@ -9,7 +9,6 @@ goog.provide('shaka.media.SegmentIndex');
9
9
  goog.provide('shaka.media.SegmentIterator');
10
10
 
11
11
  goog.require('goog.asserts');
12
- goog.require('shaka.Deprecate');
13
12
  goog.require('shaka.media.SegmentReference');
14
13
  goog.require('shaka.util.IReleasable');
15
14
  goog.require('shaka.util.Timer');
@@ -52,23 +51,6 @@ shaka.media.SegmentIndex = class {
52
51
  }
53
52
 
54
53
 
55
- /**
56
- * SegmentIndex used to be an IDestroyable. Now it is an IReleasable.
57
- * This method is provided for backward compatibility.
58
- *
59
- * @deprecated
60
- * @return {!Promise}
61
- * @export
62
- */
63
- destroy() {
64
- shaka.Deprecate.deprecateFeature(4,
65
- 'shaka.media.SegmentIndex',
66
- 'Please use release() instead of destroy().');
67
- this.release();
68
- return Promise.resolve();
69
- }
70
-
71
-
72
54
  /**
73
55
  * @override
74
56
  * @export
@@ -101,6 +83,17 @@ shaka.media.SegmentIndex = class {
101
83
  }
102
84
 
103
85
 
86
+ /**
87
+ * Iterates over all top-level segment references in this segment index.
88
+ * @param {function(!shaka.media.SegmentReference)} fn
89
+ */
90
+ forEachTopLevelReference(fn) {
91
+ for (const reference of this.references) {
92
+ fn(reference);
93
+ }
94
+ }
95
+
96
+
104
97
  /**
105
98
  * Finds the position of the segment for the given time, in seconds, relative
106
99
  * to the start of the presentation. Returns the position of the segment
@@ -191,9 +184,6 @@ shaka.media.SegmentIndex = class {
191
184
  * @param {!Array.<!shaka.media.SegmentReference>} references The list of
192
185
  * SegmentReferences, which must be sorted first by their start times
193
186
  * (ascending) and second by their end times (ascending).
194
- * @deprecated Not used directly by our own parsers, so will become private in
195
- * v4. Use mergeAndEvict() instead.
196
- * @export
197
187
  */
198
188
  merge(references) {
199
189
  if (goog.DEBUG) {
@@ -348,7 +338,8 @@ shaka.media.SegmentIndex = class {
348
338
  lastReference.appendWindowEnd,
349
339
  lastReference.partialReferences,
350
340
  lastReference.tilesLayout,
351
- lastReference.tileDuration);
341
+ lastReference.tileDuration,
342
+ lastReference.syncTime);
352
343
  }
353
344
 
354
345
 
@@ -513,30 +504,6 @@ shaka.media.SegmentIterator = class {
513
504
  this.currentPartialPosition_ = partialSegmentIndex;
514
505
  }
515
506
 
516
- /**
517
- * Move the iterator to a given timestamp in the underlying SegmentIndex.
518
- *
519
- * @param {number} time
520
- * @return {shaka.media.SegmentReference}
521
- * @deprecated Use SegmentIndex.getIteratorForTime instead
522
- * @export
523
- */
524
- seek(time) {
525
- shaka.Deprecate.deprecateFeature(
526
- 4, 'shaka.media.SegmentIterator',
527
- 'Please use SegmentIndex.getIteratorForTime instead of seek().');
528
-
529
- const iter = this.segmentIndex_.getIteratorForTime(time);
530
- if (iter) {
531
- this.currentPosition_ = iter.currentPosition_;
532
- this.currentPartialPosition_ = iter.currentPartialPosition_;
533
- } else {
534
- this.currentPosition_ = Number.MAX_VALUE;
535
- this.currentPartialPosition_ = 0;
536
- }
537
- return this.next().value;
538
- }
539
-
540
507
  /**
541
508
  * @return {shaka.media.SegmentReference}
542
509
  * @export
@@ -159,11 +159,18 @@ shaka.media.SegmentReference = class {
159
159
  * The explicit duration of an individual tile within the tiles grid.
160
160
  * If not provided, the duration should be automatically calculated based on
161
161
  * the duration of the reference.
162
+ * @param {?number=} syncTime
163
+ * A time value, expressed in the same scale as the start and end time, which
164
+ * is used to synchronize between streams.
165
+ * @param {shaka.media.SegmentReference.Status=} status
166
+ * The segment status is used to indicate that a segment does not exist or is
167
+ * not available.
162
168
  */
163
169
  constructor(
164
170
  startTime, endTime, uris, startByte, endByte, initSegmentReference,
165
171
  timestampOffset, appendWindowStart, appendWindowEnd,
166
- partialReferences = [], tilesLayout = '', tileDuration = null) {
172
+ partialReferences = [], tilesLayout = '', tileDuration = null,
173
+ syncTime = null, status = shaka.media.SegmentReference.Status.AVAILABLE) {
167
174
  // A preload hinted Partial Segment has the same startTime and endTime.
168
175
  goog.asserts.assert(startTime <= endTime,
169
176
  'startTime must be less than or equal to endTime');
@@ -213,6 +220,12 @@ shaka.media.SegmentReference = class {
213
220
 
214
221
  /** @type {?number} */
215
222
  this.tileDuration = tileDuration;
223
+
224
+ /** @type {?number} */
225
+ this.syncTime = syncTime;
226
+
227
+ /** @type {shaka.media.SegmentReference.Status} */
228
+ this.status = status;
216
229
  }
217
230
 
218
231
  /**
@@ -308,6 +321,39 @@ shaka.media.SegmentReference = class {
308
321
  getTileDuration() {
309
322
  return this.tileDuration;
310
323
  }
324
+
325
+ /**
326
+ * Returns the segment's status.
327
+ *
328
+ * @return {shaka.media.SegmentReference.Status}
329
+ * @export
330
+ */
331
+ getStatus() {
332
+ return this.status;
333
+ }
334
+
335
+ /**
336
+ * Mark the reference as unavailable.
337
+ *
338
+ * @export
339
+ */
340
+ markAsUnavailable() {
341
+ this.status = shaka.media.SegmentReference.Status.UNAVAILABLE;
342
+ }
343
+ };
344
+
345
+
346
+ /**
347
+ * Rather than using booleans to communicate what the state of the reference,
348
+ * we have this enum.
349
+ *
350
+ * @enum {number}
351
+ * @export
352
+ */
353
+ shaka.media.SegmentReference.Status = {
354
+ AVAILABLE: 0,
355
+ UNAVAILABLE: 1,
356
+ MISSING: 2,
311
357
  };
312
358
 
313
359
 
@@ -234,7 +234,8 @@ shaka.media.StreamingEngine = class {
234
234
 
235
235
  const mimeType = shaka.util.MimeUtils.getFullType(
236
236
  stream.mimeType, stream.codecs);
237
- this.playerInterface_.mediaSourceEngine.reinitText(mimeType);
237
+ this.playerInterface_.mediaSourceEngine.reinitText(
238
+ mimeType, this.manifest_.sequenceMode);
238
239
 
239
240
  const textDisplayer =
240
241
  this.playerInterface_.mediaSourceEngine.getTextDisplayer();
@@ -428,7 +429,8 @@ shaka.media.StreamingEngine = class {
428
429
  // init segment again.
429
430
  const fullMimeType = shaka.util.MimeUtils.getFullType(
430
431
  stream.mimeType, stream.codecs);
431
- this.playerInterface_.mediaSourceEngine.reinitText(fullMimeType);
432
+ this.playerInterface_.mediaSourceEngine.reinitText(
433
+ fullMimeType, this.manifest_.sequenceMode);
432
434
  }
433
435
 
434
436
  // Releases the segmentIndex of the old stream.
@@ -604,11 +606,10 @@ shaka.media.StreamingEngine = class {
604
606
  */
605
607
  seeked() {
606
608
  const presentationTime = this.playerInterface_.getPresentationTime();
607
- const smallGapLimit = this.config_.smallGapLimit;
608
609
  const ContentType = shaka.util.ManifestParserUtils.ContentType;
609
610
  const newTimeIsBuffered = (type) => {
610
611
  return this.playerInterface_.mediaSourceEngine.isBuffered(
611
- type, presentationTime, smallGapLimit);
612
+ type, presentationTime);
612
613
  };
613
614
 
614
615
  let streamCleared = false;
@@ -645,6 +646,10 @@ shaka.media.StreamingEngine = class {
645
646
  if (type === ContentType.TEXT) {
646
647
  this.playerInterface_.mediaSourceEngine.resetCaptionParser();
647
648
  }
649
+
650
+ // Mark the media state as having seeked, so that the new buffers know
651
+ // that they will need to be at a new position (for sequence mode).
652
+ mediaState.seeked = true;
648
653
  }
649
654
  }
650
655
 
@@ -764,7 +769,9 @@ shaka.media.StreamingEngine = class {
764
769
  const mediaSourceEngine = this.playerInterface_.mediaSourceEngine;
765
770
  const forceTransmuxTS = this.config_.forceTransmuxTS;
766
771
 
767
- await mediaSourceEngine.init(streamsByType, forceTransmuxTS);
772
+
773
+ await mediaSourceEngine.init(streamsByType, forceTransmuxTS,
774
+ this.manifest_.sequenceMode);
768
775
  this.destroyer_.ensureNotDestroyed();
769
776
 
770
777
  this.setDuration_();
@@ -805,6 +812,9 @@ shaka.media.StreamingEngine = class {
805
812
  clearBufferSafeMargin: 0,
806
813
  waitingToFlushBuffer: false,
807
814
  clearingBuffer: false,
815
+ // The playhead might be seeking on startup, if a start time is set, so
816
+ // start "seeked" as true.
817
+ seeked: true,
808
818
  recovering: false,
809
819
  hasError: false,
810
820
  operation: null,
@@ -1272,6 +1282,7 @@ shaka.media.StreamingEngine = class {
1272
1282
  this.scheduleUpdate_(mediaState, 0);
1273
1283
  return;
1274
1284
  }
1285
+
1275
1286
  await this.append_(
1276
1287
  mediaState, presentationTime, stream, reference, result);
1277
1288
  }
@@ -1508,7 +1519,7 @@ shaka.media.StreamingEngine = class {
1508
1519
 
1509
1520
  await this.playerInterface_.mediaSourceEngine.setStreamProperties(
1510
1521
  mediaState.type, timestampOffset, appendWindowStart,
1511
- appendWindowEnd);
1522
+ appendWindowEnd, this.manifest_.sequenceMode);
1512
1523
  } catch (error) {
1513
1524
  mediaState.lastAppendWindowStart = null;
1514
1525
  mediaState.lastAppendWindowEnd = null;
@@ -1565,8 +1576,7 @@ shaka.media.StreamingEngine = class {
1565
1576
  * @return {!Promise}
1566
1577
  * @private
1567
1578
  */
1568
- async append_(mediaState, presentationTime, stream, reference,
1569
- segment) {
1579
+ async append_(mediaState, presentationTime, stream, reference, segment) {
1570
1580
  const logPrefix = shaka.media.StreamingEngine.logPrefix_(mediaState);
1571
1581
 
1572
1582
  const hasClosedCaptions = stream.closedCaptions &&
@@ -1584,14 +1594,19 @@ shaka.media.StreamingEngine = class {
1584
1594
 
1585
1595
  await this.evict_(mediaState, presentationTime);
1586
1596
  this.destroyer_.ensureNotDestroyed();
1587
- shaka.log.v1(logPrefix, 'appending media segment');
1597
+ shaka.log.v1(logPrefix, 'appending media segment at',
1598
+ (reference.syncTime == null ? 'unknown' : reference.syncTime));
1588
1599
 
1600
+ const seeked = mediaState.seeked;
1601
+ mediaState.seeked = false;
1589
1602
  await this.playerInterface_.mediaSourceEngine.appendBuffer(
1590
1603
  mediaState.type,
1591
1604
  segment,
1592
- reference.startTime,
1605
+ reference.syncTime == null ? reference.startTime : reference.syncTime,
1593
1606
  reference.endTime,
1594
- hasClosedCaptions);
1607
+ hasClosedCaptions,
1608
+ seeked,
1609
+ this.manifest_.sequenceMode);
1595
1610
  this.destroyer_.ensureNotDestroyed();
1596
1611
  shaka.log.v2(logPrefix, 'appended media segment');
1597
1612
  }
@@ -2017,6 +2032,7 @@ shaka.media.StreamingEngine.PlayerInterface;
2017
2032
  * waitingToFlushBuffer: boolean,
2018
2033
  * clearBufferSafeMargin: number,
2019
2034
  * clearingBuffer: boolean,
2035
+ * seeked: boolean,
2020
2036
  * recovering: boolean,
2021
2037
  * hasError: boolean,
2022
2038
  * operation: shaka.net.NetworkingEngine.PendingRequest
@@ -2061,6 +2077,8 @@ shaka.media.StreamingEngine.PlayerInterface;
2061
2077
  * The amount of buffer to retain when clearing the buffer after the update.
2062
2078
  * @property {boolean} clearingBuffer
2063
2079
  * True indicates that the buffer is being cleared.
2080
+ * @property {boolean} seeked
2081
+ * True indicates that the presentation just seeked.
2064
2082
  * @property {boolean} recovering
2065
2083
  * True indicates that the last segment was not appended because it could not
2066
2084
  * fit in the buffer.
@@ -54,17 +54,13 @@ shaka.media.TimeRangesUtils = class {
54
54
 
55
55
 
56
56
  /**
57
- * Determines if the given time is inside a buffered range. This includes
58
- * gaps, meaning that if the playhead is in a gap, it is considered buffered.
59
- * If there is a small gap between the playhead and buffer start, consider it
60
- * as buffered.
57
+ * Determines if the given time is inside a buffered range.
61
58
  *
62
59
  * @param {TimeRanges} b
63
60
  * @param {number} time Playhead time
64
- * @param {number=} smallGapLimit Set in configuration
65
61
  * @return {boolean}
66
62
  */
67
- static isBuffered(b, time, smallGapLimit = 0) {
63
+ static isBuffered(b, time) {
68
64
  if (!b || !b.length) {
69
65
  return false;
70
66
  }
@@ -76,9 +72,8 @@ shaka.media.TimeRangesUtils = class {
76
72
  if (time > b.end(b.length - 1)) {
77
73
  return false;
78
74
  }
79
- // Push the time forward by the gap limit so that it is more likely to be in
80
- // the range.
81
- return (time + smallGapLimit >= b.start(0));
75
+
76
+ return time >= b.start(0);
82
77
  }
83
78
 
84
79
 
@@ -220,6 +220,9 @@ shaka.net.NetworkingEngine = class extends shaka.util.FakeEventTarget {
220
220
  retryParameters: retryParams,
221
221
  licenseRequestType: null,
222
222
  sessionId: null,
223
+ drmInfo: null,
224
+ initData: null,
225
+ initDataType: null,
223
226
  streamDataCallback: streamDataCallback,
224
227
  };
225
228
  }
@@ -99,6 +99,7 @@ shaka.offline.indexeddb.V1StorageCell = class
99
99
  sessionIds: old.sessionIds,
100
100
  drmInfo: old.drmInfo,
101
101
  appMetadata: old.appMetadata,
102
+ sequenceMode: false,
102
103
  };
103
104
  }
104
105
 
@@ -60,6 +60,7 @@ shaka.offline.indexeddb.V2StorageCell = class
60
60
  sessionIds: old.sessionIds,
61
61
  size: old.size,
62
62
  streams,
63
+ sequenceMode: false,
63
64
  };
64
65
  }
65
66
 
@@ -87,6 +87,7 @@ shaka.offline.ManifestConverter = class {
87
87
  variants: Array.from(variants.values()),
88
88
  textStreams: textStreams,
89
89
  imageStreams: imageStreams,
90
+ sequenceMode: manifestDB.sequenceMode || false,
90
91
  };
91
92
  }
92
93