shaka-player 4.9.13 → 4.9.14

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.
@@ -1593,7 +1593,8 @@ shaka.extern.AdsConfiguration;
1593
1593
  * ignoreDevicePixelRatio: boolean,
1594
1594
  * clearBufferSwitch: boolean,
1595
1595
  * safeMarginSwitch: number,
1596
- * cacheLoadThreshold: number
1596
+ * cacheLoadThreshold: number,
1597
+ * minTimeToSwitch: number
1597
1598
  * }}
1598
1599
  *
1599
1600
  * @property {boolean} enabled
@@ -1655,6 +1656,11 @@ shaka.extern.AdsConfiguration;
1655
1656
  * Indicates the value in milliseconds from which a request is not
1656
1657
  * considered cached.
1657
1658
  * Defaults to <code>20</code>.
1659
+ * @property {number} minTimeToSwitch
1660
+ * Indicates the minimum time to change quality once the real bandwidth is
1661
+ * available, in seconds. This time is only used on the first load.
1662
+ * Defaults to <code>0</code> seconds except in Apple browsers whose default
1663
+ * value is <code>0.5</code> seconds.
1658
1664
  * @exportDoc
1659
1665
  */
1660
1666
  shaka.extern.AbrConfiguration;
@@ -433,14 +433,17 @@ shaka.abr.SimpleAbrManager = class {
433
433
  return;
434
434
  }
435
435
  this.startupComplete_ = true;
436
- } else {
437
- // Check if we've left the switch interval.
438
- const now = Date.now();
439
- const delta = now - this.lastTimeChosenMs_;
440
- if (delta < this.config_.switchInterval * 1000) {
441
- shaka.log.v2('Still within switch interval...');
442
- return;
443
- }
436
+
437
+ this.lastTimeChosenMs_ -=
438
+ (this.config_.switchInterval - this.config_.minTimeToSwitch) * 1000;
439
+ }
440
+
441
+ // Check if we've left the switch interval.
442
+ const now = Date.now();
443
+ const delta = now - this.lastTimeChosenMs_;
444
+ if (delta < this.config_.switchInterval * 1000) {
445
+ shaka.log.v2('Still within switch interval...');
446
+ return;
444
447
  }
445
448
 
446
449
  const chosenVariant = this.chooseVariant();
@@ -572,9 +572,10 @@ shaka.hls.HlsParser = class {
572
572
  if (goog.DEBUG) {
573
573
  const firstSequenceStartTime =
574
574
  mediaSequenceToStartTime.values().next().value;
575
- shaka.log.warning(
576
- firstSequenceStartTime == segment0.startTime,
577
- 'Sequence number map is not ordered as expected!');
575
+ if (firstSequenceStartTime != segment0.startTime) {
576
+ shaka.log.warning(
577
+ 'Sequence number map is not ordered as expected!');
578
+ }
578
579
  }
579
580
  for (const [sequence, start] of mediaSequenceToStartTime) {
580
581
  if (start == segment0.startTime) {
package/lib/player.js CHANGED
@@ -6612,7 +6612,7 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
6612
6612
  // Check if we should show text (based on difference between audio and text
6613
6613
  // languages).
6614
6614
  if (initialTextStream) {
6615
- if (initialVariant.audio && this.shouldInitiallyShowText_(
6615
+ if (this.shouldInitiallyShowText_(
6616
6616
  initialVariant.audio, initialTextStream)) {
6617
6617
  this.isTextVisible_ = true;
6618
6618
  }
@@ -6632,7 +6632,7 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
6632
6632
  /**
6633
6633
  * Check if we should show text on screen automatically.
6634
6634
  *
6635
- * @param {shaka.extern.Stream} audioStream
6635
+ * @param {?shaka.extern.Stream} audioStream
6636
6636
  * @param {shaka.extern.Stream} textStream
6637
6637
  * @return {boolean}
6638
6638
  * @private
@@ -6663,6 +6663,9 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
6663
6663
  }
6664
6664
 
6665
6665
  if (this.config_.autoShowText == AutoShowText.IF_SUBTITLES_MAY_BE_NEEDED) {
6666
+ if (!audioStream) {
6667
+ return false;
6668
+ }
6666
6669
  /* The text should automatically be shown if the text is
6667
6670
  * language-compatible with the user's text language preference, but not
6668
6671
  * compatible with the audio. These are cases where we deduce that
@@ -7473,7 +7476,7 @@ shaka.Player.TYPICAL_BUFFERING_THRESHOLD_ = 0.5;
7473
7476
  * @export
7474
7477
  */
7475
7478
  // eslint-disable-next-line no-useless-concat
7476
- shaka.Player.version = 'v4.9.13' + '-uncompiled'; // x-release-please-version
7479
+ shaka.Player.version = 'v4.9.14' + '-uncompiled'; // x-release-please-version
7477
7480
 
7478
7481
  // Initialize the deprecation system using the version string we just set
7479
7482
  // on the player.
@@ -339,6 +339,7 @@ shaka.util.PlayerConfiguration = class {
339
339
  clearBufferSwitch: false,
340
340
  safeMarginSwitch: 0,
341
341
  cacheLoadThreshold: 20,
342
+ minTimeToSwitch: shaka.util.Platform.isApple() ? 0.5 : 0,
342
343
  };
343
344
 
344
345
  const cmcd = {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "shaka-player",
3
3
  "description": "DASH/EME video player library",
4
- "version": "4.9.13",
4
+ "version": "4.9.14",
5
5
  "homepage": "https://github.com/shaka-project/shaka-player",
6
6
  "author": "Google",
7
7
  "maintainers": [
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "AD_DURATION": "Durée de l'annonce",
3
3
  "AD_PROGRESS": "Annonce [AD_ON] sur [NUM_ADS]",
4
- "AD_STATISTICS": "Statistiques de la annonce",
4
+ "AD_STATISTICS": "Statistiques de l'annonce",
5
5
  "AD_TIME": "Annonce : [AD_TIME]",
6
6
  "AIRPLAY": "AirPlay",
7
7
  "AUTO_QUALITY": "Automatique",