rx-player 4.0.0-dev.2024030400 → 4.0.0-dev.2024030500

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 (29) hide show
  1. package/VERSION +1 -1
  2. package/dist/commonjs/__GENERATED_CODE/embedded_worker.js +1 -1
  3. package/dist/commonjs/compat/browser_detection.d.ts +3 -1
  4. package/dist/commonjs/compat/browser_detection.js +8 -2
  5. package/dist/commonjs/compat/has_worker_api.d.ts +9 -0
  6. package/dist/commonjs/compat/has_worker_api.js +17 -0
  7. package/dist/commonjs/core/main/common/create_content_time_boundaries_observer.d.ts +1 -1
  8. package/dist/commonjs/core/main/common/create_content_time_boundaries_observer.js +1 -1
  9. package/dist/commonjs/core/segment_sinks/implementations/audio_video/audio_video_segment_buffer.d.ts +1 -1
  10. package/dist/commonjs/core/segment_sinks/implementations/audio_video/audio_video_segment_buffer.js +1 -1
  11. package/dist/commonjs/core/segment_sinks/segment_buffers_store.d.ts +1 -1
  12. package/dist/commonjs/core/segment_sinks/segment_buffers_store.js +1 -1
  13. package/dist/commonjs/main_thread/api/public_api.js +4 -3
  14. package/dist/es2017/__GENERATED_CODE/embedded_worker.js +1 -1
  15. package/dist/es2017/compat/browser_detection.d.ts +3 -1
  16. package/dist/es2017/compat/browser_detection.js +7 -2
  17. package/dist/es2017/compat/has_worker_api.d.ts +9 -0
  18. package/dist/es2017/compat/has_worker_api.js +14 -0
  19. package/dist/es2017/core/main/common/create_content_time_boundaries_observer.d.ts +1 -1
  20. package/dist/es2017/core/main/common/create_content_time_boundaries_observer.js +1 -1
  21. package/dist/es2017/core/segment_sinks/implementations/audio_video/audio_video_segment_buffer.d.ts +1 -1
  22. package/dist/es2017/core/segment_sinks/implementations/audio_video/audio_video_segment_buffer.js +1 -1
  23. package/dist/es2017/core/segment_sinks/segment_buffers_store.d.ts +1 -1
  24. package/dist/es2017/core/segment_sinks/segment_buffers_store.js +1 -1
  25. package/dist/es2017/main_thread/api/public_api.js +4 -3
  26. package/dist/rx-player.js +25 -7
  27. package/dist/rx-player.min.js +1 -1
  28. package/dist/worker.js +1 -1
  29. package/package.json +1 -1
@@ -37,8 +37,10 @@ declare let isWebOs2021: boolean;
37
37
  declare let isWebOs2022: boolean;
38
38
  /** `true` for Panasonic devices. */
39
39
  declare let isPanasonic: boolean;
40
+ /** `true` for the PlayStation 4 game console. */
41
+ declare let isPlayStation4: boolean;
40
42
  /** `true` for the PlayStation 5 game console. */
41
43
  declare let isPlayStation5: boolean;
42
44
  /** `true` for the Xbox game consoles. */
43
45
  declare let isXbox: boolean;
44
- export { isEdgeChromium, isIE11, isIEOrEdge, isFirefox, isPanasonic, isPlayStation5, isXbox, isSafariDesktop, isSafariMobile, isSamsungBrowser, isTizen, isWebOs, isWebOs2021, isWebOs2022, };
46
+ export { isEdgeChromium, isIE11, isIEOrEdge, isFirefox, isPanasonic, isPlayStation4, isPlayStation5, isXbox, isSafariDesktop, isSafariMobile, isSamsungBrowser, isTizen, isWebOs, isWebOs2021, isWebOs2022, };
@@ -15,7 +15,7 @@
15
15
  * limitations under the License.
