senza-sdk 4.4.10 → 4.4.11
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
|
@@ -17,9 +17,9 @@ import { DEFAULT_REMOTE_PLAYER_CONFIRMATION_TIMEOUT, remotePlayer } from "./remo
|
|
|
17
17
|
import {bus, Events} from "./eventBus";
|
|
18
18
|
|
|
19
19
|
// Default values for autoBackground settings. These values are used if the UIStreamer settings are not provided.
|
|
20
|
-
const DEFAULT_AUTO_BACKGROUND_VIDEO_DELAY = 10*60;
|
|
21
|
-
const DEFAULT_AUTO_BACKGROUND_UI_DELAY = 10*60;
|
|
22
|
-
const DEFAULT_AUTO_BACKGROUND_ENABLED = true;
|
|
20
|
+
export const DEFAULT_AUTO_BACKGROUND_VIDEO_DELAY = 10*60;
|
|
21
|
+
export const DEFAULT_AUTO_BACKGROUND_UI_DELAY = 10*60;
|
|
22
|
+
export const DEFAULT_AUTO_BACKGROUND_ENABLED = true;
|
|
23
23
|
// Default values for autoSuspend settings
|
|
24
24
|
const DEFAULT_AUTO_SUSPEND_ENABLED = false;
|
|
25
25
|
const DEFAULT_AUTO_SUSPEND_PLAYING_DELAY = 60;
|
|
@@ -260,6 +260,21 @@ class Lifecycle extends LifecycleInterface {
|
|
|
260
260
|
autoSuspend: uiStreamerSettings.autoSuspend
|
|
261
261
|
});
|
|
262
262
|
}
|
|
263
|
+
this._timersInit();
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* @private initialize timers based on current configuration
|
|
269
|
+
*/
|
|
270
|
+
_timersInit() {
|
|
271
|
+
// Start background countdown if auto background is enabled and in foreground
|
|
272
|
+
if (this._isAutoBackgroundEnabled() && this._isForegroundOrTransitioning()) {
|
|
273
|
+
this._startCountdown();
|
|
274
|
+
}
|
|
275
|
+
// start suspend countdown if auto suspend is enabled and in background
|
|
276
|
+
if (this._isAutoSuspendEnabled() && this._state === this.UiState.BACKGROUND) {
|
|
277
|
+
this._startSuspendCountdown();
|
|
263
278
|
}
|
|
264
279
|
}
|
|
265
280
|
|
|
@@ -597,7 +612,7 @@ class Lifecycle extends LifecycleInterface {
|
|
|
597
612
|
if (timeoutDelay > 0) {
|
|
598
613
|
sdkLogger.debug("Starting countdown timeout", timeoutDelay, isPlaying ? "(video)" : "(UI)");
|
|
599
614
|
this._countdown = setTimeout(() => {
|
|
600
|
-
sdkLogger.
|
|
615
|
+
sdkLogger.info("Countdown timeout reached, moving to background");
|
|
601
616
|
this.moveToBackground(true);
|
|
602
617
|
}, timeoutDelay * 1000);
|
|
603
618
|
} else {
|
|
@@ -254,6 +254,13 @@ class RemotePlayer extends RemotePlayerInterface {
|
|
|
254
254
|
typeof document !== "undefined" && document.addEventListener("hs/ui_inactive", () => {
|
|
255
255
|
/* istanbul ignore next */
|
|
256
256
|
sdkLogger.info("Got hs/ui_inactive event");
|
|
257
|
+
|
|
258
|
+
// this logic is specific for customers that use autoTune. When a playback session is auto tuned, we do not need the guard time before releasing the UI
|
|
259
|
+
// calling moveToSuspended right away, will release the UI faster.
|
|
260
|
+
if (this._isPlaying && this._autoTune) {
|
|
261
|
+
sdkLogger.info("Moving to suspended state, in autoTune playback, due to ui_inactive event");
|
|
262
|
+
lifecycle.moveToSuspended();
|
|
263
|
+
}
|
|
257
264
|
});
|
|
258
265
|
typeof document !== "undefined" && document.addEventListener("hs/senzaPlayerSetRate", (event) => {
|
|
259
266
|
if (!this._videoElement) return;
|
|
@@ -110,7 +110,7 @@ export class RemotePlayerError extends Error {
|
|
|
110
110
|
* | 3403 | Player | Problem accessing segments, server authentication issue |
|
|
111
111
|
* | 3404 | Player | Problem accessing segments, server returned not found |
|
|
112
112
|
* | 3900-3999 | Player | Internal player error |
|
|
113
|
-
* | 6000 | Player | The remote player api call has reached
|
|
113
|
+
* | 6000 | Player | The remote player api call has reached a timeout with no response from the remote player |
|
|
114
114
|
* | 6001 | Player | play() was called while the remote player is not loaded |
|
|
115
115
|
* | 6002 | Player | load() was called while the application was in state 'background' or 'inTransitionToBackground' |
|
|
116
116
|
* | 6500 | Player | remotePlayer api was called before initializing remotePlayer |
|
package/src/interface/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = "4.4.
|
|
1
|
+
export const version = "4.4.11";
|