rx-player 3.31.1-dev.2023062700 → 3.31.1-dev.2023070500

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/CHANGELOG.md CHANGED
@@ -1,6 +1,10 @@
1
1
  # Changelog
2
2
 
3
- ## v3.31.1-dev.2023062700 (2023-06-27)
3
+ ## v3.31.1-dev.2023070500 (2023-07-05)
4
+
5
+ ### Bug fixes
6
+
7
+ - On the PlayStation 5, only switch to the `"LOADED"` state once the HTMLMediaElement's `readyState` of `4` has been reached, as it seems to switch to `3` too soon there [#1257]
4
8
 
5
9
  ### Other improvements
6
10
 
package/VERSION CHANGED
@@ -1 +1 @@
1
- 3.31.1-dev.2023062700
1
+ 3.31.1-dev.2023070500
@@ -37,4 +37,5 @@ import shouldRenewMediaKeySystemAccess from "./should_renew_media_key_system_acc
37
37
  import shouldUnsetMediaKeys from "./should_unset_media_keys";
38
38
  import shouldValidateMetadata from "./should_validate_metadata";
39
39
  import shouldWaitForDataBeforeLoaded from "./should_wait_for_data_before_loaded";
40
- export { addClassName, addTextTrack, canPatchISOBMFFSegment, canReuseMediaKeys, clearElementSrc, closeSession, CustomMediaKeySystemAccess, enableAudioTrack, events, exitFullscreen, generateKeyRequest, getInitData, getStartDate, hasEMEAPIs, ICompatTextTrack, ICompatVTTCue, ICustomMediaKeySession, ICustomMediaKeySystemAccess, ICustomMediaKeys, ICompatSourceBuffer, isCodecSupported, isFullscreen, isNode, isOffline, isVTTCue, loadSession, makeVTTCue, MediaSource_, onHeightWidthChange, requestFullscreen, requestMediaKeySystemAccess, setMediaKeys, shouldReloadMediaSourceOnDecipherabilityUpdate, shouldRenewMediaKeySystemAccess, shouldUnsetMediaKeys, shouldValidateMetadata, shouldWaitForDataBeforeLoaded, tryToChangeSourceBufferType, };
40
+ import shouldWaitForHaveEnoughData from "./should_wait_for_have_enough_data";
41
+ export { addClassName, addTextTrack, canPatchISOBMFFSegment, canReuseMediaKeys, clearElementSrc, closeSession, CustomMediaKeySystemAccess, enableAudioTrack, events, exitFullscreen, generateKeyRequest, getInitData, getStartDate, hasEMEAPIs, ICompatTextTrack, ICompatVTTCue, ICustomMediaKeySession, ICustomMediaKeySystemAccess, ICustomMediaKeys, ICompatSourceBuffer, isCodecSupported, isFullscreen, isNode, isOffline, isVTTCue, loadSession, makeVTTCue, MediaSource_, onHeightWidthChange, requestFullscreen, requestMediaKeySystemAccess, setMediaKeys, shouldReloadMediaSourceOnDecipherabilityUpdate, shouldRenewMediaKeySystemAccess, shouldUnsetMediaKeys, shouldValidateMetadata, shouldWaitForDataBeforeLoaded, shouldWaitForHaveEnoughData, tryToChangeSourceBufferType, };
@@ -39,8 +39,9 @@ import shouldRenewMediaKeySystemAccess from "./should_renew_media_key_system_acc
39
39
  import shouldUnsetMediaKeys from "./should_unset_media_keys";
40
40
  import shouldValidateMetadata from "./should_validate_metadata";
41
41
  import shouldWaitForDataBeforeLoaded from "./should_wait_for_data_before_loaded";
42
+ import shouldWaitForHaveEnoughData from "./should_wait_for_have_enough_data";
42
43
  // TODO To remove. This seems to be the only side-effect done on import, which
43
44
  // we would prefer to disallow (both for the understandability of the code and
44
45
  // to better exploit tree shaking.
