senza-sdk 4.2.39-d033ed2.0 → 4.2.39

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.2.39-d033ed2.0",
3
+ "version": "4.2.39",
4
4
  "main": "./src/api.js",
5
5
  "description": "API for Senza application",
6
6
  "license": "MIT",
@@ -21,9 +21,12 @@
21
21
  "@babel/core": "7.18.6",
22
22
  "@babel/plugin-transform-modules-commonjs": "^7.16.8",
23
23
  "@babel/preset-env": "^7.14.1",
24
+ "@eslint/eslintrc": "^3.3.0",
25
+ "@eslint/js": "^9.22.0",
24
26
  "babel-jest": "^27.5.1",
25
- "eslint": "^8.40.0",
26
- "eslint-plugin-jest": "^26.1.1",
27
+ "eslint": "^9.22.0",
28
+ "eslint-plugin-jest": "^28.11.0",
29
+ "globals": "^16.0.0",
27
30
  "jest": "^27.5.1",
28
31
  "jsdoc-to-markdown": "^7.1.1",
29
32
  "webpack": "^5.72.1",
@@ -7,7 +7,7 @@ class SessionInfo {
7
7
  try {
8
8
  return JSON.parse(this.sessionInfoStr);
9
9
  } catch (e) {
10
- sdkLogger.warn("Failed to return sdk");
10
+ sdkLogger.warn("Failed to parse sessionInfo " + e.message);
11
11
  return undefined;
12
12
  }
13
13
 
@@ -16,7 +16,7 @@ class SessionInfo {
16
16
  try {
17
17
  JSON.parse(objStr); // Performing parse just as a validation that this is a valid json
18
18
  } catch (e) {
19
- throw Error("Failed to parse sessionInfo");
19
+ throw Error("Failed to parse sessionInfo " + e.message);
20
20
  }
21
21
 
22
22
  this.sessionInfoStr = objStr;
package/src/api.js CHANGED
@@ -484,7 +484,7 @@ export function getClientAssertion() {
484
484
  sdkLogger.log(`client_assertion request successfully returned ${response}`);
485
485
  resolve(json_response);
486
486
  } catch (e) {
487
- sdkLogger.error(`Failed to parse client assertion ${response}`);
487
+ sdkLogger.error(`Failed to parse client assertion ${response}: ${e.message}`);
488
488
  reject(new ClientAssertionError(0, "Failed to parse client assertion"));
489
489
  }
490
490
 
@@ -74,6 +74,7 @@ class DeviceManager extends EventTarget {
74
74
  * @property {string} DeviceInfo.tenant
75
75
  * @property {string} DeviceInfo.clientIp
76
76
  * @property {string} DeviceInfo.countryCode A 2-letter code as defined in ISO_3166-1
77
+ * @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.
77
78
  */
78
79
  get deviceInfo() {
79
80
  const sessionInfoObj = sessionInfo.sessionInfoObj;
@@ -84,7 +85,8 @@ class DeviceManager extends EventTarget {
84
85
  community: sessionInfoObj.community,
85
86
  tenant: sessionInfoObj.tenant,
86
87
  clientIp: sessionInfoObj.clientIp,
87
- countryCode: sessionInfoObj.general?.location?.["x-country-code"]
88
+ countryCode: sessionInfoObj.general?.location?.["x-country-code"],
89
+ connectionType: (!sessionInfoObj.connectionType || sessionInfoObj.connectionType === "direct") ? "device" : sessionInfoObj.connectionType
88
90
  };
89
91
  }
90
92
  sdkLogger.log("getDeviceInfo running locally, returning dummy info");
@@ -94,7 +96,8 @@ class DeviceManager extends EventTarget {
94
96
  community: "LocalDev",
95
97
  tenant: "XXXXXX",
96
98
  clientIp: "0.0.0.0",
97
- countryCode: "XX"
99
+ countryCode: "XX",
100
+ connectionType: "simulator"
98
101
  };
99
102
  }
100
103
 
@@ -45,7 +45,7 @@ function getPlaybackInfo() {
45
45
  try {
46
46
  playbackInfo = JSON.parse(playbackInfoStr);
47
47
  } catch (e) {
48
- sdkLogger.error(`Playback Info parse failed. playbackStr = ${playbackInfoStr}`);
48
+ sdkLogger.error(`Playback Info parse failed. playbackStr = ${playbackInfoStr} error = ${e.message}`);
49
49
  playbackInfo = { playbackPosition: 0, assetDuration: 0 };
50
50
  }
51
51
 
@@ -59,7 +59,7 @@ function setPlaybackInfo(playbackInfo) {
59
59
  window.setPlaybackInfo(playbackInfoStr);
60
60
  }
61
61
  } catch (e) {
62
- sdkLogger.error("Playback Info to json string failed");
62
+ sdkLogger.error("Playback Info to json string failed: ", e.message);
63
63
  }
64
64
  }
65
65
 
@@ -859,10 +859,11 @@ class RemotePlayer extends EventTarget {
859
859
  * @param {string} url url to load
860
860
  * @param {number} [position] start position in seconds (if not provided, start from beginning (VOD) or current time (LTV))
861
861
  * @param {string} [audioTrackId] audio track ID to use for loading with this url
862
- * @param {string} [textTrackId] audio track ID to use for loading with this url
862
+ * @param {string} [textTrackId] text track ID to use for loading with this url
863
863
  * @param {boolean} [reset] whether the payer should reset its internal data before calling load
864
864
  * @returns {Promise}
865
865
  * @throws {RemotePlayerError} error object contains code & msg
866
+ * @private
866
867
  *
867
868
  * */
868
869