hls.js 1.6.0-beta.2.0.canary.10930 → 1.6.0-beta.2.0.canary.10932

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.
package/package.json CHANGED
@@ -134,5 +134,5 @@
134
134
  "url-toolkit": "2.2.5",
135
135
  "wrangler": "3.107.2"
136
136
  },
137
- "version": "1.6.0-beta.2.0.canary.10930"
137
+ "version": "1.6.0-beta.2.0.canary.10932"
138
138
  }
@@ -1254,8 +1254,6 @@ transfer tracks: ${JSON.stringify(transferredTracks, (key, value) => (key === 'i
1254
1254
  }
1255
1255
  const playlistEnd = details.edge;
1256
1256
  if (details.live && this.hls.config.liveDurationInfinity) {
1257
- // Override duration to Infinity
1258
- mediaSource.duration = Infinity;
1259
1257
  const len = details.fragments.length;
1260
1258
  if (len && details.live && !!mediaSource.setLiveSeekableRange) {
1261
1259
  const start = Math.max(0, details.fragmentStart);
@@ -1267,6 +1265,9 @@ transfer tracks: ${JSON.stringify(transferredTracks, (key, value) => (key === 'i
1267
1265
  }
1268
1266
  const overrideDuration = this.overrides?.duration;
1269
1267
  if (overrideDuration) {
1268
+ if (!Number.isFinite(overrideDuration)) {
1269
+ return null;
1270
+ }
1270
1271
  return { duration: overrideDuration };
1271
1272
  }
1272
1273
  const mediaDuration = this.media.duration;
@@ -50,6 +50,7 @@ export class BaseSegment {
50
50
  base = { url: base };
51
51
  }
52
52
  this.base = base;
53
+ makeEnumerable(this, 'stats');
53
54
  }
54
55
 
55
56
  // setByteRange converts a EXT-X-BYTERANGE attribute into a two element array
@@ -454,3 +455,28 @@ export class Part extends BaseSegment {
454
455
  );
455
456
  }
456
457
  }
458
+
459
+ function getOwnPropertyDescriptorFromPrototypeChain(
460
+ object: Object | undefined,
461
+ property: string,
462
+ ) {
463
+ const prototype = Object.getPrototypeOf(object);
464
+ if (prototype) {
465
+ const propertyDescriptor = Object.getOwnPropertyDescriptor(
466
+ prototype,
467
+ property,
468
+ );
469
+ if (propertyDescriptor) {
470
+ return propertyDescriptor;
471
+ }
472
+ return getOwnPropertyDescriptorFromPrototypeChain(prototype, property);
473
+ }
474
+ }
475
+
476
+ function makeEnumerable(object: Object, property: string) {
477
+ const d = getOwnPropertyDescriptorFromPrototypeChain(object, property);
478
+ if (d) {
479
+ d.enumerable = true;
480
+ Object.defineProperty(object, property, d);
481
+ }
482
+ }