@arcware-cloud/pixelstreaming-websdk 1.3.7 → 1.3.8

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/README.md CHANGED
@@ -80,6 +80,10 @@ For more detailed examples and advanced usage, please refer to our documentation
80
80
 
81
81
  # Changelog
82
82
 
83
+ ### 1.3.8
84
+
85
+ - fixed error handling in SDK to back of reconnects if connection was intentionally terminated by cloud
86
+
83
87
  ### 1.3.3
84
88
 
85
89
  - adding built in functionality for filetransfer (docs will follow soon)
package/index.cjs.js CHANGED
@@ -23420,7 +23420,7 @@ class ArcwareConfig extends lib_pixelstreamingfrontend_ue5_5_1.Config {
23420
23420
  if (!config.initialSettings.ss)
23421
23421
  config.initialSettings.ss = exports.DefaultUrl;
23422
23422
  super(config);
23423
- this.VERSION = "1.3.7";
23423
+ this.VERSION = "1.3.8";
23424
23424
  this.settings = settings;
23425
23425
  this.session = new Session_1.Session();
23426
23426
  this._initialSettings = config.initialSettings;
@@ -23586,9 +23586,11 @@ class ArcwarePixelStreaming extends lib_pixelstreamingfrontend_ue5_5_1.PixelStre
23586
23586
  this.resetInitGuardsAndHooks();
23587
23587
  }
23588
23588
  // Classify CloseEvent into retryable vs. legit (non-retryable)
