rx-player 3.27.1-dev.2022051100 → 3.27.1-dev.2022060300

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 (22) hide show
  1. package/CHANGELOG.md +1 -2
  2. package/README.md +2 -1
  3. package/VERSION +1 -1
  4. package/dist/_esm5.processed/core/api/public_api.js +2 -2
  5. package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/timeline/construct_timeline_from_elements.d.ts +1 -3
  6. package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/timeline/construct_timeline_from_elements.js +2 -4
  7. package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/timeline/construct_timeline_from_previous_timeline.d.ts +1 -1
  8. package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/timeline/construct_timeline_from_previous_timeline.js +6 -6
  9. package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/timeline/convert_element_to_index_segment.d.ts +1 -3
  10. package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/timeline/convert_element_to_index_segment.js +2 -4
  11. package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/timeline/timeline_representation_index.d.ts +0 -2
  12. package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/timeline/timeline_representation_index.js +2 -6
  13. package/dist/rx-player.js +14 -23
  14. package/dist/rx-player.min.js +1 -1
  15. package/package.json +1 -1
  16. package/sonar-project.properties +1 -1
  17. package/src/core/api/public_api.ts +2 -2
  18. package/src/core/decrypt/__tests__/__global__/get_license.test.ts +1 -1
  19. package/src/parsers/manifest/dash/common/indexes/timeline/construct_timeline_from_elements.ts +2 -8
  20. package/src/parsers/manifest/dash/common/indexes/timeline/construct_timeline_from_previous_timeline.ts +6 -10
  21. package/src/parsers/manifest/dash/common/indexes/timeline/convert_element_to_index_segment.ts +2 -5
  22. package/src/parsers/manifest/dash/common/indexes/timeline/timeline_representation_index.ts +2 -11
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "rx-player",
3
3
  "author": "Canal+",
4
- "version": "3.27.1-dev.2022051100",
4
+ "version": "3.27.1-dev.2022060300",
5
5
  "description": "Canal+ HTML5 Video Player",
6
6
  "main": "./dist/rx-player.js",
7
7
  "keywords": [
@@ -1,7 +1,7 @@
1
1
  sonar.projectKey=rx-player
2
2
  sonar.organization=rx-player
3
3
  sonar.projectName=rx-player
4
- sonar.projectVersion=3.27.1-dev.2022051100
4
+ sonar.projectVersion=3.27.1-dev.2022060300
5
5
  sonar.sources=./src,./demo,./tests
6
6
  sonar.exclusions=demo/full/bundle.js,demo/standalone/lib.js,demo/bundle.js
7
7
  sonar.host.url=https://sonarcloud.io
@@ -428,7 +428,7 @@ class Player extends EventEmitter<IPublicAPIEvent> {
428
428
  // See: https://bugzilla.mozilla.org/show_bug.cgi?id=1194624
429
429
  videoElement.preload = "auto";
430
430
 
431
- this.version = /* PLAYER_VERSION */"3.27.1-dev.2022051100";
431
+ this.version = /* PLAYER_VERSION */"3.27.1-dev.2022060300";
432
432
  this.log = log;
433
433
  this.state = "STOPPED";
434
434
  this.videoElement = videoElement;
@@ -2940,7 +2940,7 @@ class Player extends EventEmitter<IPublicAPIEvent> {
2940
2940
  return activeRepresentations[currentPeriod.id];
2941
2941
  }
2942
2942
  }
2943
- Player.version = /* PLAYER_VERSION */"3.27.1-dev.2022051100";
2943
+ Player.version = /* PLAYER_VERSION */"3.27.1-dev.2022060300";
2944
2944
 
2945
2945
  /** Payload emitted with a `positionUpdate` event. */
2946
2946
  export interface IPositionUpdateItem {
@@ -221,7 +221,7 @@ describe("core - decrypt - global tests - getLicense", () => {
221
221
  getTimeout: () => undefined,
222
222
  nbRetries: 6,
223
223
  ignoreLicenseRequests: false });
224
- }, 15000);
224
+ }, 25000);
225
225
 
