rx-player 4.3.0-dev.2025011000 → 4.3.0-dev.2025012900

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.
@@ -426,7 +426,7 @@ function loadOrReloadPreparedContent(val, contentPreparer, playbackObservationRe
426
426
  });
427
427
  },
428
428
  }, currentLoadCanceller.signal);
429
- StreamOrchestrator({ initialPeriod: manifest.periods[0], manifest }, playbackObserver, representationEstimator, segmentSinksStore, segmentQueueCreator, {
429
+ StreamOrchestrator({ initialPeriod, manifest }, playbackObserver, representationEstimator, segmentSinksStore, segmentQueueCreator, {
430
430
  wantedBufferAhead,
431
431
  maxVideoBufferSize,
432
432
  maxBufferAhead,
@@ -143,7 +143,7 @@ class Player extends EventEmitter {
143
143
  // Workaround to support Firefox autoplay on FF 42.
144
144
  // See: https://bugzilla.mozilla.org/show_bug.cgi?id=1194624
145
145
  videoElement.preload = "auto";
146
- this.version = /* PLAYER_VERSION */ "4.3.0-dev.2025011000";
146
+ this.version = /* PLAYER_VERSION */ "4.3.0-dev.2025012900";
147
147
  this.log = log;
148
148
  this.state = "STOPPED";
149
149
  this.videoElement = videoElement;
@@ -2471,5 +2471,5 @@ class Player extends EventEmitter {
2471
2471
  * Use of a WeakSet ensure the object is garbage collected if it's not used anymore.
2472
2472
  */
2473
2473
  Player._priv_currentlyUsedVideoElements = new WeakSet();
2474
- Player.version = /* PLAYER_VERSION */ "4.3.0-dev.2025011000";
2474
+ Player.version = /* PLAYER_VERSION */ "4.3.0-dev.2025012900";
2475
2475
  export default Player;
@@ -1 +1 @@
1
- {"version":3,"file":"rebuffering_controller.d.ts","sourceRoot":"","sources":["../../../../../src/main_thread/init/utils/rebuffering_controller.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAGvD,OAAO,KAAK,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,mBAAmB,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,EAAE,eAAe,CAAC;IACxB;;;;OAIG;IACH,aAAa,EAAE,sBAAsB,GAAG,IAAI,CAAC;IAC7C;;;OAGG;IACH,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,4CAA4C;AAC5C,MAAM,WAAW,sBAAsB;IACrC;;;;;OAKG;IACH,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B;;;OAGG;IACH,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;CACpB"}
1
+ {"version":3,"file":"rebuffering_controller.d.ts","sourceRoot":"","sources":["../../../../../src/main_thread/init/utils/rebuffering_controller.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAGvD,OAAO,KAAK,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAG5E,OAAO,KAAK,EACV,6BAA6B,EAE9B,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,YAAY,MAAM,8BAA8B,CAAC;AAGxD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AAEzE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAQnD;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,OAAO,qBAAsB,SAAQ,YAAY,CAAC,2BAA2B,CAAC;IAC1F,2CAA2C;IAC3C,OAAO,CAAC,iBAAiB,CAAgC;IACzD,OAAO,CAAC,SAAS,CAA2B;IAC5C,OAAO,CAAC,MAAM,CAAmC;IACjD,OAAO,CAAC,UAAU,CAAU;IAE5B;;;OAGG;IACH,OAAO,CAAC,qBAAqB,CAA6B;IAE1D,OAAO,CAAC,UAAU,CAAgB;IAElC;;;;OAIG;gBAED,gBAAgB,EAAE,6BAA6B,EAC/C,QAAQ,EAAE,iBAAiB,GAAG,IAAI,EAClC,KAAK,EAAE,wBAAwB,CAAC,MAAM,CAAC;IAWlC,KAAK,IAAI,IAAI;IAuNpB;;;;;OAKG;IACI,uBAAuB,CAAC,GAAG,EAAE,mBAAmB,GAAG,IAAI;IAQ9D;;;;;;;OAOG;IACI,cAAc,CAAC,UAAU,EAAE,WAAW,EAAE,MAAM,EAAE,eAAe,GAAG,IAAI;IA4B7E;;;OAGG;IACI,OAAO,IAAI,IAAI;CAGvB;AAwOD,MAAM,WAAW,2BAA2B;IAC1C,OAAO,EAAE,kBAAkB,CAAC;IAC5B,SAAS,EAAE,IAAI,CAAC;IAChB,WAAW,EAAE,IAAI,CAAC;IAClB,OAAO,EAAE,YAAY,CAAC;CACvB;AAED;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IAClC,kDAAkD;IAClD,UAAU,EAAE,WAAW,CAAC;IACxB,6CAA6C;IAC7C,MAAM,EAAE,eAAe,CAAC;IACxB;;;;OAIG;IACH,aAAa,EAAE,sBAAsB,GAAG,IAAI,CAAC;IAC7C;;;OAGG;IACH,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,4CAA4C;AAC5C,MAAM,WAAW,sBAAsB;IACrC;;;;;OAKG;IACH,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B;;;OAGG;IACH,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;CACpB"}
@@ -118,26 +118,38 @@ export default class RebufferingController extends EventEmitter {
118
118
  if (position.isAwaitingFuturePosition()) {
119
119
  playbackRateUpdater.stopRebuffering();
120
120
  log.debug("Init: let rebuffering happen as we're awaiting a future position");
121
- this.trigger("stalled", stalledReason);
122
- return;
123
121
  }
124
- playbackRateUpdater.startRebuffering();
122
+ else {
123
+ playbackRateUpdater.startRebuffering();
124
+ }
125
125
  if (this._manifest === null ||
126
126
  (isSeekingApproximate &&
127
+ // Don't handle discontinuities on devices with broken seeks before
128
+ // enough time have passed because seeking brings more risks to
129
+ // lead to a lengthy rebuffering-exiting process
127
130
  getMonotonicTimeStamp() - rebuffering.timestamp <= 1000)) {
128
131
  this.trigger("stalled", stalledReason);
129
132
  return;
130
133
  }
131
134
  /** Position at which data is awaited. */
132
135
  const { position: stalledPosition } = rebuffering;
136
+ /**
137
+ * We may still be in the process of waiting for a position to be seeked
138
+ * to. When calculating a potential position to e.g. skip over
139
+ * discontinuities, we should compare it to that "target" position if
140
+ * one, not the one we're currently playing.
141
+ */
142
+ const targetTime = observation.position.isAwaitingFuturePosition()
143
+ ? observation.position.getWanted()
144
+ : this._playbackObserver.getCurrentTime();
133
145
  if (stalledPosition !== null &&
134
146
  stalledPosition !== undefined &&
135
147
  this._speed.getValue() > 0) {
136
148
  const skippableDiscontinuity = findSeekableDiscontinuity(discontinuitiesStore, this._manifest, stalledPosition);
137
149
  if (skippableDiscontinuity !== null) {
138
150
  const realSeekTime = skippableDiscontinuity + 0.001;
139
- if (realSeekTime <= this._playbackObserver.getCurrentTime()) {
140
- log.info("Init: position to seek already reached, no seeking", this._playbackObserver.getCurrentTime(), realSeekTime);
151
+ if (realSeekTime <= targetTime) {
152
+ log.info("Init: position to seek already reached, no seeking", targetTime, realSeekTime);
141
153
  }
142
154
  else {
143
155
  log.warn("SA: skippable discontinuity found in the stream", position.getPolled(), realSeekTime);
@@ -161,7 +173,7 @@ export default class RebufferingController extends EventEmitter {
161
173
  this._speed.getValue() > 0 &&
162
174
  nextBufferRangeGap < BUFFER_DISCONTINUITY_THRESHOLD) {
163
175
  const seekTo = positionBlockedAt + nextBufferRangeGap + EPSILON;
164
- if (this._playbackObserver.getCurrentTime() < seekTo) {
176
+ if (targetTime < seekTo) {
165
177
  log.warn("Init: discontinuity encountered inferior to the threshold", positionBlockedAt, seekTo, BUFFER_DISCONTINUITY_THRESHOLD);
166
178
  this._playbackObserver.setCurrentTime(seekTo);
167
179
  this.trigger("warning", generateDiscontinuityError(positionBlockedAt, seekTo));
@@ -174,8 +186,7 @@ export default class RebufferingController extends EventEmitter {
174
186
  const period = this._manifest.periods[i];
175
187
  if (period.end !== undefined && period.end <= positionBlockedAt) {
176
188
  if (this._manifest.periods[i + 1].start > positionBlockedAt &&
177
- this._manifest.periods[i + 1].start >
178
- this._playbackObserver.getCurrentTime()) {
189
+ this._manifest.periods[i + 1].start > targetTime) {
179
190
  const nextPeriod = this._manifest.periods[i + 1];
180
191
  this._playbackObserver.setCurrentTime(nextPeriod.start);
181
192
  this.trigger("warning", generateDiscontinuityError(positionBlockedAt, nextPeriod.start));
package/dist/rx-player.js CHANGED
@@ -20435,15 +20435,18 @@
20435
20435
  if (position.isAwaitingFuturePosition()) {
20436
20436
  playbackRateUpdater.stopRebuffering();
20437
20437
  log_default.debug("Init: let rebuffering happen as we're awaiting a future position");
20438
- this.trigger("stalled", stalledReason);
20439
- return;
20438
+ } else {
20439
+ playbackRateUpdater.startRebuffering();
20440
20440
  }
20441
- playbackRateUpdater.startRebuffering();
20442
- if (this._manifest === null || is_seeking_approximate_default && monotonic_timestamp_default() - rebuffering.timestamp <= 1e3) {
20441
+ if (this._manifest === null || is_seeking_approximate_default && // Don't handle discontinuities on devices with broken seeks before
20442
+ // enough time have passed because seeking brings more risks to
20443
+ // lead to a lengthy rebuffering-exiting process
20444
+ monotonic_timestamp_default() - rebuffering.timestamp <= 1e3) {
20443
20445
  this.trigger("stalled", stalledReason);
20444
20446
  return;
20445
20447
  }
20446
20448
  const { position: stalledPosition } = rebuffering;
20449
+ const targetTime = observation.position.isAwaitingFuturePosition() ? observation.position.getWanted() : this._playbackObserver.getCurrentTime();
20447
20450
  if (stalledPosition !== null && stalledPosition !== void 0 && this._speed.getValue() > 0) {
20448
20451
  const skippableDiscontinuity = findSeekableDiscontinuity(
20449
20452
  discontinuitiesStore,
@@ -20452,10 +20455,10 @@
20452
20455
  );
20453
20456
  if (skippableDiscontinuity !== null) {
20454
20457
  const realSeekTime = skippableDiscontinuity + 1e-3;
20455
- if (realSeekTime <= this._playbackObserver.getCurrentTime()) {
20458
+ if (realSeekTime <= targetTime) {
20456
20459
  log_default.info(
20457
20460
  "Init: position to seek already reached, no seeking",
20458
- this._playbackObserver.getCurrentTime(),
20461
+ targetTime,
20459
20462
  realSeekTime
20460
20463
  );
20461
20464
  } else {
@@ -20480,7 +20483,7 @@
20480
20483
  );
20481
20484
  if ((!is_seeking_approximate_default || monotonic_timestamp_default() - rebuffering.timestamp > 1e3) && this._speed.getValue() > 0 && nextBufferRangeGap < BUFFER_DISCONTINUITY_THRESHOLD) {
20482
20485
  const seekTo = positionBlockedAt + nextBufferRangeGap + EPSILON2;
20483
- if (this._playbackObserver.getCurrentTime() < seekTo) {
20486
+ if (targetTime < seekTo) {
20484
20487
  log_default.warn(
20485
20488
  "Init: discontinuity encountered inferior to the threshold",
20486
20489
  positionBlockedAt,
@@ -20498,7 +20501,7 @@
20498
20501
  for (let i = this._manifest.periods.length - 2; i >= 0; i--) {
20499
20502
  const period = this._manifest.periods[i];
20500
20503
  if (period.end !== void 0 && period.end <= positionBlockedAt) {
20501
- if (this._manifest.periods[i + 1].start > positionBlockedAt && this._manifest.periods[i + 1].start > this._playbackObserver.getCurrentTime()) {
20504
+ if (this._manifest.periods[i + 1].start > positionBlockedAt && this._manifest.periods[i + 1].start > targetTime) {
20502
20505
  const nextPeriod = this._manifest.periods[i + 1];
20503
20506
  this._playbackObserver.setCurrentTime(nextPeriod.start);
20504
20507
  this.trigger(
@@ -37163,7 +37166,7 @@ ${event}`
37163
37166
  } = parseConstructorOptions(options);
37164
37167
  videoElement.preload = "auto";
37165
37168
  this.version = /* PLAYER_VERSION */
37166
- "4.3.0-dev.2025011000";
37169
+ "4.3.0-dev.2025012900";
37167
37170
  this.log = log_default;
37168
37171
  this.state = "STOPPED";
37169
37172
  this.videoElement = videoElement;
@@ -39704,7 +39707,7 @@ ${event}`
39704
39707
  _Player._priv_currentlyUsedVideoElements = /* @__PURE__ */ new WeakSet();
39705
39708
  var Player = _Player;
39706
39709
  Player.version = /* PLAYER_VERSION */
39707
- "4.3.0-dev.2025011000";
39710
+ "4.3.0-dev.2025012900";
39708
39711
  var public_api_default = Player;
39709
39712
 
39710
39713
  // src/main_thread/api/index.ts