@24i/bigscreen-sdk 1.0.50 → 1.0.51-alpha.2783

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": "@24i/bigscreen-sdk",
3
- "version": "1.0.50",
3
+ "version": "1.0.51-alpha.2783",
4
4
  "description": "SmartApps BIGscreen SDK monorepo",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -4,6 +4,7 @@ import {
4
4
  ScreenSaverStatus,
5
5
  VolumeRange,
6
6
  } from '@24i/bigscreen-sdk/driver-base';
7
+ import { generateUuid } from '@24i/bigscreen-sdk/utils';
7
8
  import { IJavaScriptBridge, DeviceInfo } from './types';
8
9
  import { getFirmware } from './formatUserAgent';
9
10
  import { getKeyMap, AndroidKeyMap } from './keymap';
@@ -162,6 +163,13 @@ export class DeviceAndroidTV extends DeviceBase {
162
163
  return this.getBaseUuid();
163
164
  }
164
165
 
166
+ async getAdInfo() {
167
+ const adId = generateUuid();
168
+ const type = 'sessionid';
169
+ const latEnabled = null;
170
+ return { adId, type, latEnabled };
171
+ }
172
+
165
173
  async getVolume(): Promise<number> {
166
174
  return VolumeRange.UNSUPPORTED;
167
175
  }
@@ -13,6 +13,7 @@ export const mockJavaScriptBridge: IJavaScriptBridge = {
13
13
  ipLocal: '127.0.0.1',
14
14
  })
15
15
  ),
16
+ bridgeJavaScriptToAndroid_GetMediaInfo: () => '{}',
16
17
  bridgeJavaScriptToAndroid_Back: () => {},
17
18
  bridgeJavaScriptToAndroid_StopVideo: () => {},
18
19
  bridgeJavaScriptToAndroid_FullScreenVideo: () => {},
@@ -7,6 +7,10 @@ interface JavaScriptBridge {
7
7
  * "ipLocal": "fe80::475:3045:2928:3a32%wlan0127.0.0.1", "appVersion": '0.0.1' }'
8
8
  */
9
9
  bridgeJavaScriptToAndroid_GetDeviceInfo: () => string,
10
+ /**
11
+ * It returns media info including statistics
12
+ */
13
+ bridgeJavaScriptToAndroid_GetMediaInfo: () => string;
10
14
  /**
11
15
  * It simulates a native Android back press.
12
16
  */
@@ -8,6 +8,7 @@ import { ScreenSize } from './ScreenSize';
8
8
  import { VolumeRange } from './VolumeRange';
9
9
  import { KeycodeKeyMap } from './types/KeycodeKeyMap';
10
10
  import { DeviceEventMap } from './types/DeviceEvent';
11
+ import { AdInfo } from './types/AdInfo';
11
12
  import { ScreenSaverStatus } from './types/ScreenSaverStatus';
12
13
  import { ExitOptions } from './types/ExitOptions';
13
14
  import { inRange } from './utils';
@@ -152,6 +153,8 @@ export abstract class DeviceBase<
152
153
 
153
154
  abstract getUuid(): Promise<string>;
154
155
 
156
+ abstract getAdInfo(): Promise<AdInfo>;
157
+
155
158
  abstract getVolume(): Promise<number>;
156
159
 
157
160
  abstract setVolume(volumePercentage: number): Promise<void>;
@@ -53,6 +53,13 @@ export class DeviceBase extends AbstractDeviceBase {
53
53
  return this.getBaseUuid();
54
54
  }
55
55
 
56
+ async getAdInfo() {
57
+ const adId = 'uuid';
58
+ const type = 'id type';
59
+ const latEnabled = null;
60
+ return { adId, type, latEnabled };
61
+ }
62
+
56
63
  async getVolume() {
57
64
  return this.volume;
58
65
  }
@@ -0,0 +1,5 @@
1
+ export type AdInfo = {
2
+ adId: string | null;
3
+ type: string;
4
+ latEnabled: boolean | null;
5
+ };
@@ -2,6 +2,7 @@ import {
2
2
  DeviceBase, ConnectionType, ScreenSaverStatus, VolumeRange,
3
3
  } from '@24i/bigscreen-sdk/driver-base';
4
4
  import { runAsync } from '@24i/bigscreen-sdk/utils/timers';
5
+ import { generateUuid } from '@24i/bigscreen-sdk/utils';
5
6
  import { getKeyMap } from './keymap';
6
7
  import { patchSuitestKeys } from './patchSuitestKeys';
7
8
  import { getBrowser } from './getBrowser';
@@ -114,6 +115,13 @@ export class DeviceBrowser extends DeviceBase {
114
115
  return this.getBaseUuid();
115
116
  }
116
117
 
