@24i/bigscreen-sdk 1.0.54-alpha.2835 → 1.1.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/.vscode/settings.json +6 -0
- package/README.md +3 -2
- package/package.json +10 -10
- package/packages/analytics/src/clients/GoogleAnalytics/GoogleAnalytics.ts +14 -10
- package/packages/analytics/src/clients/GoogleAnalytics/constants.ts +2 -10
- package/packages/analytics/src/clients/GoogleAnalytics/interface.ts +1 -6
- package/packages/analytics/src/clients/GoogleAnalytics/mapPayload.ts +0 -1
- package/packages/analytics/src/clients/TealiumAnalytics/TealiumAnalytics.ts +24 -36
- package/packages/analytics/src/clients/TealiumAnalytics/constants.ts +1 -5
- package/packages/analytics/src/clients/TealiumAnalytics/findIdForLanguage.ts +9 -0
- package/packages/analytics/src/clients/TealiumAnalytics/index.ts +1 -1
- package/packages/analytics/src/clients/TealiumAnalytics/interface.ts +1 -3
- package/packages/analytics/src/clients/TealiumAnalytics/mappers/__mocks__/mediaPayload.ts +14 -16
- package/packages/analytics/src/clients/TealiumAnalytics/mappers/mapSceneView.ts +1 -1
- package/packages/analytics/src/clients/TealiumAnalytics/types.ts +14 -19
- package/packages/analytics/src/clients/TwentyFourIQ/TwentyFourIQClient.ts +22 -13
- package/packages/analytics/src/clients/TwentyFourIQ/constants.ts +3 -15
- package/packages/analytics/src/clients/TwentyFourIQ/interface.ts +4 -7
- package/packages/analytics/src/clients/TwentyFourIQ/mappers/mapAdLoaded.ts +13 -0
- package/packages/analytics/src/clients/TwentyFourIQ/mappers/mapAdSkipped.ts +16 -0
- package/packages/analytics/src/clients/TwentyFourIQ/mappers/mapBase.ts +3 -6
- package/packages/analytics/src/clients/TwentyFourIQ/mappers/mapBuffering.ts +2 -2
- package/packages/analytics/src/clients/TwentyFourIQ/mappers/mapPlayerClose.ts +3 -4
- package/packages/analytics/src/clients/TwentyFourIQ/mappers/mapPlayerOpen.ts +3 -2
- package/packages/analytics/src/clients/TwentyFourIQ/mappers/mapSceneView.ts +2 -2
- package/packages/analytics/src/clients/TwentyFourIQ/mappers/mapScroll.ts +2 -2
- package/packages/analytics/src/clients/TwentyFourIQ/mappers/mapVideoComplete.ts +3 -4
- package/packages/analytics/src/clients/TwentyFourIQ/mappers/mapVideoPause.ts +3 -4
- package/packages/analytics/src/clients/TwentyFourIQ/mappers/mapVideoProgress.ts +3 -4
- package/packages/analytics/src/clients/TwentyFourIQ/mappers/mapVideoStart.ts +2 -2
- package/packages/analytics/src/clients/TwentyFourIQ/mappers/mapVideoStop.ts +2 -2
- package/packages/analytics/src/clients/TwentyFourIQ/types.ts +28 -45
- package/packages/create-package/dist/createPackage.js +66 -0
- package/packages/create-package/dist/createPackage.js.map +1 -0
- package/packages/create-package/dist/index.js +5 -0
- package/packages/create-package/dist/index.js.map +1 -0
- package/packages/create-package/dist/questionnaire/questions.js +35 -0
- package/packages/create-package/dist/questionnaire/questions.js.map +1 -0
- package/packages/create-package/dist/settings/Settings.js +10 -0
- package/packages/create-package/dist/settings/Settings.js.map +1 -0
- package/packages/create-package/dist/types.js +3 -0
- package/packages/create-package/dist/types.js.map +1 -0
- package/packages/developer-tools/src/TechnicalInfo/TechnicalInfoProvider.ts +2 -23
- package/packages/developer-tools/src/TechnicalInfo/__mocks__/Device.ts +0 -8
- package/packages/developer-tools/src/TechnicalInfo/translations.ts +0 -4
- package/packages/driver-androidtv/src/DeviceAndroidTV.ts +0 -38
- package/packages/driver-androidtv/src/__mocks__/javaScriptBridge.ts +0 -9
- package/packages/driver-androidtv/src/index.ts +0 -1
- package/packages/driver-androidtv/src/types.ts +0 -42
- package/packages/driver-base/src/DeviceBase.ts +0 -19
- package/packages/driver-base/src/__mocks__/DeviceBase.ts +0 -24
- package/packages/driver-base/src/index.ts +0 -3
- package/packages/driver-browser/src/DeviceBrowser.ts +0 -26
- package/packages/driver-entone/src/DeviceEntone.ts +1 -31
- package/packages/driver-firetv/src/DeviceFireTV.ts +1 -74
- package/packages/driver-firetv/src/__mocks__/javaScriptBridge.ts +0 -9
- package/packages/driver-hbbtv/src/DeviceHbbTV.ts +0 -26
- package/packages/driver-kreatv/src/DeviceKreaTV.ts +0 -26
- package/packages/driver-saphi/src/DeviceSaphi.ts +0 -26
- package/packages/driver-smartcast/src/DeviceSmartCast.ts +1 -78
- package/packages/driver-smartcast/src/__mocks__/api.ts +2 -32
- package/packages/driver-smartcast/src/types.ts +2 -48
- package/packages/driver-tizen/src/DeviceTizen.ts +7 -126
- package/packages/driver-tizen/src/ITizen.ts +202 -15116
- package/packages/driver-tizen/src/IWebapis.ts +87 -8643
- package/packages/driver-tizen/src/TizenKeys.ts +2 -2
- package/packages/driver-tizen/src/__mocks__/tizen.ts +8 -7
- package/packages/driver-tizen/src/constants.ts +195 -1
- package/packages/driver-tizen/src/types.ts +14 -0
- package/packages/driver-vidaa/src/DeviceVidaa.ts +0 -26
- package/packages/driver-webos/src/DeviceWebos.ts +0 -47
- package/packages/driver-webos/src/__mocks__/webos.ts +0 -33
- package/packages/driver-webos/src/constants.ts +0 -1
- package/packages/driver-webos/src/types.ts +0 -30
- package/packages/driver-xbox/src/DeviceXbox.ts +1 -30
- package/packages/grid/src/UnifiedGridController/UnifiedGridController.ts +6 -6
- package/packages/input/README.md +3 -0
- package/packages/input/src/Input.tsx +62 -26
- package/packages/input/src/utils.ts +71 -0
- package/packages/keyboard/src/WhitelabelKeyboard/layouts/index.ts +0 -1
- package/packages/keyboard/src/utils/caret.ts +8 -5
- package/packages/keyboard/src/utils/input.ts +6 -5
- package/packages/list/src/BasicList/BasicList.tsx +7 -7
- package/packages/list/src/CenteredList/CenteredList.tsx +2 -2
- package/packages/list/src/EdgeOffsetList/EdgeOffsetList.tsx +7 -7
- package/packages/list/src/FirstOnlyList/FirstOnlyList.tsx +2 -2
- package/packages/list/src/FirstOnlyVariedList/FirstOnlyVariedList.tsx +2 -2
- package/packages/list/src/FixedToEndList/FixedToEndList.tsx +2 -2
- package/packages/list/src/interface.ts +2 -2
- package/packages/logger/src/loggers/ConsoleLogger/ConsoleLogger.ts +1 -7
- package/packages/logger/src/loggers/SentryLogger/SentryLogger.ts +1 -3
- package/packages/router/README.md +0 -1
- package/packages/router/src/Router.tsx +1 -4
- package/packages/router/src/utils.ts +1 -1
- package/utils/release/release.ts +5 -7
- package/ci/is_ci_job_skippable.sh +0 -153
- package/packages/analytics/src/clients/TealiumAnalytics/findForLanguage.ts +0 -9
- package/packages/analytics/src/clients/TealiumAnalytics/mappers/mapAppOpen.ts +0 -13
- package/packages/analytics/src/clients/TwentyFourIQ/mappers/mapAdEvent.ts +0 -20
- package/packages/driver-base/src/types/AdInfo.ts +0 -5
- package/packages/driver-base/src/types/InAppPurchase.ts +0 -25
- package/packages/driver-firetv/src/types.ts +0 -1
- package/packages/input/src/handleOverflow.ts +0 -29
- package/packages/keyboard/src/WhitelabelKeyboard/layouts/spanish.ts +0 -26
- package/packages/keyboard/src/utils/setInputSelectionRange.ts +0 -10
|
@@ -3,8 +3,6 @@ import {
|
|
|
3
3
|
ConnectionType,
|
|
4
4
|
ScreenSaverStatus,
|
|
5
5
|
VolumeRange,
|
|
6
|
-
IAPSuccessPayload,
|
|
7
|
-
IAPPurchaseProductData,
|
|
8
6
|
} from '@24i/bigscreen-sdk/driver-base';
|
|
9
7
|
import { IJavaScriptBridge, DeviceInfo } from './types';
|
|
10
8
|
import { getFirmware } from './formatUserAgent';
|
|
@@ -164,30 +162,6 @@ export class DeviceAndroidTV extends DeviceBase {
|
|
|
164
162
|
return this.getBaseUuid();
|
|
165
163
|
}
|
|
166
164
|
|
|
167
|
-
async getAdInfo() {
|
|
168
|
-
let adId = null;
|
|
169
|
-
let latEnabled = null;
|
|
170
|
-
const type = 'gaid';
|
|
171
|
-
try {
|
|
172
|
-
adId = window.JavaScriptBridge.bridgeJavaScriptToAndroid_GetAdId() ?? null;
|
|
173
|
-
latEnabled = window.JavaScriptBridge.bridgeJavaScriptToAndroid_GetLimitAdTracking()
|
|
174
|
-
?? true;
|
|
175
|
-
} catch (e) {
|
|
176
|
-
latEnabled = true;
|
|
177
|
-
console.error('[DeviceAndroidTV] Failed to getAdInfo', e);
|
|
178
|
-
}
|
|
179
|
-
return { adId, type, latEnabled };
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
async getOsLanguage() {
|
|
183
|
-
try {
|
|
184
|
-
return window.JavaScriptBridge.bridgeJavaScriptToAndroid_GetOsLanguage() || '';
|
|
185
|
-
} catch (e) {
|
|
186
|
-
console.error('[DeviceAndroidTV] Failed to getOsLanguage', e);
|
|
187
|
-
return '';
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
|
|
191
165
|
async getVolume(): Promise<number> {
|
|
192
166
|
return VolumeRange.UNSUPPORTED;
|
|
193
167
|
}
|
|
@@ -247,16 +221,4 @@ export class DeviceAndroidTV extends DeviceBase {
|
|
|
247
221
|
// not supported on AndroidTV platform
|
|
248
222
|
return '';
|
|
249
223
|
}
|
|
250
|
-
|
|
251
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
252
|
-
async purchaseProduct(data: IAPPurchaseProductData): Promise<IAPSuccessPayload> {
|
|
253
|
-
// not supported
|
|
254
|
-
throw new Error('Not supported');
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
258
|
-
async cancelSubscription(data: IAPPurchaseProductData): Promise<void> {
|
|
259
|
-
// not supported
|
|
260
|
-
throw new Error('Not supported');
|
|
261
|
-
}
|
|
262
224
|
}
|
|
@@ -13,12 +13,7 @@ export const mockJavaScriptBridge: IJavaScriptBridge = {
|
|
|
13
13
|
ipLocal: '127.0.0.1',
|
|
14
14
|
})
|
|
15
15
|
),
|
|
16
|
-
bridgeJavaScriptToAndroid_GetAdId: () => 'gaid-id',
|
|
17
|
-
bridgeJavaScriptToAndroid_GetLimitAdTracking: () => false,
|
|
18
|
-
bridgeJavaScriptToAndroid_GetOsLanguage: () => '',
|
|
19
|
-
bridgeJavaScriptToAndroid_GetMediaInfo: () => '{}',
|
|
20
16
|
bridgeJavaScriptToAndroid_Back: () => {},
|
|
21
|
-
bridgeJavaScriptToAndroid_ReloadPlayer: () => {},
|
|
22
17
|
bridgeJavaScriptToAndroid_StopVideo: () => {},
|
|
23
18
|
bridgeJavaScriptToAndroid_FullScreenVideo: () => {},
|
|
24
19
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
@@ -37,9 +32,5 @@ export const mockJavaScriptBridge: IJavaScriptBridge = {
|
|
|
37
32
|
bridgeJavaScriptToAndroid_SetTrack: (track: string) => {},
|
|
38
33
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
39
34
|
bridgeJavaScriptToAndroid_SetAudioTrack: (track: string) => {},
|
|
40
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
41
|
-
bridgeReceiptAmazonIAPValidation: (sku: string) => {},
|
|
42
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
43
|
-
bridgeReceiptAmazonIAPValidated: (receiptId: string) => {},
|
|
44
35
|
},
|
|
45
36
|
};
|
|
@@ -7,34 +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
|
-
/**
|
|
12
|
-
* It returns advertising id.
|
|
13
|
-
* @return Advertising id or null if not available.
|
|
14
|
-
*/
|
|
15
|
-
bridgeJavaScriptToAndroid_GetAdId: () => string | null,
|
|
16
|
-
/**
|
|
17
|
-
* It returns limit ad tracking status
|
|
18
|
-
* @return true if limit ad tracking is enabled, false if not and null if not available.
|
|
19
|
-
*/
|
|
20
|
-
bridgeJavaScriptToAndroid_GetLimitAdTracking: () => boolean | null,
|
|
21
|
-
/**
|
|
22
|
-
* It returns the language of the OS.
|
|
23
|
-
* @return Language of the OS. Ex. "en"
|
|
24
|
-
*/
|
|
25
|
-
bridgeJavaScriptToAndroid_GetOsLanguage: () => string,
|
|
26
|
-
/**
|
|
27
|
-
* It returns media info including statistics
|
|
28
|
-
*/
|
|
29
|
-
bridgeJavaScriptToAndroid_GetMediaInfo: () => string;
|
|
30
10
|
/**
|
|
31
11
|
* It simulates a native Android back press.
|
|
32
12
|
*/
|
|
33
13
|
bridgeJavaScriptToAndroid_Back: () => void,
|
|
34
|
-
/**
|
|
35
|
-
* It reloads the video player
|
|
36
|
-
*/
|
|
37
|
-
bridgeJavaScriptToAndroid_ReloadPlayer: () => void;
|
|
38
14
|
/**
|
|
39
15
|
* It simulates a native Android stop button press.
|
|
40
16
|
*/
|
|
@@ -91,14 +67,6 @@ interface JavaScriptBridge {
|
|
|
91
67
|
* It sets audio track to be used.
|
|
92
68
|
*/
|
|
93
69
|
bridgeJavaScriptToAndroid_SetAudioTrack: (track: string) => void;
|
|
94
|
-
/**
|
|
95
|
-
* It launch in app purchase.
|
|
96
|
-
*/
|
|
97
|
-
bridgeReceiptAmazonIAPValidation: (sku: string) => void;
|
|
98
|
-
/**
|
|
99
|
-
* It validate purchase.
|
|
100
|
-
*/
|
|
101
|
-
bridgeReceiptAmazonIAPValidated: (receiptId: string) => void;
|
|
102
70
|
}
|
|
103
71
|
|
|
104
72
|
export type DeviceInfo = {
|
|
@@ -143,13 +111,3 @@ export type DeviceInfo = {
|
|
|
143
111
|
export interface IJavaScriptBridge {
|
|
144
112
|
JavaScriptBridge: JavaScriptBridge,
|
|
145
113
|
}
|
|
146
|
-
|
|
147
|
-
export type IAPSuccessEvent = {
|
|
148
|
-
userId: string;
|
|
149
|
-
receipt: string;
|
|
150
|
-
sku: string;
|
|
151
|
-
};
|
|
152
|
-
|
|
153
|
-
export type IAPErrorEvent = {
|
|
154
|
-
message: string;
|
|
155
|
-
};
|
|
@@ -8,13 +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';
|
|
12
11
|
import { ScreenSaverStatus } from './types/ScreenSaverStatus';
|
|
13
|
-
import {
|
|
14
|
-
SubscriptionFeaturesConfiguration,
|
|
15
|
-
IAPPurchaseProductData,
|
|
16
|
-
IAPSuccessPayload,
|
|
17
|
-
} from './types/InAppPurchase';
|
|
18
12
|
import { ExitOptions } from './types/ExitOptions';
|
|
19
13
|
import { inRange } from './utils';
|
|
20
14
|
import { ErrorTemplate } from './errors';
|
|
@@ -61,11 +55,6 @@ export abstract class DeviceBase<
|
|
|
61
55
|
|
|
62
56
|
isOffline: boolean = false;
|
|
63
57
|
|
|
64
|
-
subscriptionFeaturesConfiguration: SubscriptionFeaturesConfiguration = {
|
|
65
|
-
purchase: false,
|
|
66
|
-
management: false,
|
|
67
|
-
};
|
|
68
|
-
|
|
69
58
|
// MARK: Initialization
|
|
70
59
|
|
|
71
60
|
/**
|
|
@@ -163,10 +152,6 @@ export abstract class DeviceBase<
|
|
|
163
152
|
|
|
164
153
|
abstract getUuid(): Promise<string>;
|
|
165
154
|
|
|
166
|
-
abstract getAdInfo(): Promise<AdInfo>;
|
|
167
|
-
|
|
168
|
-
abstract getOsLanguage(): Promise<string>;
|
|
169
|
-
|
|
170
155
|
abstract getVolume(): Promise<number>;
|
|
171
156
|
|
|
172
157
|
abstract setVolume(volumePercentage: number): Promise<void>;
|
|
@@ -189,10 +174,6 @@ export abstract class DeviceBase<
|
|
|
189
174
|
|
|
190
175
|
abstract getMacAddress(): Promise<string>;
|
|
191
176
|
|
|
192
|
-
abstract purchaseProduct(data: IAPPurchaseProductData): Promise<IAPSuccessPayload>;
|
|
193
|
-
|
|
194
|
-
abstract cancelSubscription(data: IAPPurchaseProductData): Promise<void>;
|
|
195
|
-
|
|
196
177
|
// MARK: Private functions
|
|
197
178
|
|
|
198
179
|
private bindPreventDefaultEvents(rootElement: HTMLElement) {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { DeviceBase as AbstractDeviceBase } from '../DeviceBase';
|
|
2
2
|
import { ScreenSaverStatus } from '../types/ScreenSaverStatus';
|
|
3
3
|
import { ConnectionType } from '../ConnectionType';
|
|
4
|
-
import { IAPPurchaseProductData, IAPSuccessPayload } from '../types/InAppPurchase';
|
|
5
4
|
|
|
6
5
|
export class DeviceBase extends AbstractDeviceBase {
|
|
7
6
|
volume = 0;
|
|
@@ -54,17 +53,6 @@ export class DeviceBase extends AbstractDeviceBase {
|
|
|
54
53
|
return this.getBaseUuid();
|
|
55
54
|
}
|
|
56
55
|
|
|
57
|
-
async getOsLanguage() {
|
|
58
|
-
return '';
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
async getAdInfo() {
|
|
62
|
-
const adId = 'uuid';
|
|
63
|
-
const type = 'id type';
|
|
64
|
-
const latEnabled = null;
|
|
65
|
-
return { adId, type, latEnabled };
|
|
66
|
-
}
|
|
67
|
-
|
|
68
56
|
async getVolume() {
|
|
69
57
|
return this.volume;
|
|
70
58
|
}
|
|
@@ -109,16 +97,4 @@ export class DeviceBase extends AbstractDeviceBase {
|
|
|
109
97
|
async getMacAddress() {
|
|
110
98
|
return '00:11:22:33:44:55';
|
|
111
99
|
}
|
|
112
|
-
|
|
113
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
114
|
-
async purchaseProduct(data: IAPPurchaseProductData): Promise<IAPSuccessPayload> {
|
|
115
|
-
// not supported
|
|
116
|
-
throw new Error('Not supported');
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
120
|
-
async cancelSubscription(data: IAPPurchaseProductData): Promise<void> {
|
|
121
|
-
// not supported
|
|
122
|
-
throw new Error('Not supported');
|
|
123
|
-
}
|
|
124
100
|
}
|
|
@@ -5,9 +5,6 @@ export { VolumeRange } from './VolumeRange';
|
|
|
5
5
|
export type { ScreenSize } from './ScreenSize';
|
|
6
6
|
export type { KeycodeKeyMap } from './types/KeycodeKeyMap';
|
|
7
7
|
export type { DeviceEventMap } from './types/DeviceEvent';
|
|
8
|
-
export type {
|
|
9
|
-
IAPSuccessPayload, IAPErrorPayload, IAPPromiseResolve, IAPPromiseReject, IAPPurchaseProductData,
|
|
10
|
-
} from './types/InAppPurchase';
|
|
11
8
|
export type { ScreenSaverStatus } from './types/ScreenSaverStatus';
|
|
12
9
|
export type { ExitOptions } from './types/ExitOptions';
|
|
13
10
|
export * as KeyMap from './KeyMap';
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DeviceBase, ConnectionType, ScreenSaverStatus, VolumeRange,
|
|
3
|
-
IAPSuccessPayload,
|
|
4
|
-
IAPPurchaseProductData,
|
|
5
3
|
} from '@24i/bigscreen-sdk/driver-base';
|
|
6
4
|
import { runAsync } from '@24i/bigscreen-sdk/utils/timers';
|
|
7
|
-
import { generateUuid } from '@24i/bigscreen-sdk/utils';
|
|
8
5
|
import { getKeyMap } from './keymap';
|
|
9
6
|
import { patchSuitestKeys } from './patchSuitestKeys';
|
|
10
7
|
import { getBrowser } from './getBrowser';
|
|
@@ -117,17 +114,6 @@ export class DeviceBrowser extends DeviceBase {
|
|
|
117
114
|
return this.getBaseUuid();
|
|
118
115
|
}
|
|
119
116
|
|
|
120
|
-
async getAdInfo() {
|
|
121
|
-
const adId = generateUuid();
|
|
122
|
-
const type = 'sessionid';
|
|
123
|
-
const latEnabled = null;
|
|
124
|
-
return { adId, type, latEnabled };
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
async getOsLanguage() {
|
|
128
|
-
return (window.navigator.language || '').slice(0, 2);
|
|
129
|
-
}
|
|
130
|
-
|
|
131
117
|
async getVolume() {
|
|
132
118
|
return this.volume;
|
|
133
119
|
}
|
|
@@ -181,16 +167,4 @@ export class DeviceBrowser extends DeviceBase {
|
|
|
181
167
|
// for development purpose. Correctly, it should return '' for unknown MAC addr.
|
|
182
168
|
return '00:00:00:00:00:00';
|
|
183
169
|
}
|
|
184
|
-
|
|
185
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
186
|
-
async purchaseProduct(data: IAPPurchaseProductData): Promise<IAPSuccessPayload> {
|
|
187
|
-
// not supported
|
|
188
|
-
throw new Error('Not supported');
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
192
|
-
async cancelSubscription(data: IAPPurchaseProductData): Promise<void> {
|
|
193
|
-
// not supported
|
|
194
|
-
throw new Error('Not supported');
|
|
195
|
-
}
|
|
196
170
|
}
|
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
DeviceBase,
|
|
3
|
-
IAPPurchaseProductData,
|
|
4
|
-
IAPSuccessPayload,
|
|
5
|
-
ScreenSaverStatus,
|
|
6
|
-
VolumeRange,
|
|
7
|
-
} from '@24i/bigscreen-sdk/driver-base';
|
|
8
|
-
import { generateUuid } from '@24i/bigscreen-sdk/utils';
|
|
1
|
+
import { DeviceBase, ScreenSaverStatus, VolumeRange } from '@24i/bigscreen-sdk/driver-base';
|
|
9
2
|
import { getKeyMap } from './keymap';
|
|
10
3
|
import { EntoneDeviceModelName } from './constants';
|
|
11
4
|
import { IEntone, NetworkEvent } from './IEntone';
|
|
@@ -127,17 +120,6 @@ export class DeviceEntone extends DeviceBase {
|
|
|
127
120
|
return '';
|
|
128
121
|
}
|
|
129
122
|
|
|
130
|
-
async getAdInfo() {
|
|
131
|
-
const adId = generateUuid();
|
|
132
|
-
const type = 'sessionid';
|
|
133
|
-
const latEnabled = null;
|
|
134
|
-
return { adId, type, latEnabled };
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
async getOsLanguage() {
|
|
138
|
-
return (window.navigator.language || '').slice(0, 2);
|
|
139
|
-
}
|
|
140
|
-
|
|
141
123
|
async getVolume() {
|
|
142
124
|
try {
|
|
143
125
|
const { leftVolPercentage, rightVolPercentage } = ENTONE.stb.getAudioVolume();
|
|
@@ -247,16 +229,4 @@ export class DeviceEntone extends DeviceBase {
|
|
|
247
229
|
}
|
|
248
230
|
return macAddress || '';
|
|
249
231
|
}
|
|
250
|
-
|
|
251
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
252
|
-
async purchaseProduct(data: IAPPurchaseProductData): Promise<IAPSuccessPayload> {
|
|
253
|
-
// not supported
|
|
254
|
-
throw new Error('Not supported');
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
258
|
-
async cancelSubscription(data: IAPPurchaseProductData): Promise<void> {
|
|
259
|
-
// not supported
|
|
260
|
-
throw new Error('Not supported');
|
|
261
|
-
}
|
|
262
232
|
}
|
|
@@ -1,14 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
DeviceAndroidTV,
|
|
3
|
-
IAPErrorEvent,
|
|
4
|
-
IAPSuccessEvent,
|
|
5
|
-
} from '@24i/bigscreen-sdk/driver-androidtv';
|
|
6
|
-
import {
|
|
7
|
-
IAPSuccessPayload, IAPPromiseReject, IAPPromiseResolve,
|
|
8
|
-
IAPPurchaseProductData,
|
|
9
|
-
} from '@24i/bigscreen-sdk/driver-base';
|
|
10
|
-
import { VendorType } from '@24i/smartapps-datalayer/api';
|
|
11
|
-
import { Receipt } from './types';
|
|
1
|
+
import { DeviceAndroidTV } from '@24i/bigscreen-sdk/driver-androidtv';
|
|
12
2
|
|
|
13
3
|
/**
|
|
14
4
|
* Fire TV driver implementing API of Android TV Bridge.
|
|
@@ -16,11 +6,6 @@ import { Receipt } from './types';
|
|
|
16
6
|
* See https://github.com/24i/prd-smart-ott-androidtv
|
|
17
7
|
*/
|
|
18
8
|
export class DeviceFireTV extends DeviceAndroidTV {
|
|
19
|
-
subscriptionFeaturesConfiguration = {
|
|
20
|
-
purchase: true,
|
|
21
|
-
management: false,
|
|
22
|
-
};
|
|
23
|
-
|
|
24
9
|
async getPlatformName(): Promise<string> {
|
|
25
10
|
return 'FireTV';
|
|
26
11
|
}
|
|
@@ -30,62 +15,4 @@ export class DeviceFireTV extends DeviceAndroidTV {
|
|
|
30
15
|
const manufacturerName = await this.getManufacturerName();
|
|
31
16
|
return `FireTV ${manufacturerName} ${modelName}`.trim();
|
|
32
17
|
}
|
|
33
|
-
|
|
34
|
-
async getAdInfo() {
|
|
35
|
-
let adId = null;
|
|
36
|
-
let latEnabled = null;
|
|
37
|
-
const type = 'afai';
|
|
38
|
-
try {
|
|
39
|
-
adId = window.JavaScriptBridge.bridgeJavaScriptToAndroid_GetAdId() ?? null;
|
|
40
|
-
latEnabled = window.JavaScriptBridge.bridgeJavaScriptToAndroid_GetLimitAdTracking()
|
|
41
|
-
?? true;
|
|
42
|
-
} catch (e) {
|
|
43
|
-
latEnabled = true;
|
|
44
|
-
console.error('[DeviceFireTV] Failed to getAdInfo', e);
|
|
45
|
-
}
|
|
46
|
-
return { adId, type, latEnabled };
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
onIAPSuccess = (resolve: IAPPromiseResolve, reject: IAPPromiseReject) => (event: unknown) => {
|
|
50
|
-
this.removeIAPListeners(resolve, reject);
|
|
51
|
-
try {
|
|
52
|
-
const { userId, receipt: receiptToParse } = event as IAPSuccessEvent;
|
|
53
|
-
const receipt: Receipt = JSON.parse(receiptToParse);
|
|
54
|
-
window.JavaScriptBridge
|
|
55
|
-
.bridgeReceiptAmazonIAPValidated(receipt.receiptId);
|
|
56
|
-
resolve({
|
|
57
|
-
platform: VendorType.AMAZON,
|
|
58
|
-
receiptPayload: {
|
|
59
|
-
userId,
|
|
60
|
-
receiptId: receipt.receiptId,
|
|
61
|
-
},
|
|
62
|
-
});
|
|
63
|
-
} catch (e) {
|
|
64
|
-
reject(e);
|
|
65
|
-
}
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
onIAPError = (resolve: IAPPromiseResolve, reject: IAPPromiseReject) => (event: unknown) => {
|
|
69
|
-
this.removeIAPListeners(resolve, reject);
|
|
70
|
-
reject(new Error((event as IAPErrorEvent).message));
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
removeIAPListeners(resolve: IAPPromiseResolve, reject: IAPPromiseReject) {
|
|
74
|
-
document.removeEventListener('iapSuccess', this.onIAPSuccess(resolve, reject));
|
|
75
|
-
document.removeEventListener('iapError', this.onIAPError(resolve, reject));
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
async purchaseProduct(data: IAPPurchaseProductData): Promise<IAPSuccessPayload> {
|
|
79
|
-
return new Promise((resolve, reject) => {
|
|
80
|
-
document.addEventListener('iapSuccess', this.onIAPSuccess(resolve, reject));
|
|
81
|
-
document.addEventListener('iapError', this.onIAPError(resolve, reject));
|
|
82
|
-
window.JavaScriptBridge.bridgeReceiptAmazonIAPValidation(data.sku!);
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
87
|
-
async cancelSubscription(data: IAPPurchaseProductData): Promise<void> {
|
|
88
|
-
// not supported
|
|
89
|
-
throw new Error('Not supported');
|
|
90
|
-
}
|
|
91
18
|
}
|
|
@@ -13,12 +13,7 @@ export const mockJavaScriptBridge: IJavaScriptBridge = {
|
|
|
13
13
|
ipLocal: '127.0.0.1',
|
|
14
14
|
})
|
|
15
15
|
),
|
|
16
|
-
bridgeJavaScriptToAndroid_GetAdId: () => 'afai-id',
|
|
17
|
-
bridgeJavaScriptToAndroid_GetLimitAdTracking: () => false,
|
|
18
|
-
bridgeJavaScriptToAndroid_GetOsLanguage: () => '',
|
|
19
|
-
bridgeJavaScriptToAndroid_GetMediaInfo: () => '{}',
|
|
20
16
|
bridgeJavaScriptToAndroid_Back: () => {},
|
|
21
|
-
bridgeJavaScriptToAndroid_ReloadPlayer: () => {},
|
|
22
17
|
bridgeJavaScriptToAndroid_StopVideo: () => {},
|
|
23
18
|
bridgeJavaScriptToAndroid_FullScreenVideo: () => {},
|
|
24
19
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
@@ -37,9 +32,5 @@ export const mockJavaScriptBridge: IJavaScriptBridge = {
|
|
|
37
32
|
bridgeJavaScriptToAndroid_SetTrack: (track: string) => {},
|
|
38
33
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
39
34
|
bridgeJavaScriptToAndroid_SetAudioTrack: (track: string) => {},
|
|
40
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
41
|
-
bridgeReceiptAmazonIAPValidation: (sku: string) => {},
|
|
42
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
43
|
-
bridgeReceiptAmazonIAPValidated: (receiptId: string) => {},
|
|
44
35
|
},
|
|
45
36
|
};
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DeviceBase, ConnectionType, ScreenSaverStatus, loadObject, VolumeRange,
|
|
3
|
-
IAPSuccessPayload,
|
|
4
|
-
IAPPurchaseProductData,
|
|
5
3
|
} from '@24i/bigscreen-sdk/driver-base';
|
|
6
|
-
import { generateUuid } from '@24i/bigscreen-sdk/utils';
|
|
7
4
|
import { getKeyMap } from './keymap';
|
|
8
5
|
import { getVersion } from './getVersion';
|
|
9
6
|
import { getDeviceInfo } from './deviceInfo';
|
|
@@ -248,17 +245,6 @@ export class DeviceHbbTV extends DeviceBase {
|
|
|
248
245
|
return this.getBaseUuid();
|
|
249
246
|
}
|
|
250
247
|
|
|
251
|
-
async getAdInfo() {
|
|
252
|
-
const adId = generateUuid();
|
|
253
|
-
const type = 'sessionid';
|
|
254
|
-
const latEnabled = null;
|
|
255
|
-
return { adId, type, latEnabled };
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
async getOsLanguage() {
|
|
259
|
-
return (window.navigator.language || '').slice(0, 2);
|
|
260
|
-
}
|
|
261
|
-
|
|
262
248
|
async getVolume() {
|
|
263
249
|
// TODO: not yet implemented
|
|
264
250
|
return VolumeRange.UNSUPPORTED;
|
|
@@ -324,16 +310,4 @@ export class DeviceHbbTV extends DeviceBase {
|
|
|
324
310
|
console.warn('[HbbTV] Broadcast tune failed');
|
|
325
311
|
}
|
|
326
312
|
}
|
|
327
|
-
|
|
328
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
329
|
-
async purchaseProduct(data: IAPPurchaseProductData): Promise<IAPSuccessPayload> {
|
|
330
|
-
// not supported
|
|
331
|
-
throw new Error('Not supported');
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
335
|
-
async cancelSubscription(data: IAPPurchaseProductData): Promise<void> {
|
|
336
|
-
// not supported
|
|
337
|
-
throw new Error('Not supported');
|
|
338
|
-
}
|
|
339
313
|
}
|
|
@@ -3,10 +3,7 @@ import {
|
|
|
3
3
|
ConnectionType,
|
|
4
4
|
ScreenSaverStatus,
|
|
5
5
|
VolumeRange,
|
|
6
|
-
IAPSuccessPayload,
|
|
7
|
-
IAPPurchaseProductData,
|
|
8
6
|
} from '@24i/bigscreen-sdk/driver-base';
|
|
9
|
-
import { generateUuid } from '@24i/bigscreen-sdk/utils';
|
|
10
7
|
import { getKeyMap } from './keymap';
|
|
11
8
|
import { toi2 } from './toi2';
|
|
12
9
|
import { toi3 } from './toi3';
|
|
@@ -162,17 +159,6 @@ export class DeviceKreaTV extends DeviceBase {
|
|
|
162
159
|
return '';
|
|
163
160
|
}
|
|
164
161
|
|
|
165
|
-
async getAdInfo() {
|
|
166
|
-
const adId = generateUuid();
|
|
167
|
-
const type = 'sessionid';
|
|
168
|
-
const latEnabled = null;
|
|
169
|
-
return { adId, type, latEnabled };
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
async getOsLanguage() {
|
|
173
|
-
return (window.navigator.language || '').slice(0, 2);
|
|
174
|
-
}
|
|
175
|
-
|
|
176
162
|
getSupportedAudioConnections() {
|
|
177
163
|
const { audioOutputService } = this.toiInstance;
|
|
178
164
|
const { ToiAudioOutputService } = this.toiInstance.consts;
|
|
@@ -282,16 +268,4 @@ export class DeviceKreaTV extends DeviceBase {
|
|
|
282
268
|
async getMacAddress(): Promise<string> {
|
|
283
269
|
return this.toiResolver.getMacAddress();
|
|
284
270
|
}
|
|
285
|
-
|
|
286
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
287
|
-
async purchaseProduct(data: IAPPurchaseProductData): Promise<IAPSuccessPayload> {
|
|
288
|
-
// not supported
|
|
289
|
-
throw new Error('Not supported');
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
293
|
-
async cancelSubscription(data: IAPPurchaseProductData): Promise<void> {
|
|
294
|
-
// not supported
|
|
295
|
-
throw new Error('Not supported');
|
|
296
|
-
}
|
|
297
271
|
}
|
|
@@ -3,10 +3,7 @@ import {
|
|
|
3
3
|
ConnectionType,
|
|
4
4
|
ScreenSaverStatus,
|
|
5
5
|
VolumeRange,
|
|
6
|
-
IAPSuccessPayload,
|
|
7
|
-
IAPPurchaseProductData,
|
|
8
6
|
} from '@24i/bigscreen-sdk/driver-base';
|
|
9
|
-
import { generateUuid } from '@24i/bigscreen-sdk/utils';
|
|
10
7
|
import { getDeviceInfo, getFirmware, getPlatformInfo } from './formatUserAgent';
|
|
11
8
|
import { ISmartTvAApi } from './types';
|
|
12
9
|
import { getKeyMap } from './keymap';
|
|
@@ -84,17 +81,6 @@ export class DeviceSaphi extends DeviceBase {
|
|
|
84
81
|
return this.getBaseUuid();
|
|
85
82
|
}
|
|
86
83
|
|
|
87
|
-
async getAdInfo() {
|
|
88
|
-
const adId = generateUuid();
|
|
89
|
-
const type = 'sessionid';
|
|
90
|
-
const latEnabled = null;
|
|
91
|
-
return { adId, type, latEnabled };
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
async getOsLanguage() {
|
|
95
|
-
return (window.navigator.language || '').slice(0, 2);
|
|
96
|
-
}
|
|
97
|
-
|
|
98
84
|
async getVolume(): Promise<number> {
|
|
99
85
|
return VolumeRange.UNSUPPORTED;
|
|
100
86
|
}
|
|
@@ -155,16 +141,4 @@ export class DeviceSaphi extends DeviceBase {
|
|
|
155
141
|
// not supported on Saphi platform
|
|
156
142
|
return '';
|
|
157
143
|
}
|
|
158
|
-
|
|
159
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
160
|
-
async purchaseProduct(data: IAPPurchaseProductData): Promise<IAPSuccessPayload> {
|
|
161
|
-
// not supported
|
|
162
|
-
throw new Error('Not supported');
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
166
|
-
async cancelSubscription(data: IAPPurchaseProductData): Promise<void> {
|
|
167
|
-
// not supported
|
|
168
|
-
throw new Error('Not supported');
|
|
169
|
-
}
|
|
170
144
|
}
|