23589
- isRetryableClose(evt) {
23589
+ isRetryableClose(err) {
23590
+ var _a, _b;
23590
23591
  //const reason = (evt.reason || "").toLowerCase();
23591
- if (evt.code >= 4000 /*||
23592
+ const code = (_b = (_a = err.code) !== null && _a !== void 0 ? _a : err.status) !== null && _b !== void 0 ? _b : err.errorCode;
23593
+ if (code >= 4000 /*||
23592
23594
  reason.includes("Stream disconnected.") ||
23593
23595
  reason.includes("forbidden") ||
23594
23596
  reason.includes("invalid token") ||
@@ -23631,23 +23633,6 @@ class ArcwarePixelStreaming extends lib_pixelstreamingfrontend_ue5_5_1.PixelStre
23631
23633
  }
23632
23634
  if (!this._onWsClose) {
23633
23635
  this._onWsClose = (evt) => {
23634
- var _a, _b;
23635
- console.log(evt.code);
23636
- console.log(evt.reason);
23637
- const retryable = this.isRetryableClose(evt);
23638
- if (!retryable) {
23639
- // This stops the signaling client and shows the built-in "Play to reconnect" overlay
23640
- try {
23641
- (_b = (_a = this.webRtcController) === null || _a === void 0 ? void 0 : _a.closeSignalingServer) === null || _b === void 0 ? void 0 : _b.call(_a, evt.reason, false);
23642
- }
23643
- catch (_c) { }
23644
- // Optional: pause the transport watcher so we don't churn while idle
23645
- this.stopTransportWatcher();
23646
- }
23647
- else {
23648
- // Leave your existing auto-retry behavior for transient errors
23649
- this.startTransportWatcher(); // (in case it was stopped)
23650
- }
23651
23636
  // Bubble to your public close handler
23652
23637
  EventHandler_1.EventHandler.Emit(this.websocketOnCloseHandler, evt);
23653
23638
  };
@@ -23848,7 +23833,23 @@ class ArcwarePixelStreaming extends lib_pixelstreamingfrontend_ue5_5_1.PixelStre
23848
23833
  EventHandler_1.EventHandler.Emit(this.queueHandler, message);
23849
23834
  }
23850
23835
  onError(error) {
23836
+ var _a, _b;
23851
23837
  lib_pixelstreamingfrontend_ue5_5_1.Logger.Error(error.type);
23838
+ console.log(error);
23839
+ const retryable = this.isRetryableClose(error);
23840
+ if (!retryable) {
23841
+ // This stops the signaling client and shows the built-in "Play to reconnect" overlay
23842
+ try {
23843
+ (_b = (_a = this.webRtcController) === null || _a === void 0 ? void 0 : _a.closeSignalingServer) === null || _b === void 0 ? void 0 : _b.call(_a, error.reason, false);
23844
+ }
23845
+ catch (_c) { }
23846
+ // Optional: pause the transport watcher so we don't churn while idle
23847
+ this.stopTransportWatcher();
23848
+ }
23849
+ else {
23850
+ // Leave your existing auto-retry behavior for transient errors
23851
+ this.startTransportWatcher(); // (in case it was stopped)
23852
+ }
23852
23853
  EventHandler_1.EventHandler.Emit(this.errorHandler, error);
23853
23854
  }
23854
23855
  onLoveLetter(loveLetter) {
package/index.esm.js CHANGED
@@ -23428,7 +23428,7 @@ class ArcwareConfig extends _epicgames_ps_lib_pixelstreamingfrontend_ue5_5__WEBP
23428
23428
  if (!config.initialSettings.ss)
23429
23429
  config.initialSettings.ss = DefaultUrl;
23430
23430
  super(config);
23431
- this.VERSION = "1.3.7";
23431
+ this.VERSION = "1.3.8";
23432
23432
  this.settings = settings;
23433
23433
  this.session = new _domain_Session__WEBPACK_IMPORTED_MODULE_0__.Session();
23434
23434
  this._initialSettings = config.initialSettings;
@@ -23611,9 +23611,11 @@ class ArcwarePixelStreaming extends _epicgames_ps_lib_pixelstreamingfrontend_ue5
23611
23611
  this.resetInitGuardsAndHooks();
23612
23612
  }
23613
23613
  // Classify CloseEvent into retryable vs. legit (non-retryable)
23614
- isRetryableClose(evt) {
23614
+ isRetryableClose(err) {
23615
+ var _a, _b;
23615
23616
  //const reason = (evt.reason || "").toLowerCase();
23616
- if (evt.code >= 4000 /*||
23617
+ const code = (_b = (_a = err.code) !== null && _a !== void 0 ? _a : err.status) !== null && _b !== void 0 ? _b : err.errorCode;
23618
+ if (code >= 4000 /*||
23617
23619
  reason.includes("Stream disconnected.") ||
23618
23620
  reason.includes("forbidden") ||
23619
23621
  reason.includes("invalid token") ||
@@ -23656,23 +23658,6 @@ class ArcwarePixelStreaming extends _epicgames_ps_lib_pixelstreamingfrontend_ue5
23656
23658
  }
23657
23659
  if (!this._onWsClose) {
23658
23660
  this._onWsClose = (evt) => {
23659
- var _a, _b;
23660
- console.log(evt.code);
23661
- console.log(evt.reason);
23662
- const retryable = this.isRetryableClose(evt);
23663
- if (!retryable) {
23664
- // This stops the signaling client and shows the built-in "Play to reconnect" overlay
23665
- try {
23666
- (_b = (_a = this.webRtcController) === null || _a === void 0 ? void 0 : _a.closeSignalingServer) === null || _b === void 0 ? void 0 : _b.call(_a, evt.reason, false);
23667
- }
23668
- catch (_c) { }
23669
- // Optional: pause the transport watcher so we don't churn while idle
23670
- this.stopTransportWatcher();
23671
- }
23672
- else {
23673
- // Leave your existing auto-retry behavior for transient errors
23674
- this.startTransportWatcher(); // (in case it was stopped)
23675
- }
23676
23661
  // Bubble to your public close handler
23677
23662
  _domain_EventHandler__WEBPACK_IMPORTED_MODULE_5__.EventHandler.Emit(this.websocketOnCloseHandler, evt);
23678
23663
  };
@@ -23873,7 +23858,23 @@ class ArcwarePixelStreaming extends _epicgames_ps_lib_pixelstreamingfrontend_ue5
23873
23858
  _domain_EventHandler__WEBPACK_IMPORTED_MODULE_5__.EventHandler.Emit(this.queueHandler, message);
23874
23859
  }
23875
23860
  onError(error) {
23861
+ var _a, _b;
23876
23862
  _epicgames_ps_lib_pixelstreamingfrontend_ue5_5__WEBPACK_IMPORTED_MODULE_10__.Logger.Error(error.type);
23863
+ console.log(error);
23864
+ const retryable = this.isRetryableClose(error);
23865
+ if (!retryable) {
23866
+ // This stops the signaling client and shows the built-in "Play to reconnect" overlay
23867
+ try {
23868
+ (_b = (_a = this.webRtcController) === null || _a === void 0 ? void 0 : _a.closeSignalingServer) === null || _b === void 0 ? void 0 : _b.call(_a, error.reason, false);
23869
+ }
23870
+ catch (_c) { }
23871
+ // Optional: pause the transport watcher so we don't churn while idle
23872
+ this.stopTransportWatcher();
23873
+ }
23874
+ else {
23875
+ // Leave your existing auto-retry behavior for transient errors
23876
+ this.startTransportWatcher(); // (in case it was stopped)
23877
+ }
23877
23878
  _domain_EventHandler__WEBPACK_IMPORTED_MODULE_5__.EventHandler.Emit(this.errorHandler, error);
23878
23879
  }
23879
23880
  onLoveLetter(loveLetter) {
package/index.umd.js CHANGED
@@ -23430,7 +23430,7 @@ class ArcwareConfig extends lib_pixelstreamingfrontend_ue5_5_1.Config {
23430
23430
  if (!config.initialSettings.ss)
23431
23431
  config.initialSettings.ss = exports.DefaultUrl;
23432
23432
  super(config);
23433
- this.VERSION = "1.3.7";
23433
+ this.VERSION = "1.3.8";
23434
23434
  this.settings = settings;
23435
23435
  this.session = new Session_1.Session();
23436
23436
  this._initialSettings = config.initialSettings;
@@ -23596,9 +23596,11 @@ class ArcwarePixelStreaming extends lib_pixelstreamingfrontend_ue5_5_1.PixelStre
23596
23596
  this.resetInitGuardsAndHooks();
23597
23597
  }
23598
23598
  // Classify CloseEvent into retryable vs. legit (non-retryable)
23599
- isRetryableClose(evt) {
23599
+ isRetryableClose(err) {
23600
+ var _a, _b;
23600
23601
  //const reason = (evt.reason || "").toLowerCase();
23601
- if (evt.code >= 4000 /*||
23602
+ const code = (_b = (_a = err.code) !== null && _a !== void 0 ? _a : err.status) !== null && _b !== void 0 ? _b : err.errorCode;
23603
+ if (code >= 4000 /*||
23602
23604
  reason.includes("Stream disconnected.") ||
23603
23605
  reason.includes("forbidden") ||
23604
23606
  reason.includes("invalid token") ||
@@ -23641,23 +23643,6 @@ class ArcwarePixelStreaming extends lib_pixelstreamingfrontend_ue5_5_1.PixelStre
23641
23643
  }
23642
23644
  if (!this._onWsClose) {
23643
23645
  this._onWsClose = (evt) => {
23644
- var _a, _b;
23645
- console.log(evt.code);
23646
- console.log(evt.reason);
23647
- const retryable = this.isRetryableClose(evt);
23648
- if (!retryable) {
23649
- // This stops the signaling client and shows the built-in "Play to reconnect" overlay
23650
- try {
23651
- (_b = (_a = this.webRtcController) === null || _a === void 0 ? void 0 : _a.closeSignalingServer) === null || _b === void 0 ? void 0 : _b.call(_a, evt.reason, false);
23652
- }
23653
- catch (_c) { }
23654
- // Optional: pause the transport watcher so we don't churn while idle
23655
- this.stopTransportWatcher();
23656
- }
23657
- else {
23658
- // Leave your existing auto-retry behavior for transient errors
23659
- this.startTransportWatcher(); // (in case it was stopped)
23660
- }
23661
23646
  // Bubble to your public close handler
23662
23647
  EventHandler_1.EventHandler.Emit(this.websocketOnCloseHandler, evt);
23663
23648
  };
@@ -23858,7 +23843,23 @@ class ArcwarePixelStreaming extends lib_pixelstreamingfrontend_ue5_5_1.PixelStre
23858
23843
  EventHandler_1.EventHandler.Emit(this.queueHandler, message);
23859
23844
  }
23860
23845
  onError(error) {
23846
+ var _a, _b;
23861
23847
  lib_pixelstreamingfrontend_ue5_5_1.Logger.Error(error.type);
23848
+ console.log(error);
23849
+ const retryable = this.isRetryableClose(error);
23850
+ if (!retryable) {
23851
+ // This stops the signaling client and shows the built-in "Play to reconnect" overlay
23852
+ try {
23853
+ (_b = (_a = this.webRtcController) === null || _a === void 0 ? void 0 : _a.closeSignalingServer) === null || _b === void 0 ? void 0 : _b.call(_a, error.reason, false);
23854
+ }
23855
+ catch (_c) { }
23856
+ // Optional: pause the transport watcher so we don't churn while idle
23857
+ this.stopTransportWatcher();
23858
+ }
23859
+ else {
23860
+ // Leave your existing auto-retry behavior for transient errors
23861
+ this.startTransportWatcher(); // (in case it was stopped)
23862
+ }
23862
23863
  EventHandler_1.EventHandler.Emit(this.errorHandler, error);
23863
23864
  }
23864
23865
  onLoveLetter(loveLetter) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@arcware-cloud/pixelstreaming-websdk",
3
3
  "description": "WebSDK for easy implementation of pixel streaming with Arcware Cloud Services. Heavily based on the '@epicgames-ps' library.",
4
- "version": "1.3.7",
4
+ "version": "1.3.8",
5
5
  "type": "commonjs",
6
6
  "main": "./index.umd.js",
7
7
  "module": "./index.umd.js",
@@ -26,7 +26,7 @@ export declare class ArcwareConfig extends Config {
26
26
  readonly session: Session;
27
27
  readonly settings: Settings;
28
28
  private _initialSettings;
29
- readonly VERSION = "1.3.7";
29
+ readonly VERSION = "1.3.8";
30
30
  constructor(config: ArcwareConfigParams);
31
31
  /** Setup connection string. */
32
32
  get urlFlags(): string;