118
+ async getAdInfo() {
119
+ const adId = generateUuid();
120
+ const type = 'sessionid';
121
+ const latEnabled = null;
122
+ return { adId, type, latEnabled };
123
+ }
124
+
117
125
  async getVolume() {
118
126
  return this.volume;
119
127
  }
@@ -1,4 +1,5 @@
1
1
  import { DeviceBase, ScreenSaverStatus, VolumeRange } from '@24i/bigscreen-sdk/driver-base';
2
+ import { generateUuid } from '@24i/bigscreen-sdk/utils';
2
3
  import { getKeyMap } from './keymap';
3
4
  import { EntoneDeviceModelName } from './constants';
4
5
  import { IEntone, NetworkEvent } from './IEntone';
@@ -120,6 +121,13 @@ export class DeviceEntone extends DeviceBase {
120
121
  return '';
121
122
  }
122
123
 
124
+ async getAdInfo() {
125
+ const adId = generateUuid();
126
+ const type = 'sessionid';
127
+ const latEnabled = null;
128
+ return { adId, type, latEnabled };
129
+ }
130
+
123
131
  async getVolume() {
124
132
  try {
125
133
  const { leftVolPercentage, rightVolPercentage } = ENTONE.stb.getAudioVolume();
@@ -13,6 +13,7 @@ export const mockJavaScriptBridge: IJavaScriptBridge = {
13
13
  ipLocal: '127.0.0.1',
14
14
  })
15
15
  ),
16
+ bridgeJavaScriptToAndroid_GetMediaInfo: () => '{}',
16
17
  bridgeJavaScriptToAndroid_Back: () => {},
17
18
  bridgeJavaScriptToAndroid_StopVideo: () => {},
18
19
  bridgeJavaScriptToAndroid_FullScreenVideo: () => {},
@@ -1,6 +1,7 @@
1
1
  import {
2
2
  DeviceBase, ConnectionType, ScreenSaverStatus, loadObject, VolumeRange,
3
3
  } from '@24i/bigscreen-sdk/driver-base';
4
+ import { generateUuid } from '@24i/bigscreen-sdk/utils';
4
5
  import { getKeyMap } from './keymap';
5
6
  import { getVersion } from './getVersion';
6
7
  import { getDeviceInfo } from './deviceInfo';
@@ -245,6 +246,13 @@ export class DeviceHbbTV extends DeviceBase {
245
246
  return this.getBaseUuid();
246
247
  }
247
248
 