16
16
  */
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.isWebOs2022 = exports.isWebOs2021 = exports.isWebOs = exports.isTizen = exports.isSamsungBrowser = exports.isSafariMobile = exports.isSafariDesktop = exports.isXbox = exports.isPlayStation5 = exports.isPanasonic = exports.isFirefox = exports.isIEOrEdge = exports.isIE11 = exports.isEdgeChromium = void 0;
18
+ exports.isWebOs2022 = exports.isWebOs2021 = exports.isWebOs = exports.isTizen = exports.isSamsungBrowser = exports.isSafariMobile = exports.isSafariDesktop = exports.isXbox = exports.isPlayStation5 = exports.isPlayStation4 = exports.isPanasonic = exports.isFirefox = exports.isIEOrEdge = exports.isIE11 = exports.isEdgeChromium = void 0;
19
19
  var global_scope_1 = require("../utils/global_scope");
20
20
  var is_node_1 = require("../utils/is_node");
21
21
  /** Edge Chromium, regardless of the device */
@@ -54,6 +54,9 @@ exports.isWebOs2022 = isWebOs2022;
54
54
  /** `true` for Panasonic devices. */
55
55
  var isPanasonic = false;
56
56
  exports.isPanasonic = isPanasonic;
57
+ /** `true` for the PlayStation 4 game console. */
58
+ var isPlayStation4 = false;
59
+ exports.isPlayStation4 = isPlayStation4;
57
60
  /** `true` for the PlayStation 5 game console. */
58
61
  var isPlayStation5 = false;
59
62
  exports.isPlayStation5 = isPlayStation5;
@@ -109,7 +112,10 @@ exports.isXbox = isXbox;
109
112
  if (/SamsungBrowser/.test(navigator.userAgent)) {
110
113
  exports.isSamsungBrowser = isSamsungBrowser = true;
111
114
  }
