shaka-player 4.9.2 → 4.9.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.
@@ -268,7 +268,8 @@ shaka.abr.SimpleAbrManager = class {
268
268
 
269
269
  if (currentBandwidth >= minBandwidth &&
270
270
  currentBandwidth <= maxBandwidth &&
271
- chosen.bandwidth != item.bandwidth) {
271
+ (chosen.bandwidth != item.bandwidth ||
272
+ this.isSameBandwidthAndHigherResolution_(chosen, item))) {
272
273
  chosen = item;
273
274
  }
274
275
  }
@@ -537,6 +538,23 @@ shaka.abr.SimpleAbrManager = class {
537
538
  return v1.width - v2.width;
538
539
  });
539
540
  }
541
+
542
+ /**
543
+ * @param {shaka.extern.Variant} chosenVariant
544
+ * @param {shaka.extern.Variant} newVariant
545
+ * @return {boolean}
546
+ * @private
547
+ */
548
+ isSameBandwidthAndHigherResolution_(chosenVariant, newVariant) {
549
+ if (chosenVariant.bandwidth != newVariant.bandwidth) {
550
+ return false;
551
+ }
552
+ if (!chosenVariant.video || !newVariant.video) {
553
+ return false;
554
+ }
555
+ return chosenVariant.video.width < newVariant.video.width ||
556
+ chosenVariant.video.height < newVariant.video.height;
557
+ }
540
558
  };
541
559
 
542
560
 
@@ -489,7 +489,7 @@ shaka.hls.HlsParser = class {
489
489
  mediaSequenceNumber);
490
490
  stream.segmentIndex.evict(playlistStartTime);
491
491
  }
492
- const oldSegment = segments[0];
492
+ const oldSegment = stream.segmentIndex.earliestReference();
493
493
  goog.asserts.assert(oldSegment, 'Should have segments!');
494
494
 
495
495
  streamInfo.minTimestamp = oldSegment.startTime;
@@ -4282,7 +4282,7 @@ shaka.hls.HlsParser = class {
4282
4282
  }
4283
4283
 
4284
4284
  const uri = drmTag.getRequiredAttrValue('URI');
4285
- const parsedData = shaka.net.DataUriPlugin.parseRaw(uri);
4285
+ const parsedData = shaka.net.DataUriPlugin.parseRaw(uri.split('?')[0]);
4286
4286
 
4287
4287
  // The data encoded in the URI is a PSSH box to be used as init data.
4288
4288
  const pssh = shaka.util.BufferUtils.toUint8(parsedData.data);
@@ -4325,7 +4325,7 @@ shaka.hls.HlsParser = class {
4325
4325
  }
4326
4326
 
4327
4327
  const uri = drmTag.getRequiredAttrValue('URI');
4328
- const parsedData = shaka.net.DataUriPlugin.parseRaw(uri);
4328
+ const parsedData = shaka.net.DataUriPlugin.parseRaw(uri.split('?')[0]);
4329
4329
 
4330
4330
  // The data encoded in the URI is a PlayReady Pro Object, so we need
4331
4331
  // convert it to pssh.
package/lib/player.js CHANGED
@@ -7454,7 +7454,7 @@ shaka.Player.TYPICAL_BUFFERING_THRESHOLD_ = 0.5;
7454
7454
  * @export
7455
7455
  */
7456
7456
  // eslint-disable-next-line no-useless-concat
7457
- shaka.Player.version = 'v4.9.2' + '-uncompiled'; // x-release-please-version
7457
+ shaka.Player.version = 'v4.9.3' + '-uncompiled'; // x-release-please-version
7458
7458
 
7459
7459
  // Initialize the deprecation system using the version string we just set
7460
7460
  // on the player.
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.2",
4
+ "version": "4.9.3",
5
5
  "homepage": "https://github.com/shaka-project/shaka-player",
6
6
  "author": "Google",
7
7
  "maintainers": [