45
46
  patchWebkitSourceBuffer();
46
- export { addClassName, addTextTrack, canPatchISOBMFFSegment, canReuseMediaKeys, clearElementSrc, closeSession, CustomMediaKeySystemAccess, enableAudioTrack, events, exitFullscreen, generateKeyRequest, getInitData, getStartDate, hasEMEAPIs, isCodecSupported, isFullscreen, isNode, isOffline, isVTTCue, loadSession, makeVTTCue, MediaSource_, onHeightWidthChange, requestFullscreen, requestMediaKeySystemAccess, setMediaKeys, shouldReloadMediaSourceOnDecipherabilityUpdate, shouldRenewMediaKeySystemAccess, shouldUnsetMediaKeys, shouldValidateMetadata, shouldWaitForDataBeforeLoaded, tryToChangeSourceBufferType, };
47
+ export { addClassName, addTextTrack, canPatchISOBMFFSegment, canReuseMediaKeys, clearElementSrc, closeSession, CustomMediaKeySystemAccess, enableAudioTrack, events, exitFullscreen, generateKeyRequest, getInitData, getStartDate, hasEMEAPIs, isCodecSupported, isFullscreen, isNode, isOffline, isVTTCue, loadSession, makeVTTCue, MediaSource_, onHeightWidthChange, requestFullscreen, requestMediaKeySystemAccess, setMediaKeys, shouldReloadMediaSourceOnDecipherabilityUpdate, shouldRenewMediaKeySystemAccess, shouldUnsetMediaKeys, shouldValidateMetadata, shouldWaitForDataBeforeLoaded, shouldWaitForHaveEnoughData, tryToChangeSourceBufferType, };
@@ -0,0 +1,13 @@
1
+ /**
2
+ * An `HTMLMediaElement`'s readyState allows the browser to communicate whether
3
+ * it can play a content reliably.
4
+ * Usually, we may consider that a `HAVE_FUTURE_DATA` (readyState `3`) or even
5
+ * a `HAVE_CURRENT_DATA` (readyState `2`) is enough to begin playing the content
6
+ * and consider it as loaded.
7
+ *
8
+ * However some devices wrongly anounce those readyStates before being actually
9
+ * able to decode the content. For those devices we wait for the
10
+ * `HAVE_ENOUGH_DATA` readyState before considering the content as loaded.
11
+ * @returns {boolean}
12
+ */
13
+ export default function shouldWaitForHaveEnoughData(): boolean;
@@ -0,0 +1,16 @@
1
+ import { isPlayStation5 } from "./browser_detection";
2
+ /**
3
+ * An `HTMLMediaElement`'s readyState allows the browser to communicate whether
4
+ * it can play a content reliably.
5
+ * Usually, we may consider that a `HAVE_FUTURE_DATA` (readyState `3`) or even
6
+ * a `HAVE_CURRENT_DATA` (readyState `2`) is enough to begin playing the content
7
+ * and consider it as loaded.
8
+ *
9
+ * However some devices wrongly anounce those readyStates before being actually
10
+ * able to decode the content. For those devices we wait for the
11
+ * `HAVE_ENOUGH_DATA` readyState before considering the content as loaded.
12
+ * @returns {boolean}
13
+ */
14
+ export default function shouldWaitForHaveEnoughData() {
15
+ return isPlayStation5;
16
+ }
@@ -90,7 +90,7 @@ var Player = /** @class */ (function (_super) {
90
90
  // Workaround to support Firefox autoplay on FF 42.
91
91
  // See: https://bugzilla.mozilla.org/show_bug.cgi?id=1194624
92
92
  videoElement.preload = "auto";
93
- _this.version = /* PLAYER_VERSION */ "3.31.1-dev.2023062700";
93
+ _this.version = /* PLAYER_VERSION */ "3.31.1-dev.2023070500";
94
94
  _this.log = log;
95
95
  _this.state = "STOPPED";
96
96
  _this.videoElement = videoElement;
@@ -2431,5 +2431,5 @@ var Player = /** @class */ (function (_super) {
2431
2431
  };
2432
2432
  return Player;
2433
2433
  }(EventEmitter));
2434
- Player.version = /* PLAYER_VERSION */ "3.31.1-dev.2023062700";
2434
+ Player.version = /* PLAYER_VERSION */ "3.31.1-dev.2023070500";
2435
2435
  export default Player;
@@ -13,7 +13,7 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import { shouldValidateMetadata, shouldWaitForDataBeforeLoaded, } from "../../../compat";
16
+ import { shouldValidateMetadata, shouldWaitForDataBeforeLoaded, shouldWaitForHaveEnoughData, } from "../../../compat";
17
17
  import createSharedReference from "../../../utils/reference";
18
18
  import TaskCanceller from "../../../utils/task_canceller";
19
19
  /**
@@ -42,7 +42,9 @@ export default function getLoadedReference(playbackObserver, mediaElement, isDir
42
42
  return;
43
43
  }
44
44
  }
45
- if (observation.readyState >= 3 && observation.currentRange !== null) {
45
+ var minReadyState = shouldWaitForHaveEnoughData() ? 4 :
46
+ 3;
47
+ if (observation.readyState >= minReadyState && observation.currentRange !== null) {
46
48
  if (!shouldValidateMetadata() || mediaElement.duration > 0) {
47
49
  isLoaded.setValue(true);
48
50
  listenCanceller.cancel();
package/dist/rx-player.js CHANGED
@@ -9178,8 +9178,8 @@ var currentMediaState = new WeakMap();
9178
9178
  /* harmony import */ var _utils_assert__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(811);
9179
9179
  /* harmony import */ var _utils_reference__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(5095);
9180
9180
  /* harmony import */ var _utils_task_canceller__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(288);
9181
- /* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(379);
9182
- /* harmony import */ var _utils_get_loaded_reference__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(1757);
9181
+ /* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(9420);
9182
+ /* harmony import */ var _utils_get_loaded_reference__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(379);
9183
9183
  /* harmony import */ var _utils_initial_seek_and_play__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(8833);
9184
9184
  /* harmony import */ var _utils_initialize_content_decryption__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(8799);
9185
9185
  /* harmony import */ var _utils_rebuffering_controller__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(6199);
@@ -9431,7 +9431,7 @@ function getDirectFileInitialTime(mediaElement, startAt) {
9431
9431
 
9432
9432
  /***/ }),
