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.
@@ -489,7 +489,7 @@ function loadOrReloadPreparedContent(val, contentPreparer, playbackObservationRe
489
489
  });
490
490
  },
491
491
  }, currentLoadCanceller.signal);
492
- (0, stream_1.default)({ initialPeriod: manifest.periods[0], manifest: manifest }, playbackObserver, representationEstimator, segmentSinksStore, segmentQueueCreator, {
492
+ (0, stream_1.default)({ initialPeriod: initialPeriod, manifest: manifest }, playbackObserver, representationEstimator, segmentSinksStore, segmentQueueCreator, {
493
493
  wantedBufferAhead: globals_1.wantedBufferAhead,
494
494
  maxVideoBufferSize: globals_1.maxVideoBufferSize,
495
495
  maxBufferAhead: globals_1.maxBufferAhead,
@@ -161,7 +161,7 @@ var Player = /** @class */ (function (_super) {
161
161
  // Workaround to support Firefox autoplay on FF 42.
162
162
  // See: https://bugzilla.mozilla.org/show_bug.cgi?id=1194624
163
163
  videoElement.preload = "auto";
164
- _this.version = /* PLAYER_VERSION */ "4.3.0-dev.2025011000";
164
+ _this.version = /* PLAYER_VERSION */ "4.3.0-dev.2025012900";
165
165
  _this.log = log_1.default;
166
166
  _this.state = "STOPPED";
167
167
  _this.videoElement = videoElement;
@@ -2689,5 +2689,5 @@ var Player = /** @class */ (function (_super) {
2689
2689
  Player._priv_currentlyUsedVideoElements = new WeakSet();
2690
2690
  return Player;
2691
2691
  }(event_emitter_1.default));
2692
- Player.version = /* PLAYER_VERSION */ "4.3.0-dev.2025011000";
2692
+ Player.version = /* PLAYER_VERSION */ "4.3.0-dev.2025012900";
2693
2693
  exports.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,MAA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AW,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"}
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"}
@@ -149,26 +149,38 @@ var RebufferingController = /** @class */ (function (_super) {
149
149
  if (position.isAwaitingFuturePosition()) {
150
150
  playbackRateUpdater.stopRebuffering();
151
151
  log_1.default.debug("Init: let rebuffering happen as we're awaiting a future position");
152
- _this.trigger("stalled", stalledReason);
153
- return;
154
152
  }
155
- playbackRateUpdater.startRebuffering();
153
+ else {
154
+ playbackRateUpdater.startRebuffering();
155
+ }
156
156
  if (_this._manifest === null ||
157
157
  (is_seeking_approximate_1.default &&
158
+ // Don't handle discontinuities on devices with broken seeks before
159
+ // enough time have passed because seeking brings more risks to
160
+ // lead to a lengthy rebuffering-exiting process
158
161
  (0, monotonic_timestamp_1.default)() - rebuffering.timestamp <= 1000)) {
159
162
  _this.trigger("stalled", stalledReason);
160
163
  return;
161
164
  }
162
165
  /** Position at which data is awaited. */
163
166
  var stalledPosition = rebuffering.position;
167
+ /**
168
+ * We may still be in the process of waiting for a position to be seeked
169
+ * to. When calculating a potential position to e.g. skip over
170
+ * discontinuities, we should compare it to that "target" position if
171
+ * one, not the one we're currently playing.
172
+ */
173
+ var targetTime = observation.position.isAwaitingFuturePosition()
174
+ ? observation.position.getWanted()
175
+ : _this._playbackObserver.getCurrentTime();
164
176
  if (stalledPosition !== null &&
165
177
  stalledPosition !== undefined &&
166
178
  _this._speed.getValue() > 0) {
167
179
  var skippableDiscontinuity = findSeekableDiscontinuity(discontinuitiesStore, _this._manifest, stalledPosition);
168
180
  if (skippableDiscontinuity !== null) {
169
181
  var realSeekTime = skippableDiscontinuity + 0.001;
170
- if (realSeekTime <= _this._playbackObserver.getCurrentTime()) {
171
- log_1.default.info("Init: position to seek already reached, no seeking", _this._playbackObserver.getCurrentTime(), realSeekTime);
182
+ if (realSeekTime <= targetTime) {
183
+ log_1.default.info("Init: position to seek already reached, no seeking", targetTime, realSeekTime);
172
184
  }
173
185
  else {
174
186
  log_1.default.warn("SA: skippable discontinuity found in the stream", position.getPolled(), realSeekTime);
@@ -192,7 +204,7 @@ var RebufferingController = /** @class */ (function (_super) {
192
204
  _this._speed.getValue() > 0 &&
193
205
  nextBufferRangeGap < BUFFER_DISCONTINUITY_THRESHOLD) {
194
206
  var seekTo = positionBlockedAt + nextBufferRangeGap + EPSILON;
195
- if (_this._playbackObserver.getCurrentTime() < seekTo) {
207
+ if (targetTime < seekTo) {
196
208
  log_1.default.warn("Init: discontinuity encountered inferior to the threshold", positionBlockedAt, seekTo, BUFFER_DISCONTINUITY_THRESHOLD);
197
209
  _this._playbackObserver.setCurrentTime(seekTo);
198
210
  _this.trigger("warning", generateDiscontinuityError(positionBlockedAt, seekTo));
@@ -205,8 +217,7 @@ var RebufferingController = /** @class */ (function (_super) {
205
217
  var period = _this._manifest.periods[i];
206
218
  if (period.end !== undefined && period.end <= positionBlockedAt) {
207
219
  if (_this._manifest.periods[i + 1].start > positionBlockedAt &&
208
- _this._manifest.periods[i + 1].start >
209
- _this._playbackObserver.getCurrentTime()) {
220
+ _this._manifest.periods[i + 1].start > targetTime) {
210
221
  var nextPeriod = _this._manifest.periods[i + 1];
211
222
  _this._playbackObserver.setCurrentTime(nextPeriod.start);
212
223
  _this.trigger("warning", generateDiscontinuityError(positionBlockedAt, nextPeriod.start));
@@ -1 +1 @@
1
- {"version":3,"file":"embedded_worker.d.ts","sourceRoot":"","sources":["../../../src/__GENERATED_CODE/embedded_worker.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,IAAI,MAA85tT,CAAC;AACz6tT,OAAO,EAAE,IAAI,IAAI,eAAe,EAAE,CAAC;AACnC,eAAe,IAAI,CAAC"}
1
+ {"version":3,"file":"embedded_worker.d.ts","sourceRoot":"","sources":["../../../src/__GENERATED_CODE/embedded_worker.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,IAAI,MAAy5tT,CAAC;AACp6tT,OAAO,EAAE,IAAI,IAAI,eAAe,EAAE,CAAC;AACnC,eAAe,IAAI,CAAC"}