226
226
  it("should not fail after 5 failures when getLicenseConfig.retry is set to `Infinity`", async () => {
227
227
  await checkGetLicense({ isGetLicensePromiseBased: true,
@@ -27,13 +27,10 @@ import parseSElement, {
27
27
  * first needed.
28
28
  * @param {HTMLCollection} elements - All S nodes constituting the corresponding
29
29
  * SegmentTimeline node.
30
- * @param {number} scaledPeriodStart - Absolute start of the concerned Period,
31
- * in the same scale than the segments found in `elements`.
32
30
  * @returns {Array.<Object>}
33
31
  */
34
32
  export default function constructTimelineFromElements(
35
- elements : HTMLCollection,
36
- scaledPeriodStart : number
33
+ elements : HTMLCollection
37
34
  ) : IIndexSegment[] {
38
35
  const initialTimeline : IParsedS[] = [];
39
36
  for (let i = 0; i < elements.length; i++) {
@@ -48,10 +45,7 @@ export default function constructTimelineFromElements(
48
45
  const nextItem = initialTimeline[i + 1] === undefined ?
49
46
  null :
50
47
  initialTimeline[i + 1];
51
- const timelineElement = convertElementsToIndexSegment(item,
52
- previousItem,
53
- nextItem,
54
- scaledPeriodStart);
48
+ const timelineElement = convertElementsToIndexSegment(item, previousItem, nextItem);
55
49
  if (timelineElement !== null) {
56
50
  timeline.push(timelineElement);
57
51
  }
@@ -25,15 +25,14 @@ import parseSElement, {
25
25
 
26
26
  export default function constructTimelineFromPreviousTimeline(
27
27
  newElements : HTMLCollection,
28
- prevTimeline : IIndexSegment[],
29
- scaledPeriodStart : number
28
+ prevTimeline : IIndexSegment[]
30
29
  ) : IIndexSegment[] {
31
30
 
32
31
  // Find first index in both timeline where a common segment is found.
33
32
  const commonStartInfo = findFirstCommonStartTime(prevTimeline, newElements);
34
33
  if (commonStartInfo === null) {
35
34
  log.warn("DASH: Cannot perform \"based\" update. Common segment not found.");
36
- return constructTimelineFromElements(newElements, scaledPeriodStart);
35
+ return constructTimelineFromElements(newElements);
37
36
  }
38
37
  const { prevSegmentsIdx,
39
38
  newElementsIdx,
@@ -45,7 +44,7 @@ export default function constructTimelineFromPreviousTimeline(
45
44
  const lastCommonEltNewEltsIdx = numberCommonEltGuess + newElementsIdx - 1;
46
45
  if (lastCommonEltNewEltsIdx >= newElements.length) {
47
46
  log.info("DASH: Cannot perform \"based\" update. New timeline too short");
48
- return constructTimelineFromElements(newElements, scaledPeriodStart);
47
+ return constructTimelineFromElements(newElements);
49
48
  }
50
49
 
51
50
  // Remove elements which are not available anymore
@@ -60,7 +59,7 @@ export default function constructTimelineFromPreviousTimeline(
60
59
  if (repeatNumberInNewElements > 0 && newElementsIdx !== 0) {
61
60
  log.info("DASH: Cannot perform \"based\" update. " +
62
61
  "The new timeline has a different form.");
63
- return constructTimelineFromElements(newElements, scaledPeriodStart);
62
+ return constructTimelineFromElements(newElements);
64
63
  }
65
64
 
66
65
  const prevLastElement = newTimeline[newTimeline.length - 1];
@@ -72,7 +71,7 @@ export default function constructTimelineFromPreviousTimeline(
72
71
  {
73
72
  log.info("DASH: Cannot perform \"based\" update. " +
74
73
  "The new timeline has a different form at the beginning.");
75
- return constructTimelineFromElements(newElements, scaledPeriodStart);
74
+ return constructTimelineFromElements(newElements);
76
75
  }
77
76
 
78
77
  if (newCommonElt.repeatCount !== undefined &&
@@ -94,10 +93,7 @@ export default function constructTimelineFromPreviousTimeline(
94
93
  const nextItem = items[i + 1] === undefined ?
95
94
  null :
96
95
  items[i + 1];
97
- const timelineElement = convertElementToIndexSegment(item,
98
- previousItem,
99
- nextItem,
100
- scaledPeriodStart);
96
+ const timelineElement = convertElementToIndexSegment(item, previousItem, nextItem);
101
97
  if (timelineElement !== null) {
102
98
  newEltsToPush.push(timelineElement);
103
99
  }
@@ -28,22 +28,19 @@ import { IIndexSegment } from "../../../../utils/index_helpers";
28
28
  * segment.
29
29
  * @param {Object|null} nextItem - the `S` node coming next. If `null`, we're
30
30
  * talking about the last segment.
31
- * @param {number} timelineStart - Absolute start for the timeline. In the same
32
- * timescale than the given `S` nodes.
33
31
  * @returns {Object|null}
34
32
  */
35
33
  export default function convertElementsToIndexSegment(
36
34
  item : { start? : number; repeatCount? : number; duration? : number },
37
35
  previousItem : IIndexSegment|null,
38
- nextItem : { start? : number; repeatCount? : number; duration? : number }|null,
39
- timelineStart : number
36
+ nextItem : { start? : number; repeatCount? : number; duration? : number }|null
40
37
  ) : IIndexSegment|null {
41
38
  let start = item.start;
42
39
  let duration = item.duration;
43
40
  const repeatCount = item.repeatCount;
44
41
  if (start === undefined) {
45
42
  if (previousItem === null) {
46
- start = timelineStart;
43
+ start = 0;
47
44
  } else if (!isNullOrUndefined(previousItem.duration)) {
48
45
  start = previousItem.start +
49
46
  (previousItem.duration * (previousItem.repeatCount + 1));
@@ -201,9 +201,6 @@ export default class TimelineRepresentationIndex implements IRepresentationIndex
201
201
  /** Absolute start of the period, timescaled and converted to index time. */
202
202
  private _scaledPeriodStart : number;
203
203
 
204
- /** Actual un-scaled start of the Period as indicated in the MPD. */
205
- private _periodStart : number;
206
-
207
204
  /** Absolute end of the period, timescaled and converted to index time. */
208
205
  private _scaledPeriodEnd : number | undefined;
209
206
 
@@ -308,7 +305,6 @@ export default class TimelineRepresentationIndex implements IRepresentationIndex
308
305
  startNumber: index.startNumber,
309
306
  timeline: index.timeline ?? null,
310
307
  timescale };
311
- this._periodStart = periodStart;
312
308
  this._scaledPeriodStart = toIndexTime(periodStart, this._index);
313
309
  this._scaledPeriodEnd = periodEnd === undefined ? undefined :
314
310
  toIndexTime(periodEnd, this._index);
@@ -465,7 +461,6 @@ export default class TimelineRepresentationIndex implements IRepresentationIndex
465
461
  this._index = newIndex._index;
466
462
  this._isDynamic = newIndex._isDynamic;
467
463
  this._scaledPeriodStart = newIndex._scaledPeriodStart;
468
- this._periodStart = newIndex._periodStart;
469
464
  this._scaledPeriodEnd = newIndex._scaledPeriodEnd;
470
465
  this._lastUpdate = newIndex._lastUpdate;
471
466
  this._manifestBoundsCalculator = newIndex._manifestBoundsCalculator;
@@ -491,7 +486,6 @@ export default class TimelineRepresentationIndex implements IRepresentationIndex
491
486
  }
492
487
  this._isDynamic = newIndex._isDynamic;
493
488
  this._scaledPeriodStart = newIndex._scaledPeriodStart;
494
- this._periodStart = newIndex._periodStart;
495
489
  this._scaledPeriodEnd = newIndex._scaledPeriodEnd;
496
490
  this._lastUpdate = newIndex._lastUpdate;
497
491
  this._isLastPeriod = newIndex._isLastPeriod;
@@ -614,13 +608,12 @@ export default class TimelineRepresentationIndex implements IRepresentationIndex
614
608
  const newElements = this._parseTimeline();
615
609
  this._parseTimeline = null; // Free memory
616
610
 
617
- const actualPeriodStart = this._periodStart * this._index.timescale;
618
611
  const { MIN_DASH_S_ELEMENTS_TO_PARSE_UNSAFELY } = config.getCurrent();
619
612
  if (this._unsafelyBaseOnPreviousIndex === null ||
620
613
  newElements.length < MIN_DASH_S_ELEMENTS_TO_PARSE_UNSAFELY)
621
614
  {
622
615
  // Just completely parse the current timeline
623
- return constructTimelineFromElements(newElements, actualPeriodStart);
616
+ return constructTimelineFromElements(newElements);
624
617
  }
625
618
 
626
619
  // Construct previously parsed timeline if not already done
@@ -633,9 +626,7 @@ export default class TimelineRepresentationIndex implements IRepresentationIndex
633
626
  }
634
627
  this._unsafelyBaseOnPreviousIndex = null; // Free memory
635
628
 
636
- return constructTimelineFromPreviousTimeline(newElements,
637
- prevTimeline,
638
- actualPeriodStart);
629
+ return constructTimelineFromPreviousTimeline(newElements, prevTimeline);
639
630
 
640
631
  }
641
632
  }