senza-sdk 4.3.6 → 4.4.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.3.6",
3
+ "version": "4.4.0",
4
4
  "main": "./src/api.js",
5
5
  "description": "API for Senza application",
6
6
  "license": "MIT",
@@ -54,9 +54,9 @@
54
54
  },
55
55
  "src/interface": {
56
56
  "branches": 68.42,
57
- "functions": 39.63,
57
+ "functions": 39.63,
58
58
  "lines": 64.94,
59
- "statements": 65.32
59
+ "statements": 65.32
60
60
  }
61
61
  }
62
62
  },
package/src/api.js CHANGED
@@ -370,31 +370,6 @@ export function setTimezone(timezone) {
370
370
  }
371
371
  }
372
372
 
373
- /**
374
- * @deprecated use deviceManager.deviceInfo instead.
375
- * Returns the device information, including device id, connection id, community, tenant and client ip
376
- * */
377
- export function getDeviceInfo() {
378
- // STOP DO NOT CHANGE THIS FUNCTION AS IT IS DEPRECATED!!!!
379
- if (isRunningE2E()) {
380
- return {
381
- deviceId: deviceManager.deviceInfo.deviceId,
382
- connectionId: deviceManager.deviceInfo.connectionId,
383
- community: deviceManager.deviceInfo.community,
384
- tenant: deviceManager.deviceInfo.tenant,
385
- clientIp: deviceManager.deviceInfo.clientIp
386
- };
387
- }
388
- sdkLogger.log("getDeviceInfo running locally, returning dummy info");
389
- return {
390
- deviceId: "123456789",
391
- connectionId: "dummy",
392
- community: "LocalDev",
393
- tenant: "XXXXXX",
394
- clientIp: "0.0.0.0"
395
- };
396
- }
397
-
398
373
  export { lifecycle, remotePlayer, alarmManager, deviceManager, platformManager, messageManager, ShakaPlayerImplementation as ShakaPlayer, shakaImplementation as shaka, showSequence, initSequence };
399
374
 
400
375
  // Assign the senza library to the old name (hs) for backward compatibility
@@ -63,21 +63,21 @@ class AlarmManager extends AlarmManagerInterface {
63
63
  const alarmHandlingDuration = Date.now() - timeBeforeAlarmHandling;
64
64
  logger.log(`All callbacks for alarm '${e.detail.alarmName}' are finished within ${alarmHandlingDuration}ms`);
65
65
  // If this alarm triggered the application, and moveToForeground has not been called as a result of the alarm
66
- // (i.e. the application is still in the background), we want to intentionally terminate the ui in order to save resources.
66
+ // (i.e. the application is still in the background), we want to intentionally disconnect the ui in order to save resources.
67
67
  const isTriggering = lifecycle.triggerEvent.type === "alarmFiredEvent" && lifecycle._triggerEventFcid && lifecycle._triggerEventFcid === e.detail.fcid;
68
68
  if (isTriggering) {
69
69
  if (!this._moveToForegroundHasBeenCalled && window.cefQuery) {
70
- logger.log("Application is about to be terminated since didn't move to foreground");
71
- const message = { type: "terminating" };
70
+ logger.log("Application is about to be disconnected since didn't move to foreground");
71
+ const message = { type: "disconnect" };
72
72
  const request = { target: "TC", waitForResponse: false, message: JSON.stringify(message) };
73
73
  window.cefQuery({
74
74
  request: JSON.stringify(request),
75
75
  persistent: false,
76
76
  onSuccess: () => {
77
- logger.log("terminating request successfully sent");
77
+ logger.log("disconnect request successfully sent");
78
78
  },
79
79
  onFailure: (code, msg) => {
80
- logger.error(`terminating request failed: ${code} ${msg}`);
80
+ logger.error(`disconnect request failed: ${code} ${msg}`);
81
81
  }
82
82
  });
83
83
  }
@@ -192,7 +192,7 @@ class Lifecycle extends LifecycleInterface {
192
192
  // Use the event manager to dispatch the event and wait for all listeners
193
193
  await this._eventManager.dispatch("userdisconnected", event);
194
194
 
195
- this._sendTerminatingMessage();
195
+ this._sendDisconnectMessage();
196
196
  });
197
197
 
198
198
  typeof document !== "undefined" && document.addEventListener("keydown", () => {
@@ -777,14 +777,14 @@ class Lifecycle extends LifecycleInterface {
777
777
  }
778
778
 
779
779
  /**
780
- * Sends the terminating message to the platform
780
+ * Sends the disconnect message to the platform
781
781
  * @private
782
782
  */
783
- _sendTerminatingMessage() {
783
+ _sendDisconnectMessage() {
784
784
  if (window.cefQuery) {
785
785
  const FCID = getFCID();
786
786
  const message = {
787
- type: "terminating",
787
+ type: "disconnect",
788
788
  fcid: FCID
789
789
  };
790
790
  const request = { target: "TC", waitForResponse: false, message: JSON.stringify(message) };
@@ -793,10 +793,10 @@ class Lifecycle extends LifecycleInterface {
793
793
  request: JSON.stringify(request),
794
794
  persistent: false,
795
795
  onSuccess: () => {
796
- sdkLogger.log("Terminating signal sent after userdisconnected event was processed");
796
+ sdkLogger.log("Disconnect signal sent after userdisconnected event was processed");
797
797
  },
798
798
  onFailure: (code, msg) => {
799
- sdkLogger.error(`Failed to send terminating signal: ${code} ${msg}`);
799
+ sdkLogger.error(`Failed to send disconnect signal: ${code} ${msg}`);
800
800
  }
801
801
  });
802
802
  }
@@ -16,7 +16,7 @@ export class DeviceManager extends EventTarget {
16
16
  * @property {string} DeviceInfo.connectionType The type of device used during the current connection. Possible values are "device" which mean real device, "simulator" - simulated device - that used during development.
17
17
  */
18
18
  get deviceInfo() {
19
- sdkLogger.log("getDeviceInfo running locally, returning dummy info");
19
+ sdkLogger.log("get of deviceInfo running locally, returning dummy info");
20
20
  return {
21
21
  deviceId: "123456789",
22
22
  modelNumber: "ABC",
@@ -1 +1 @@
1
- export const version = "4.3.6";
1
+ export const version = "4.4.0";