112
- if (navigator.userAgent.indexOf("PlayStation 5") !== -1) {
115
+ if (navigator.userAgent.indexOf("PlayStation 4") !== -1) {
116
+ exports.isPlayStation4 = isPlayStation4 = true;
117
+ }
118
+ else if (navigator.userAgent.indexOf("PlayStation 5") !== -1) {
113
119
  exports.isPlayStation5 = isPlayStation5 = true;
114
120
  }
115
121
  else if (/Tizen/.test(navigator.userAgent)) {
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Return `true` if the current device is compatible with the Worker API.
3
+ *
4
+ * Some old webkit devices, such as the PlayStation 4, returns weird results
5
+ * when doing the most straightforward check. We have to check if other Webkit
6
+ * devices have the same issue.
7
+ * @returns {boolean}
8
+ */
9
+ export default function hasWorkerApi(): boolean;
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var browser_detection_1 = require("./browser_detection");
4
+ /**
5
+ * Return `true` if the current device is compatible with the Worker API.
6
+ *
7
+ * Some old webkit devices, such as the PlayStation 4, returns weird results
8
+ * when doing the most straightforward check. We have to check if other Webkit
9
+ * devices have the same issue.
10
+ * @returns {boolean}
11
+ */
12
+ function hasWorkerApi() {
13
+ return browser_detection_1.isPlayStation4 ?
14
+ typeof Worker === "object" || typeof Worker === "function" :
15
+ typeof Worker === "function";
16
+ }
17
+ exports.default = hasWorkerApi;
@@ -18,7 +18,7 @@ export interface IContentTimeBoundariesObserverCallbacks {
18
18
  * Various methods from that class need then to be called at various events
19
19
  * (see `ContentTimeBoundariesObserver`).
20
20
  * @param {Object} manifest
21
- * @param {MediaSource} mediaSource
21
+ * @param {Object} mediaSource
22
22
  * @param {Object} streamObserver
23
23
  * @param {Object} segmentSinksStore
24
24
  * @param {Object} cancelSignal
@@ -11,7 +11,7 @@ var content_time_boundaries_observer_1 = require("./content_time_boundaries_obse
11
11
  * Various methods from that class need then to be called at various events
12
12
  * (see `ContentTimeBoundariesObserver`).
13
13
  * @param {Object} manifest
14
- * @param {MediaSource} mediaSource
14
+ * @param {Object} mediaSource
15
15
  * @param {Object} streamObserver
16
16
  * @param {Object} segmentSinksStore
17
17
  * @param {Object} cancelSignal
@@ -60,7 +60,7 @@ export default class AudioVideoSegmentSink extends SegmentSink {
60
60
  * @constructor
61
61
  * @param {string} bufferType
62
62
  * @param {string} codec
63
- * @param {MediaSource} mediaSource
63
+ * @param {Object} mediaSource
64
64
  */
65
65
  constructor(bufferType: SourceBufferType, codec: string, mediaSource: IMediaSourceInterface);
66
66
  /** @see SegmentSink */
@@ -85,7 +85,7 @@ var AudioVideoSegmentSink = /** @class */ (function (_super) {
85
85
  * @constructor
86
86
  * @param {string} bufferType
87
87
  * @param {string} codec
88
- * @param {MediaSource} mediaSource
88
+ * @param {Object} mediaSource
89
89
  */
90
90
  function AudioVideoSegmentSink(bufferType, codec, mediaSource) {
91
91
  var _this = _super.call(this) || this;
@@ -69,7 +69,7 @@ export default class SegmentSinksStore {
69
69
  private _textInterface;
70
70
  private _hasVideo;
71
71
  /**
72
- * @param {MediaSource} mediaSource
72
+ * @param {Object} mediaSource
73
73
  * @constructor
74
74
  */
75
75
  constructor(mediaSource: IMediaSourceInterface, hasVideo: boolean, textDisplayerInterface: ITextDisplayerInterface | null);
@@ -45,7 +45,7 @@ var POSSIBLE_BUFFER_TYPES = ["audio", "video", "text"];
45
45
  */
46
46
  var SegmentSinksStore = /** @class */ (function () {
47
47
  /**
48
- * @param {MediaSource} mediaSource
48
+ * @param {Object} mediaSource
49
49
  * @constructor
50
50
  */
51
51
  function SegmentSinksStore(mediaSource, hasVideo, textDisplayerInterface) {
@@ -76,6 +76,7 @@ var can_rely_on_video_visibility_and_size_1 = require("../../compat/can_rely_on_
76
76
  var event_listeners_1 = require("../../compat/event_listeners");
77
77
  var get_start_date_1 = require("../../compat/get_start_date");
78
78
  var has_mse_in_worker_1 = require("../../compat/has_mse_in_worker");
79
+ var has_worker_api_1 = require("../../compat/has_worker_api");
79
80
  var is_debug_mode_enabled_1 = require("../../compat/is_debug_mode_enabled");
80
81
  var errors_1 = require("../../errors");
81
82
  var worker_initialization_error_1 = require("../../errors/worker_initialization_error");
@@ -127,7 +128,7 @@ var Player = /** @class */ (function (_super) {
127
128
  // Workaround to support Firefox autoplay on FF 42.
128
129
  // See: https://bugzilla.mozilla.org/show_bug.cgi?id=1194624
129
130
  videoElement.preload = "auto";
130
- _this.version = /* PLAYER_VERSION */ "4.0.0-dev.2024030400";
131
+ _this.version = /* PLAYER_VERSION */ "4.0.0-dev.2024030500";
131
132
  _this.log = log_1.default;
132
133
  _this.state = "STOPPED";
133
134
  _this.videoElement = videoElement;
@@ -218,7 +219,7 @@ var Player = /** @class */ (function (_super) {
218
219
  var _this = this;
219
220
  return new Promise(function (res, rej) {
220
221
  var _a;
221
- if (typeof Worker !== "function") {
222
+ if (!(0, has_worker_api_1.default)()) {
222
223
  log_1.default.warn("API: Cannot rely on a WebWorker: Worker API unavailable");
223
224
  return rej(new worker_initialization_error_1.default("INCOMPATIBLE_ERROR", "Worker unavailable"));
224
225
  }
@@ -2514,5 +2515,5 @@ var Player = /** @class */ (function (_super) {
2514
2515
  };
2515
2516
  return Player;
2516
2517
  }(event_emitter_1.default));
2517
- Player.version = /* PLAYER_VERSION */ "4.0.0-dev.2024030400";
2518
+ Player.version = /* PLAYER_VERSION */ "4.0.0-dev.2024030500";
2518
2519
  exports.default = Player;