senza-sdk 4.4.0 → 4.4.1-daf0312.0

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.4.0",
3
+ "version": "4.4.1-daf0312.0",
4
4
  "main": "./src/api.js",
5
5
  "description": "API for Senza application",
6
6
  "license": "MIT",
@@ -313,7 +313,7 @@ class Lifecycle extends LifecycleInterface {
313
313
  this._inTransition = true;
314
314
  return new Promise((resolve, reject) => {
315
315
  const FCID = getFCID();
316
- const request = { target: "TC", waitForResponse: false, internalAction: "uiExit", message: JSON.stringify({ type: "uiStandbyRequest", fcid: FCID }) };
316
+ const request = { target: "TC", waitForResponse: false, internalAction: "uiExit", message: JSON.stringify({ type: "uiStandbyRequest", autoPlay: remotePlayer._autoPlay, fcid: FCID }) };
317
317
  const logger = sdkLogger.withFields({ FCID });
318
318
  logger.log("lifecycle moveToUiStandby: sending uiStandbyRequest");
319
319
  window.cefQuery({
@@ -555,6 +555,7 @@ class Lifecycle extends LifecycleInterface {
555
555
  message.class = "remotePlayer";
556
556
  message.switchMode = remotePlayer._isAudioSyncEnabled() ? SwitchMode.SEAMLESS : SwitchMode.NON_SEAMLESS;
557
557
  message.streamType = remotePlayer.textTrackVisibility ? (StreamType.AUDIO | StreamType.VIDEO | StreamType.SUBTITLE) : (StreamType.AUDIO | StreamType.VIDEO);
558
+ message.autoPlay = remotePlayer._autoPlay;
558
559
  request = {
559
560
  target: "TC",
560
561
  waitForResponse: true,
@@ -180,6 +180,7 @@ class RemotePlayer extends RemotePlayerInterface {
180
180
  }
181
181
  }
182
182
  this._loadMode = playerState?.isLoaded ? this.LoadMode.LOADED : this.LoadMode.NOT_LOADED;
183
+ this._autoPlay = false;
183
184
 
184
185
  this._isPlaying = window?.sessionStorage?.getItem("senzaSdk_isPlaying") === "true";
185
186
 
@@ -922,7 +923,7 @@ class RemotePlayer extends RemotePlayerInterface {
922
923
  * @returns {Promise}
923
924
  * @throws {RemotePlayerError} error object contains code & msg
924
925
  */
925
- play() {
926
+ play(autoPlay = false) {
926
927
  if (!this._isInitialized) {
927
928
  throw new RemotePlayerError(6500, "Cannot call play() if remote player is not initialized");
928
929
  }
@@ -933,6 +934,7 @@ class RemotePlayer extends RemotePlayerInterface {
933
934
  }
934
935
 
935
936
  this._changePlayMode(true);
937
+ this._autoPlay = autoPlay;
936
938
 
937
939
  if (this._isSetAudioInProgress) {
938
940
  sdkLogger.info("application requesting play during setAudioLanguage");
@@ -280,8 +280,8 @@ class RemotePlayer extends EventTarget {
280
280
  * @returns {Promise}
281
281
  * @throws {RemotePlayerError} error object contains code & msg
282
282
  */
283
- async play() {
284
- return noop("RemotePlayer.play");
283
+ async play(autoPlay = false) {
284
+ return noop("RemotePlayer.play", autoPlay);
285
285
  }
286
286
 
287
287
  /** Pauses the currently playing audio or video
@@ -1 +1 @@
1
- export const version = "4.4.0";
1
+ export const version = "4.4.1-daf0312.0";