hls.js 1.6.0-beta.2.0.canary.10931 → 1.6.0-beta.2.0.canary.10933

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.10931"
137
+ "version": "1.6.0-beta.2.0.canary.10933"
138
138
  }
@@ -529,6 +529,14 @@ export default class LevelController extends BasePlaylistController {
529
529
  this._startLevel = newLevel;
530
530
  }
531
531
 
532
+ get pathways(): string[] {
533
+ if (this.steering) {
534
+ return this.steering.pathways();
535
+ }
536
+
537
+ return [];
538
+ }
539
+
532
540
  get pathwayPriority(): string[] | null {
533
541
  if (this.steering) {
534
542
  return this.steering.pathwayPriority;
package/src/hls.ts CHANGED
@@ -1186,6 +1186,13 @@ export default class Hls implements HlsEventEmitter {
1186
1186
  return this.streamController.forceStartLoad;
1187
1187
  }
1188
1188
 
1189
+ /**
1190
+ * ContentSteering pathways getter
1191
+ */
1192
+ get pathways(): string[] {
1193
+ return this.levelController.pathways;
1194
+ }
1195
+
1189
1196
  /**
1190
1197
  * ContentSteering pathwayPriority getter/setter
1191
1198
  */
@@ -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
+ }