senza-sdk 4.5.3 → 4.5.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "senza-sdk",
3
- "version": "4.5.3",
3
+ "version": "4.5.4",
4
4
  "main": "./src/api.js",
5
5
  "description": "API for Senza application",
6
6
  "license": "MIT",
@@ -22,6 +22,8 @@ const OVERLAY_CAPTURE_PRESETS = {
22
22
 
23
23
  const DEFAULT_CAPTURE_PRESET = "default";
24
24
  const VALID_QUALITIES = new Set(["low", "mid", "high"]);
25
+ const DEFAULT_AUTO_HIDE_DURATION_SEC = 600;
26
+ const OVERLAY_DURATION_SEC_MAX = 65535;
25
27
 
26
28
  class Overlay extends OverlayInterface {
27
29
  constructor() {
@@ -31,7 +33,8 @@ class Overlay extends OverlayInterface {
31
33
  this._configuration = {
32
34
  useTransparency: true,
33
35
  overlayCapturePreset: DEFAULT_CAPTURE_PRESET,
34
- overlayCapturePlan: null
36
+ overlayCapturePlan: null,
37
+ autoHideDurationSec: DEFAULT_AUTO_HIDE_DURATION_SEC
35
38
  };
36
39
  this._activeCapturePlan = OVERLAY_CAPTURE_PRESETS[DEFAULT_CAPTURE_PRESET];
37
40
  this._retryGeneration = 0;
@@ -138,6 +141,7 @@ class Overlay extends OverlayInterface {
138
141
  quality,
139
142
  conditional
140
143
  };
144
+ message.overlayDurationSec = this._configuration.autoHideDurationSec;
141
145
  sdkLogger.log(`Overlay: rendering frame x=${x} y=${y} width=${width} height=${height} fcid=${FCID} (batchId=${batchId}, quality=${quality}, conditional=${conditional})`);
142
146
  const request = { target: "UI-Streamer", waitForResponse: false, message: JSON.stringify(message) };
143
147
  window.cefQuery({
@@ -226,6 +230,16 @@ class Overlay extends OverlayInterface {
226
230
  }
227
231
  }
228
232
 
233
+ if (Object.prototype.hasOwnProperty.call(normalizedConfiguration, "autoHideDurationSec")) {
234
+ const duration = normalizedConfiguration.autoHideDurationSec;
235
+ if (Number.isInteger(duration) && duration >= 0 && duration <= OVERLAY_DURATION_SEC_MAX) {
236
+ normalizedConfiguration.autoHideDurationSec = duration;
237
+ } else {
238
+ sdkLogger.warn(`Overlay: invalid autoHideDurationSec "${duration}", keeping previous value`);
239
+ delete normalizedConfiguration.autoHideDurationSec;
240
+ }
241
+ }
242
+
229
243
  this._configuration = { ...this._configuration, ...normalizedConfiguration };
230
244
  this._activeCapturePlan = this._resolveCapturePlan();
231
245
  }
@@ -59,8 +59,8 @@ class Overlay extends EventTarget {
59
59
  }
60
60
 
61
61
  /**
62
- * Removes all registered elements, sends a zero-dimension frame to the UI-Streamer,
63
- * and deactivates the overlay. After calling removeAllElements(), a new element can be registered.
62
+ * Removes all registered elements and deactivates the overlay.
63
+ * After calling removeAllElements(), a new element can be registered.
64
64
  *
65
65
  * @returns {Promise<boolean>} Resolves to true if successful, rejects with error if failed.
66
66
  */
@@ -82,7 +82,7 @@ class Overlay extends EventTarget {
82
82
  *
83
83
  * @param {Object} configuration - The new configuration to apply.
84
84
  * @param {boolean} [configuration.useTransparency=true] - Controls whether the overlay should be rendered with transparency.
85
- * When set to `true`, the value is forwarded to UI-Streamer in `displayOverlay` requests.
85
+ * When set to `true`, the overlay is rendered with transparency.
86
86
  * @param {string} [configuration.overlayCapturePreset="default"] - Named capture plan preset:
87
87
  * `default` (progressive low→high captures) or `once` (one immediate high-quality conditional step).
88
88
  * @param {Array<{quality: "low"|"mid"|"high", conditional: boolean, delay: number}>} [configuration.overlayCapturePlan]
@@ -90,6 +90,9 @@ class Overlay extends EventTarget {
90
90
  * the previous step in the batch. Set `conditional` per step (the SDK does not derive it):
91
91
  * when `true`, capture only if overlay content changed since the last required (non-conditional)
92
92
  * capture in this batch; when `false`, always capture on that step.
93
+ * @param {number} [configuration.autoHideDurationSec=600] - Client auto-hide duration in seconds.
94
+ * Defaults to `600` (10 minutes) until configured. Omit the key to keep the current value.
95
+ * `0` means never auto-hide. Valid range: `0`–`65535`.
93
96
  */
94
97
  configure(configuration) {
95
98
  noop(configuration);
@@ -1 +1 @@
1
- export const version = "4.5.3";
1
+ export const version = "4.5.4";