249
+ async getAdInfo() {
250
+ const adId = generateUuid();
251
+ const type = 'sessionid';
252
+ const latEnabled = null;
253
+ return { adId, type, latEnabled };
254
+ }
255
+
248
256
  async getVolume() {
249
257
  // TODO: not yet implemented
250
258
  return VolumeRange.UNSUPPORTED;
@@ -4,6 +4,7 @@ import {
4
4
  ScreenSaverStatus,
5
5
  VolumeRange,
6
6
  } from '@24i/bigscreen-sdk/driver-base';
7
+ import { generateUuid } from '@24i/bigscreen-sdk/utils';
7
8
  import { getKeyMap } from './keymap';
8
9
  import { toi2 } from './toi2';
9
10
  import { toi3 } from './toi3';
@@ -159,6 +160,13 @@ export class DeviceKreaTV extends DeviceBase {
159
160
  return '';
160
161
  }
161
162
 
163
+ async getAdInfo() {
164
+ const adId = generateUuid();
165
+ const type = 'sessionid';
166
+ const latEnabled = null;
167
+ return { adId, type, latEnabled };
168
+ }
169
+
162
170
  getSupportedAudioConnections() {
163
171
  const { audioOutputService } = this.toiInstance;
164
172
  const { ToiAudioOutputService } = this.toiInstance.consts;
@@ -4,6 +4,7 @@ import {
4
4
  ScreenSaverStatus,
5
5
  VolumeRange,
6
6
  } from '@24i/bigscreen-sdk/driver-base';
7
+ import { generateUuid } from '@24i/bigscreen-sdk/utils';
7
8
  import { getDeviceInfo, getFirmware, getPlatformInfo } from './formatUserAgent';
8
9
  import { ISmartTvAApi } from './types';
9
10
  import { getKeyMap } from './keymap';
@@ -81,6 +82,13 @@ export class DeviceSaphi extends DeviceBase {
81
82
  return this.getBaseUuid();
82
83
  }
83
84
 
85
+ async getAdInfo() {
86
+ const adId = generateUuid();
87
+ const type = 'sessionid';
88
+ const latEnabled = null;
89
+ return { adId, type, latEnabled };
90
+ }
91
+
84
92
  async getVolume(): Promise<number> {
85
93
  return VolumeRange.UNSUPPORTED;
86
94
  }
@@ -265,6 +265,13 @@ export class DeviceSmartCast extends DeviceBase {
265
265
  return this.deviceId;
266
266
  }
267
267
 
268
+ async getAdInfo() {
269
+ const adId = this.IFA?.IFA ?? null;
270
+ const type = this.IFA?.IFA_TYPE ?? 'vida';
271
+ const latEnabled = this.IFA?.LMT ?? true;
272
+ return { adId, type, latEnabled };
273
+ }
274
+
268
275
  async getVolume() {
269
276
  return VolumeRange.UNSUPPORTED;
270
277
  }
@@ -197,6 +197,19 @@ export class DeviceTizen extends DeviceBase {
197
197
  return '';
198
198
  }
199
199
 
200
+ async getAdInfo() {
201
+ let adId = null;
202
+ let latEnabled = null;
203
+ const type = 'tifa';
204
+ try {
205
+ adId = webapis.adinfo.getTIFA() ?? null;
206
+ latEnabled = webapis.adinfo.isLATEnabled() ?? true;
207
+ } catch (e) {
208
+ console.error('[DeviceTizen] Failed getAdInfo', e);
209
+ }
210
+ return { adId, type, latEnabled };
211
+ }
212
+
200
213
  async getVolume() {
201
214
  try {
202
215
  const volume = tizen.tvaudiocontrol.getVolume();
@@ -88,8 +88,15 @@ export type AppCommon = {
88
88
  ) => void,
89
89
  };
90
90
 
91
+ export type AdInfo = {
92
+ getVersion: () => string,
93
+ getTIFA: () => string,
94
+ isLATEnabled: () => boolean,
95
+ };
96
+
91
97
  export interface IWebapis {
92
98
  productinfo: ProductInfo,
93
99
  network: Network,
94
100
  appCommon: AppCommon,
101
+ adinfo: AdInfo,
95
102
  }
@@ -8,6 +8,10 @@ export const webapis = {
8
8
  getModelCode: () => 'model code',
9
9
  getFirmware: () => 'firmware',
10
10
  },
11
+ adinfo: {
12
+ getTIFA: () => 'adid',
13
+ isLATEnabled: () => true,
14
+ },
11
15
  };
12
16
 
13
17
  export const application = {
@@ -4,6 +4,7 @@ import {
4
4
  ScreenSaverStatus,
5
5
  VolumeRange,
6
6
  } from '@24i/bigscreen-sdk/driver-base';
7
+ import { generateUuid } from '@24i/bigscreen-sdk/utils';
7
8
  import { NetworkConnectionTypeMap } from './constants';
8
9
  import { getPlatformInfo } from './formatUserAgent';
9
10
  import { HisenseVidaaApi } from './types';
@@ -80,6 +81,13 @@ export class DeviceVidaa extends DeviceBase {
80
81
  return window.Hisense_GetDeviceID() || '';
81
82
  }
82
83
 
84
+ async getAdInfo() {
85
+ const adId = generateUuid();
86
+ const type = 'sessionid';
87
+ const latEnabled = null;
88
+ return { adId, type, latEnabled };
89
+ }
90
+
83
91
  async getVolume(): Promise<number> {
84
92
  return VolumeRange.UNSUPPORTED;
85
93
  }
@@ -245,6 +245,13 @@ export class DeviceWebos extends DeviceBase {
245
245
  return this.duid!;
246
246
  }
247
247
 
248
+ async getAdInfo() {
249
+ const adId = await this.getLgDeviceId() ?? null;
250
+ const type = 'lgudid';
251
+ const latEnabled = null;
252
+ return { adId, type, latEnabled };
253
+ }
254
+
248
255
  async getVolume() {
249
256
  // TODO: not yet implemented
250
257
  return VolumeRange.UNSUPPORTED;
@@ -152,6 +152,13 @@ export class DeviceXbox extends DeviceBase {
152
152
  return uuid;
153
153
  }
154
154
 
155
+ async getAdInfo() {
156
+ const adId = generateUuid();
157
+ const type = 'sessionid';
158
+ const latEnabled = null;
159
+ return { adId, type, latEnabled };
160
+ }
161
+
155
162
  async getVolume() {
156
163
  return VolumeRange.UNSUPPORTED;
157
164
  }
@@ -7,7 +7,7 @@ export const isPathVisible = (hash: string, regexpPath?: RegExp) => (
7
7
  export const getCurrentHash = () => window.location.href.split('#')[1] || '';
8
8
 
9
9
  // eslint-disable-next-line no-useless-escape
10
- const PARAM_REGEX = /([a-zA-Z0-9+\-=.:%_()\[\]{}]+)/;
10
+ const PARAM_REGEX = /([^/]+)/;
11
11
  export const PARAM_REGEX_STR = PARAM_REGEX.source;
12
12
 
13
13
  export const pathToRegExp = (path: string) => {