9433
9433
 
9434
- /***/ 379:
9434
+ /***/ 9420:
9435
9435
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
9436
9436
 
9437
9437
  "use strict";
@@ -9479,7 +9479,7 @@ var ContentInitializer = /*#__PURE__*/function (_EventEmitter) {
9479
9479
 
9480
9480
  /***/ }),
9481
9481
 
9482
- /***/ 1757:
9482
+ /***/ 379:
9483
9483
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
9484
9484
 
9485
9485
  "use strict";
@@ -9522,6 +9522,23 @@ function shouldWaitForDataBeforeLoaded(isDirectfile, mustPlayInline) {
9522
9522
  }
9523
9523
  return true;
9524
9524
  }
9525
+ ;// CONCATENATED MODULE: ./src/compat/should_wait_for_have_enough_data.ts
9526
+
9527
+ /**
9528
+ * An `HTMLMediaElement`'s readyState allows the browser to communicate whether
9529
+ * it can play a content reliably.
9530
+ * Usually, we may consider that a `HAVE_FUTURE_DATA` (readyState `3`) or even
9531
+ * a `HAVE_CURRENT_DATA` (readyState `2`) is enough to begin playing the content
9532
+ * and consider it as loaded.
9533
+ *
9534
+ * However some devices wrongly anounce those readyStates before being actually
9535
+ * able to decode the content. For those devices we wait for the
9536
+ * `HAVE_ENOUGH_DATA` readyState before considering the content as loaded.
9537
+ * @returns {boolean}
9538
+ */
9539
+ function shouldWaitForHaveEnoughData() {
9540
+ return browser_detection/* isPlayStation5 */.lV;
9541
+ }
9525
9542
  // EXTERNAL MODULE: ./src/compat/should_validate_metadata.ts
9526
9543
  var should_validate_metadata = __webpack_require__(1669);
9527
9544
  // EXTERNAL MODULE: ./src/utils/reference.ts
@@ -9571,7 +9588,8 @@ function getLoadedReference(playbackObserver, mediaElement, isDirectfile, cancel
9571
9588
  return;
9572
9589
  }
9573
9590
  }
9574
- if (observation.readyState >= 3 && observation.currentRange !== null) {
9591
+ var minReadyState = shouldWaitForHaveEnoughData() ? 4 : 3;
9592
+ if (observation.readyState >= minReadyState && observation.currentRange !== null) {
9575
9593
  if (!(0,should_validate_metadata/* default */.Z)() || mediaElement.duration > 0) {
9576
9594
  isLoaded.setValue(true);
9577
9595
  listenCanceller.cancel();
@@ -47828,7 +47846,7 @@ function needsFlushingAfterClean(observation, cleanedRanges) {
47828
47846
 
47829
47847
  /* harmony default export */ var stream = (orchestrator);
47830
47848
  // EXTERNAL MODULE: ./src/core/init/types.ts
47831
- var init_types = __webpack_require__(379);
47849
+ var init_types = __webpack_require__(9420);
47832
47850
  ;// CONCATENATED MODULE: ./src/core/init/utils/content_time_boundaries_observer.ts
47833
47851
 
47834
47852
  function content_time_boundaries_observer_createForOfIteratorHelperLoose(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = content_time_boundaries_observer_unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
@@ -48695,8 +48713,8 @@ function getInitialTime(manifest, lowLatencyMode, startAt) {
48695
48713
  log/* default */.Z.info("Init: starting at the minimum available position:", minimumPosition);
48696
48714
  return minimumPosition;
48697
48715
  }
48698
- // EXTERNAL MODULE: ./src/core/init/utils/get_loaded_reference.ts + 1 modules
48699
- var get_loaded_reference = __webpack_require__(1757);
48716
+ // EXTERNAL MODULE: ./src/core/init/utils/get_loaded_reference.ts + 2 modules
48717
+ var get_loaded_reference = __webpack_require__(379);
48700
48718
  // EXTERNAL MODULE: ./src/core/init/utils/initial_seek_and_play.ts
48701
48719
  var initial_seek_and_play = __webpack_require__(8833);
48702
48720
  // EXTERNAL MODULE: ./src/core/init/utils/initialize_content_decryption.ts + 1 modules
@@ -52201,7 +52219,7 @@ var Player = /*#__PURE__*/function (_EventEmitter) {
52201
52219
  // Workaround to support Firefox autoplay on FF 42.
52202
52220
  // See: https://bugzilla.mozilla.org/show_bug.cgi?id=1194624
52203
52221
  videoElement.preload = "auto";
52204
- _this.version = /* PLAYER_VERSION */"3.31.1-dev.2023062700";
52222
+ _this.version = /* PLAYER_VERSION */"3.31.1-dev.2023070500";
52205
52223
  _this.log = log/* default */.Z;
52206
52224
  _this.state = "STOPPED";
52207
52225
  _this.videoElement = videoElement;
@@ -54612,7 +54630,7 @@ var Player = /*#__PURE__*/function (_EventEmitter) {
54612
54630
  }]);
54613
54631
  return Player;
54614
54632
  }(event_emitter/* default */.Z);
54615
- Player.version = /* PLAYER_VERSION */"3.31.1-dev.2023062700";
54633
+ Player.version = /* PLAYER_VERSION */"3.31.1-dev.2023070500";
54616
54634
  /* harmony default export */ var public_api = (Player);
54617
54635
  ;// CONCATENATED MODULE: ./src/core/api/index.ts
54618
54636
  /**