@24i/bigscreen-sdk 1.0.4 → 1.0.5-4.alpha-2832
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/README.md +2 -3
- package/ci/is_ci_job_skippable.sh +153 -0
- package/package.json +55 -34
- package/packages/adobe-heartbeat/src/AdobeHeartbeat.ts +9 -9
- package/packages/analytics/README.md +8 -0
- package/packages/analytics/src/A.ts +1 -0
- package/packages/analytics/src/Analytics.ts +1 -0
- package/packages/analytics/src/analyticsOnScroll.ts +1 -0
- package/packages/analytics/src/clients/ConsoleAnalytics/ConsoleAnalytics.ts +1 -0
- package/packages/analytics/src/clients/ConsoleAnalytics/index.ts +1 -0
- package/packages/analytics/src/clients/GoogleAnalytics/GoogleAnalytics.ts +196 -0
- package/packages/analytics/src/clients/GoogleAnalytics/constants.ts +126 -0
- package/packages/analytics/src/clients/GoogleAnalytics/getUrl.ts +17 -0
- package/packages/analytics/src/clients/GoogleAnalytics/index.ts +2 -0
- package/packages/analytics/src/clients/GoogleAnalytics/interface.ts +82 -0
- package/packages/analytics/src/clients/GoogleAnalytics/mapPayload.ts +51 -0
- package/packages/analytics/src/clients/GoogleAnalytics/prepareBody.ts +14 -0
- package/packages/analytics/src/clients/TealiumAnalytics/TealiumAnalytics.ts +181 -0
- package/packages/analytics/src/clients/TealiumAnalytics/constants.ts +106 -0
- package/packages/analytics/src/clients/TealiumAnalytics/findForLanguage.ts +9 -0
- package/packages/analytics/src/clients/TealiumAnalytics/index.ts +4 -0
- package/packages/analytics/src/clients/TealiumAnalytics/interface.ts +35 -0
- package/packages/analytics/src/clients/TealiumAnalytics/mappers/__mocks__/mediaPayload.ts +72 -0
- package/packages/analytics/src/clients/TealiumAnalytics/mappers/helper.ts +36 -0
- package/packages/analytics/src/clients/TealiumAnalytics/mappers/mapAppError.ts +13 -0
- package/packages/analytics/src/clients/TealiumAnalytics/mappers/mapAppOpen.ts +13 -0
- package/packages/analytics/src/clients/TealiumAnalytics/mappers/mapFavoriteAdd.ts +11 -0
- package/packages/analytics/src/clients/TealiumAnalytics/mappers/mapFavoriteRemove.ts +11 -0
- package/packages/analytics/src/clients/TealiumAnalytics/mappers/mapPlayerClose.ts +15 -0
- package/packages/analytics/src/clients/TealiumAnalytics/mappers/mapPlayerOpen.ts +15 -0
- package/packages/analytics/src/clients/TealiumAnalytics/mappers/mapSceneView.ts +18 -0
- package/packages/analytics/src/clients/TealiumAnalytics/mappers/mapSearch.ts +18 -0
- package/packages/analytics/src/clients/TealiumAnalytics/mappers/mapSearchFailed.ts +8 -0
- package/packages/analytics/src/clients/TealiumAnalytics/mappers/mapSearchSuccess.ts +8 -0
- package/packages/analytics/src/clients/TealiumAnalytics/mappers/mapVideoPause.ts +15 -0
- package/packages/analytics/src/clients/TealiumAnalytics/mappers/mapVideoProgress.ts +18 -0
- package/packages/analytics/src/clients/TealiumAnalytics/mappers/mapVideoResume.ts +15 -0
- package/packages/analytics/src/clients/TealiumAnalytics/mappers/mapVideoStart.ts +15 -0
- package/packages/analytics/src/clients/TealiumAnalytics/mappers/mapVideoStop.ts +15 -0
- package/packages/analytics/src/clients/TealiumAnalytics/types.ts +161 -0
- package/packages/analytics/src/clients/TwentyFourIQ/TwentyFourIQClient.ts +107 -0
- package/packages/analytics/src/clients/TwentyFourIQ/constants.ts +111 -0
- package/packages/analytics/src/clients/TwentyFourIQ/helper.ts +34 -0
- package/packages/analytics/src/clients/TwentyFourIQ/index.ts +2 -0
- package/packages/analytics/src/clients/TwentyFourIQ/interface.ts +34 -0
- package/packages/analytics/src/clients/TwentyFourIQ/mappers/mapAdEvent.ts +20 -0
- package/packages/analytics/src/clients/TwentyFourIQ/mappers/mapBase.ts +24 -0
- package/packages/analytics/src/clients/TwentyFourIQ/mappers/mapBuffering.ts +15 -0
- package/packages/analytics/src/clients/TwentyFourIQ/mappers/mapPlayerClose.ts +25 -0
- package/packages/analytics/src/clients/TwentyFourIQ/mappers/mapPlayerOpen.ts +17 -0
- package/packages/analytics/src/clients/TwentyFourIQ/mappers/mapSceneView.ts +15 -0
- package/packages/analytics/src/clients/TwentyFourIQ/mappers/mapScroll.ts +17 -0
- package/packages/analytics/src/clients/TwentyFourIQ/mappers/mapVideoComplete.ts +22 -0
- package/packages/analytics/src/clients/TwentyFourIQ/mappers/mapVideoPause.ts +25 -0
- package/packages/analytics/src/clients/TwentyFourIQ/mappers/mapVideoProgress.ts +25 -0
- package/packages/analytics/src/clients/TwentyFourIQ/mappers/mapVideoStart.ts +34 -0
- package/packages/analytics/src/clients/TwentyFourIQ/mappers/mapVideoStop.ts +32 -0
- package/packages/analytics/src/clients/TwentyFourIQ/types.ts +132 -0
- package/packages/analytics/src/constants.ts +1 -0
- package/packages/analytics/src/index.ts +3 -0
- package/packages/analytics/src/interface.ts +1 -0
- package/packages/analytics/src/utils/generateSessionId.ts +8 -0
- package/packages/async-image/src/AsyncImage.tsx +15 -10
- package/packages/developer-tools/PlayerDebugWindow/README.md +1 -1
- package/packages/developer-tools/src/DeveloperConsole/DeveloperConsole.tsx +1 -0
- package/packages/developer-tools/src/DeveloperToolsService/DeveloperToolsList.tsx +11 -0
- package/packages/developer-tools/src/PlayerDebugWindow/PlayerDebugWindow.tsx +5 -5
- package/packages/developer-tools/src/PlayerDebugWindow/constants.ts +15 -0
- package/packages/developer-tools/src/TechnicalInfo/TechnicalInfo.tsx +2 -0
- package/packages/developer-tools/src/TechnicalInfo/TechnicalInfoDetail.tsx +2 -1
- package/packages/developer-tools/src/TechnicalInfo/TechnicalInfoProvider.ts +57 -5
- package/packages/developer-tools/src/TechnicalInfo/__mocks__/Device.ts +12 -0
- package/packages/developer-tools/src/TechnicalInfo/translations.ts +8 -0
- package/packages/device/src/driver/index.android.tv.ts +1 -0
- package/packages/device/src/driver/index.firetv.ts +1 -0
- package/packages/device/src/driver/index.smartcast.tv.ts +1 -0
- package/packages/device/src/getKeyDigit.ts +2 -2
- package/packages/device/src/resolver/resolver.ts +19 -0
- package/packages/digital-clock/src/DigitalClock.tsx +15 -4
- package/packages/driver-androidtv/src/DeviceAndroidTV.ts +262 -0
- package/packages/driver-androidtv/src/__mocks__/javaScriptBridge.ts +45 -0
- package/packages/driver-androidtv/src/formatUserAgent.ts +11 -0
- package/packages/driver-androidtv/src/index.ts +2 -0
- package/packages/driver-androidtv/src/keymap.ts +27 -0
- package/packages/driver-androidtv/src/types.ts +155 -0
- package/packages/driver-base/src/DeviceBase.ts +73 -2
- package/packages/driver-base/src/KeyMap/Key.ts +8 -1
- package/packages/driver-base/src/KeyMap/KeyMap.ts +4 -0
- package/packages/driver-base/src/KeyMap/interface.ts +1 -0
- package/packages/driver-base/src/KeyMap/overrideValues.ts +2 -1
- package/packages/driver-base/src/__mocks__/DeviceBase.ts +24 -0
- package/packages/driver-base/src/__mocks__/keyMap.ts +1 -0
- package/packages/driver-base/src/index.ts +3 -0
- package/packages/driver-base/src/types/AdInfo.ts +5 -0
- package/packages/driver-base/src/types/DeviceEvent.ts +2 -0
- package/packages/driver-base/src/types/InAppPurchase.ts +20 -0
- package/packages/driver-base/src/types/KeycodeKeyMap.ts +1 -0
- package/packages/driver-browser/src/DeviceBrowser.ts +26 -0
- package/packages/driver-browser/src/keymap.ts +8 -0
- package/packages/driver-entone/src/DeviceEntone.ts +31 -1
- package/packages/driver-entone/src/keymap.ts +1 -0
- package/packages/driver-firetv/src/DeviceFireTV.ts +86 -0
- package/packages/driver-firetv/src/__mocks__/javaScriptBridge.ts +45 -0
- package/packages/driver-firetv/src/index.ts +1 -0
- package/packages/driver-firetv/src/types.ts +1 -0
- package/packages/driver-hbbtv/src/DeviceHbbTV.ts +26 -0
- package/packages/driver-kreatv/src/DeviceKreaTV.ts +26 -0
- package/packages/driver-saphi/src/DeviceSaphi.ts +26 -0
- package/packages/driver-smartcast/src/DeviceSmartCast.ts +380 -0
- package/packages/driver-smartcast/src/__mocks__/api.ts +69 -0
- package/packages/driver-smartcast/src/index.ts +1 -0
- package/packages/driver-smartcast/src/keymap.ts +9 -0
- package/packages/driver-smartcast/src/types.ts +102 -0
- package/packages/driver-tizen/src/DeviceTizen.ts +121 -7
- package/packages/driver-tizen/src/ITizen.ts +15116 -202
- package/packages/driver-tizen/src/IWebapis.ts +8643 -87
- package/packages/driver-tizen/src/TizenKeys.ts +4 -2
- package/packages/driver-tizen/src/__mocks__/tizen.ts +7 -8
- package/packages/driver-tizen/src/constants.ts +1 -195
- package/packages/driver-vidaa/src/DeviceVidaa.ts +29 -2
- package/packages/driver-vidaa/src/__mocks__/vidaa.ts +1 -1
- package/packages/driver-vidaa/src/keymap.ts +2 -0
- package/packages/driver-webos/src/DeviceWebos.ts +55 -0
- package/packages/driver-webos/src/__mocks__/webos.ts +33 -0
- package/packages/driver-webos/src/constants.ts +1 -0
- package/packages/driver-webos/src/keymap.ts +2 -1
- package/packages/driver-webos/src/types.ts +30 -0
- package/packages/driver-xbox/src/DeviceXbox.ts +30 -1
- package/packages/driver-xbox/src/keymap.ts +1 -1
- package/packages/epg/README.md +3 -1
- package/packages/epg/src/v2/Cell.tsx +16 -2
- package/packages/epg/src/v2/DataManager.ts +112 -41
- package/packages/epg/src/v2/DatePicker.tsx +9 -3
- package/packages/epg/src/v2/DateToast/DateToast.tsx +12 -9
- package/packages/epg/src/v2/Day.tsx +6 -3
- package/packages/epg/src/v2/Epg.tsx +5 -5
- package/packages/epg/src/v2/MockGenerator/generator.ts +3 -2
- package/packages/epg/src/v2/ProgramInfo/utils.ts +4 -3
- package/packages/epg/src/v2/Row.tsx +3 -1
- package/packages/epg/src/v2/TimelineSection.tsx +4 -1
- package/packages/epg/src/v2/basic/CellsManager.tsx +7 -2
- package/packages/epg/src/v2/basic/RowsManager.tsx +3 -1
- package/packages/epg/src/v2/interface.ts +13 -0
- package/packages/events-manager/src/EventsManager.ts +1 -56
- package/packages/focus/README.md +33 -0
- package/packages/focus/src/IFocusable.ts +1 -0
- package/packages/focus/src/Layout/Base.tsx +41 -6
- package/packages/focus/src/Layout/Matrix.tsx +51 -19
- package/packages/focus/src/focusFirstExisting.ts +7 -1
- package/packages/focus/src/hasFocus.ts +36 -0
- package/packages/focus/src/index.ts +2 -1
- package/packages/gallup/src/Gallup.ts +3 -3
- package/packages/grid/src/Base/Base.tsx +15 -10
- package/packages/grid/src/FirstOnlyGrid/FirstOnlyGrid.tsx +4 -2
- package/packages/grid/src/UnifiedGridController/UnifiedGridController.ts +6 -6
- package/packages/icon/src/Icon.tsx +27 -5
- package/packages/input/README.md +1 -1
- package/packages/input/src/Input.tsx +10 -10
- package/packages/interactable/README.md +2 -1
- package/packages/interactable/src/Interactable.tsx +9 -3
- package/packages/interactable/src/interface.ts +1 -0
- package/packages/jsx/src/index.ts +1 -1
- package/packages/jsx/src/test-utils/index.ts +1 -0
- package/packages/jsx/src/test-utils/keyup.ts +27 -0
- package/packages/keyboard/README.md +2 -0
- package/packages/keyboard/src/Backdrop/Backdrop.scss +2 -0
- package/packages/keyboard/src/KeyboardBase.tsx +16 -4
- package/packages/keyboard/src/WhitelabelKeyboard/Keyboard.scss +10 -0
- package/packages/keyboard/src/WhitelabelKeyboard/Keyboard.tsx +128 -142
- package/packages/keyboard/src/WhitelabelKeyboard/WhitelabelStyles/whitelabel.scss +4 -0
- package/packages/keyboard/src/WhitelabelKeyboard/_sizes.1080.scss +1 -0
- package/packages/keyboard/src/WhitelabelKeyboard/_sizes.scss +1 -0
- package/packages/keyboard/src/WhitelabelKeyboard/icons/key_language.svg +20 -0
- package/packages/keyboard/src/WhitelabelKeyboard/index.ts +1 -1
- package/packages/keyboard/src/WhitelabelKeyboard/layouts/arabic.ts +27 -0
- package/packages/keyboard/src/WhitelabelKeyboard/layouts/burmese.ts +27 -0
- package/packages/keyboard/src/WhitelabelKeyboard/layouts/dari.ts +28 -0
- package/packages/keyboard/src/WhitelabelKeyboard/layouts/hebrew.ts +28 -0
- package/packages/keyboard/src/WhitelabelKeyboard/layouts/index.ts +15 -0
- package/packages/keyboard/src/WhitelabelKeyboard/layouts/korean.ts +26 -0
- package/packages/keyboard/src/WhitelabelKeyboard/layouts/latin.ts +26 -0
- package/packages/keyboard/src/WhitelabelKeyboard/layouts/pashto.ts +27 -0
- package/packages/keyboard/src/WhitelabelKeyboard/layouts/persian.ts +27 -0
- package/packages/keyboard/src/WhitelabelKeyboard/layouts/russian.ts +27 -0
- package/packages/keyboard/src/WhitelabelKeyboard/layouts/spanish.ts +26 -0
- package/packages/keyboard/src/WhitelabelKeyboard/layouts/special.ts +28 -0
- package/packages/keyboard/src/WhitelabelKeyboard/layouts/tibetan.ts +26 -0
- package/packages/keyboard/src/WhitelabelKeyboard/layouts/turkish.ts +26 -0
- package/packages/keyboard/src/WhitelabelKeyboard/layouts/ukrainian.ts +27 -0
- package/packages/keyboard/src/WhitelabelKeyboard/layouts/urdu.ts +26 -0
- package/packages/keyboard/src/WhitelabelKeyboard/types.ts +22 -2
- package/packages/keyboard/src/types/index.ts +1 -1
- package/packages/keyboard/src/utils/caret.ts +5 -8
- package/packages/keyboard/src/utils/input.ts +5 -6
- package/packages/keyboard/src/utils/setInputSelectionRange.ts +10 -0
- package/packages/l10n/README.md +18 -0
- package/packages/l10n/src/date/common.ts +18 -6
- package/packages/l10n/src/date/cs.ts +2 -8
- package/packages/l10n/src/date/de.ts +97 -0
- package/packages/l10n/src/date/en-001.ts +3 -3
- package/packages/l10n/src/date/en-common.ts +5 -4
- package/packages/l10n/src/date/en-us.ts +3 -3
- package/packages/l10n/src/date/es.ts +71 -0
- package/packages/l10n/src/date/fr.ts +94 -0
- package/packages/l10n/src/date/he.ts +101 -0
- package/packages/l10n/src/date/iso.ts +12 -13
- package/packages/l10n/src/date/types.ts +9 -0
- package/packages/l10n/src/l10n.ts +61 -3
- package/packages/list/src/Base/Base.tsx +19 -9
- package/packages/list/src/Base/interface.ts +2 -2
- package/packages/list/src/BasicList/BasicList.tsx +7 -7
- package/packages/list/src/CenteredList/CenteredList.tsx +2 -2
- package/packages/list/src/CenteredList/controller.ts +0 -1
- package/packages/list/src/EdgeOffsetList/EdgeOffsetList.tsx +10 -10
- 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/UnifiedListController/UnifiedListController.ts +6 -2
- package/packages/list/src/interface.ts +2 -2
- package/packages/logger/src/loggers/ConsoleLogger/ConsoleLogger.ts +7 -1
- package/packages/logger/src/loggers/SentryLogger/Sentry.ts +1 -0
- package/packages/logger/src/loggers/SentryLogger/SentryLogger.ts +5 -3
- package/packages/menu/src/MenuAndContentContainer/MenuAndContentContainer.tsx +31 -3
- package/packages/menu/src/MenuAndContentContainer/interface.ts +8 -0
- package/packages/modal-service/README.md +4 -1
- package/packages/modal-service/src/ModalService.tsx +29 -5
- package/packages/perf-utils/README.md +1 -120
- package/packages/perf-utils/src/array/filter.ts +1 -54
- package/packages/perf-utils/src/array/find.ts +1 -43
- package/packages/perf-utils/src/array/findIndex.ts +1 -43
- package/packages/perf-utils/src/array/forEach.ts +1 -48
- package/packages/perf-utils/src/array/includes.ts +1 -41
- package/packages/perf-utils/src/array/includesNaN.ts +1 -32
- package/packages/perf-utils/src/array/index.ts +1 -7
- package/packages/perf-utils/src/array/map.ts +1 -52
- package/packages/player-ui/README.md +1 -1
- package/packages/player-ui/src/CurrentTime.tsx +2 -2
- package/packages/player-ui/src/Duration.tsx +2 -2
- package/packages/player-ui/src/PauseButton.tsx +8 -0
- package/packages/player-ui/src/PlayerInteractable.tsx +1 -0
- package/packages/player-ui/src/PlayerTime.tsx +3 -1
- package/packages/player-ui/src/PlayerUI.tsx +68 -35
- package/packages/player-ui/src/RemainingTime.tsx +2 -2
- package/packages/player-ui/src/Seekbar.tsx +110 -18
- package/packages/player-ui/src/Seeking.ts +57 -16
- package/packages/player-ui/src/Subtitles.tsx +2 -2
- package/packages/player-ui/src/index.ts +1 -0
- package/packages/player-ui/src/mocks.ts +32 -8
- package/packages/player-ui/src/timeUtils.ts +3 -3
- package/packages/player-ui/src/types.ts +9 -3
- package/packages/router/README.md +1 -0
- package/packages/router/src/Route.tsx +61 -27
- package/packages/router/src/Router.tsx +63 -14
- package/packages/router/src/history.ts +8 -1
- package/packages/router/src/index.ts +1 -1
- package/packages/router/src/utils.ts +9 -4
- package/packages/sass-utils/src/linear-gradient.scss +9 -4
- package/packages/sass-utils/src/scale.1080.scss +3 -1
- package/packages/sass-utils/src/scale.720.scss +1 -1
- package/packages/time/README.md +4 -1
- package/packages/time/src/Time.ts +35 -13
- package/packages/time/src/adapters/24iMediaTimeApi.ts +47 -0
- package/packages/time/src/constants.ts +1 -0
- package/packages/time/src/services/24iMediaTimeApi/24iMediaTimeApi.ts +43 -0
- package/packages/time/src/services/24iMediaTimeApi/index.ts +6 -0
- package/packages/toast/src/ToastService.scss +1 -0
- package/packages/toast/src/ToastService.tsx +16 -5
- package/packages/types-bigscreen-jsx/README.md +5 -4
- package/packages/types-bigscreen-jsx/index.d.ts +72 -67
- package/packages/utils/README.md +27 -0
- package/packages/utils/src/elementUtils.ts +25 -0
- package/packages/utils/src/forceReflow.ts +14 -0
- package/packages/utils/src/index.ts +8 -0
- package/packages/utils/src/keyPress/index.ts +6 -0
- package/packages/utils/src/keyPress/keyPressSimulator.ts +74 -0
- package/packages/utils/src/keyPress/simulateKeyPress.ts +25 -0
- package/packages/utils/src/scaledImage.ts +6 -3
- package/packages/utils/src/textUtils.ts +46 -14
- package/packages/utils/src/wait.ts +3 -1
- package/packages/utils/src/xhr/xhrSend.ts +3 -1
- package/packages/utils/src/xhr/xhrSendRetry.ts +3 -1
- package/packages/zapping/src/ChannelZapping.ts +9 -0
- package/packages/zapping/src/Zapping.tsx +10 -0
- package/utils/release/release.ts +156 -0
- package/packages/driver-tizen/src/types.ts +0 -14
- package/packages/focus/src/Layout/__test__/Base.spec.ts +0 -180
- package/packages/focus/src/Layout/__test__/Horizontal.spec.ts +0 -94
- package/packages/focus/src/Layout/__test__/Matrix.spec.ts +0 -261
- package/packages/focus/src/Layout/__test__/Vertical.spec.ts +0 -46
- package/packages/focus/src/Layout/__test__/isRtl.spec.ts +0 -23
- package/packages/focus/src/Layout/__test__/shared.ts +0 -19
- package/packages/keyboard/src/WhitelabelKeyboard/focusMatrix.ts +0 -19
|
@@ -0,0 +1,380 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DeviceBase, ConnectionType, ScreenSaverStatus, VolumeRange,
|
|
3
|
+
IAPSuccessPayload,
|
|
4
|
+
IAPPurchaseProductData,
|
|
5
|
+
} from '@24i/bigscreen-sdk/driver-base';
|
|
6
|
+
import { runAsync } from '@24i/bigscreen-sdk/utils/timers';
|
|
7
|
+
import { ipify } from '@24i/bigscreen-sdk/ipify';
|
|
8
|
+
import { VendorType } from '@24i/smartapps-datalayer/api';
|
|
9
|
+
import { getKeyMap } from './keymap';
|
|
10
|
+
import {
|
|
11
|
+
ISmartCastApi,
|
|
12
|
+
IFA,
|
|
13
|
+
DEFAULT_TTS_TIMEOUT,
|
|
14
|
+
DevicePlaybackQuality,
|
|
15
|
+
DeviceLanguage,
|
|
16
|
+
PurchaseData,
|
|
17
|
+
} from './types';
|
|
18
|
+
|
|
19
|
+
declare const window: Window & { VIZIO: ISmartCastApi };
|
|
20
|
+
|
|
21
|
+
export class DeviceSmartCast extends DeviceBase {
|
|
22
|
+
keyMap = getKeyMap();
|
|
23
|
+
|
|
24
|
+
deviceId = '';
|
|
25
|
+
|
|
26
|
+
deviceModel = '';
|
|
27
|
+
|
|
28
|
+
deviceFirmware = '';
|
|
29
|
+
|
|
30
|
+
readonly backAsBackspaceInSearch = true;
|
|
31
|
+
|
|
32
|
+
devicePlaybackQualities: DevicePlaybackQuality[] = [];
|
|
33
|
+
|
|
34
|
+
closedCaptionsStatus = false;
|
|
35
|
+
|
|
36
|
+
textToSpeechStatus = false;
|
|
37
|
+
|
|
38
|
+
textToSpeechTimeout?: null | number;
|
|
39
|
+
|
|
40
|
+
lastTextToSpeechItem?: { delay: number, text: string } | null;
|
|
41
|
+
|
|
42
|
+
deviceLanguage?: DeviceLanguage;
|
|
43
|
+
|
|
44
|
+
API?: ISmartCastApi;
|
|
45
|
+
|
|
46
|
+
IFA?: IFA;
|
|
47
|
+
|
|
48
|
+
publicIpAddress?: string;
|
|
49
|
+
|
|
50
|
+
async initDevice() {
|
|
51
|
+
this.initNetworkChangeListener();
|
|
52
|
+
this.initVisibilityChangeListener();
|
|
53
|
+
this.initMouseActiveListener();
|
|
54
|
+
await this.initPlatformApiListeners();
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
async initPlatformApiListeners(): Promise<void> {
|
|
58
|
+
return new Promise((resolve) => {
|
|
59
|
+
document.addEventListener('VIZIO_LIBRARY_DID_LOAD', async () => {
|
|
60
|
+
const API = window.VIZIO;
|
|
61
|
+
this.API = window.VIZIO;
|
|
62
|
+
const promises = [];
|
|
63
|
+
|
|
64
|
+
API.setClosedCaptionHandler((isEnabled: boolean) => {
|
|
65
|
+
this.closedCaptionsStatus = isEnabled;
|
|
66
|
+
this.triggerEvent('cctoggle', { isEnabled });
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
promises.push(new Promise<void>((r) => {
|
|
70
|
+
API.setAdvertiserIDListener((advertiserID: IFA) => {
|
|
71
|
+
this.IFA = advertiserID;
|
|
72
|
+
r();
|
|
73
|
+
});
|
|
74
|
+
}));
|
|
75
|
+
|
|
76
|
+
promises.push(new Promise<void>((r) => {
|
|
77
|
+
API.getDeviceId((id: string) => {
|
|
78
|
+
this.deviceId = id;
|
|
79
|
+
r();
|
|
80
|
+
});
|
|
81
|
+
}));
|
|
82
|
+
|
|
83
|
+
this.deviceModel = API.deviceModel;
|
|
84
|
+
|
|
85
|
+
promises.push(new Promise<void>((r) => {
|
|
86
|
+
API.getFirmwareVersion((version: string) => {
|
|
87
|
+
this.deviceFirmware = version;
|
|
88
|
+
r();
|
|
89
|
+
});
|
|
90
|
+
}));
|
|
91
|
+
|
|
92
|
+
promises.push(new Promise<void>((r) => {
|
|
93
|
+
API.getDevicePlaybackQualities((qualities: DevicePlaybackQuality[]) => {
|
|
94
|
+
this.devicePlaybackQualities = qualities;
|
|
95
|
+
r();
|
|
96
|
+
});
|
|
97
|
+
}));
|
|
98
|
+
|
|
99
|
+
promises.push(new Promise<void>((r) => {
|
|
100
|
+
API.setDeviceLanguageHandler((deviceLanguage: DeviceLanguage) => {
|
|
101
|
+
this.deviceLanguage = deviceLanguage;
|
|
102
|
+
r();
|
|
103
|
+
});
|
|
104
|
+
}));
|
|
105
|
+
|
|
106
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
107
|
+
API.setContentChangeHandler(this.handleDeeplink);
|
|
108
|
+
|
|
109
|
+
await Promise.all(promises);
|
|
110
|
+
|
|
111
|
+
resolve();
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
document.addEventListener('VIZIO_TTS_ENABLED', () => {
|
|
115
|
+
this.textToSpeechStatus = true;
|
|
116
|
+
}, false);
|
|
117
|
+
|
|
118
|
+
document.addEventListener('VIZIO_TTS_DISABLED', () => {
|
|
119
|
+
this.lastTextToSpeechItem = null;
|
|
120
|
+
this.textToSpeechStatus = false;
|
|
121
|
+
window.clearTimeout(this.textToSpeechTimeout as any);
|
|
122
|
+
this.API?.Chromevox.cancel();
|
|
123
|
+
}, false);
|
|
124
|
+
|
|
125
|
+
const object = document.createElement('script');
|
|
126
|
+
object.src = 'http://127.0.0.1:12345/scfs/cl/js/vizio-companion-lib.js';
|
|
127
|
+
document.body.appendChild(object);
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
initNetworkChangeListener() {
|
|
132
|
+
window.addEventListener('online', () => {
|
|
133
|
+
this.triggerEvent('networkchange', { isConnected: true });
|
|
134
|
+
});
|
|
135
|
+
window.addEventListener('offline', () => {
|
|
136
|
+
this.triggerEvent('networkchange', { isConnected: false });
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
initVisibilityChangeListener() {
|
|
141
|
+
document.addEventListener('visibilitychange', () => {
|
|
142
|
+
this.triggerEvent('visibilitychange', {
|
|
143
|
+
isVisible: document.visibilityState === 'visible',
|
|
144
|
+
});
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
initMouseActiveListener() {
|
|
149
|
+
document.addEventListener('mousemove', this.onMouseActive);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
onMouseActive = () => {
|
|
153
|
+
document.removeEventListener('mousemove', this.onMouseActive);
|
|
154
|
+
document.addEventListener('keydown', this.onMouseInactive, true);
|
|
155
|
+
this.isMouseActive = true;
|
|
156
|
+
this.triggerEvent('mouseactive', { isMouseActive: true });
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
onMouseInactive = (event: KeyboardEvent) => {
|
|
160
|
+
if (!this.isDirectionalArrow(event)) return;
|
|
161
|
+
document.removeEventListener('keydown', this.onMouseInactive);
|
|
162
|
+
this.initMouseActiveListener();
|
|
163
|
+
|
|
164
|
+
// to let other handlers to use this property before change
|
|
165
|
+
runAsync(() => {
|
|
166
|
+
this.isMouseActive = false;
|
|
167
|
+
});
|
|
168
|
+
this.triggerEvent('mouseactive', { isMouseActive: false });
|
|
169
|
+
};
|
|
170
|
+
|
|
171
|
+
handleDeeplink = (deeplinkUrl: string) => {
|
|
172
|
+
if (typeof deeplinkUrl !== 'string') return;
|
|
173
|
+
const newRoute = deeplinkUrl.split('#')[1];
|
|
174
|
+
if (newRoute) {
|
|
175
|
+
const currentUrl = window.location.href.split('#')[0];
|
|
176
|
+
window.location.href = `${currentUrl}#${newRoute}`;
|
|
177
|
+
}
|
|
178
|
+
};
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* Reads provided text by the device internal reader.
|
|
182
|
+
*/
|
|
183
|
+
readText({ text, delay = DEFAULT_TTS_TIMEOUT }: {
|
|
184
|
+
text: string, delay?: number
|
|
185
|
+
}) {
|
|
186
|
+
if (this.textToSpeechStatus && text) {
|
|
187
|
+
if (this.textToSpeechTimeout) {
|
|
188
|
+
this.lastTextToSpeechItem = { text, delay };
|
|
189
|
+
} else {
|
|
190
|
+
this.API?.Chromevox.play(text);
|
|
191
|
+
|
|
192
|
+
this.textToSpeechTimeout = window.setTimeout(() => {
|
|
193
|
+
this.textToSpeechTimeout = null;
|
|
194
|
+
|
|
195
|
+
if (this.lastTextToSpeechItem) {
|
|
196
|
+
const last = this.lastTextToSpeechItem;
|
|
197
|
+
|
|
198
|
+
this.API?.Chromevox.play(last.text);
|
|
199
|
+
this.lastTextToSpeechItem = null;
|
|
200
|
+
}
|
|
201
|
+
}, delay);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
exit() {
|
|
207
|
+
this.API?.exitApplication();
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
reboot() {
|
|
211
|
+
window.location.reload();
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* Returns the status of Closed Captions feature.
|
|
216
|
+
*/
|
|
217
|
+
async getClosedCaptionsStatus() {
|
|
218
|
+
return this.closedCaptionsStatus;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* Returns the status of Text to Speech Engine if it is available by the device.
|
|
223
|
+
*/
|
|
224
|
+
async getTextToSpeechStatus() {
|
|
225
|
+
return this.textToSpeechStatus;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* Returns filled in Vast Tag URL.
|
|
230
|
+
*/
|
|
231
|
+
async getVastTagUrl(template: string): Promise<null | string> {
|
|
232
|
+
const IFAObject = this.IFA;
|
|
233
|
+
const resolution = this.getResolution();
|
|
234
|
+
|
|
235
|
+
if (!IFAObject) return null;
|
|
236
|
+
|
|
237
|
+
this.publicIpAddress = this.publicIpAddress ?? await ipify();
|
|
238
|
+
|
|
239
|
+
return template
|
|
240
|
+
.replace('{{width}}', String(resolution.width))
|
|
241
|
+
.replace('{{height}}', String(resolution.height))
|
|
242
|
+
.replace('{{cb}}', String(Date.now()))
|
|
243
|
+
.replace('{{user_agent}}', encodeURIComponent(window.navigator.userAgent))
|
|
244
|
+
.replace('{{ifa}}', IFAObject.IFA)
|
|
245
|
+
.replace('{{ifa_type}}', IFAObject.IFA_TYPE)
|
|
246
|
+
.replace('{{ip_address}}', this.publicIpAddress!)
|
|
247
|
+
.replace('{{lmt}}', IFAObject.LMT ? '1' : '0')
|
|
248
|
+
.replace('{{us_privacy}}', IFAObject.LMT ? '1YYN' : '1YNN');
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
async getManufacturerName() {
|
|
252
|
+
return 'VIZIO';
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
async getPlatformName() {
|
|
256
|
+
return 'SmartCast';
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
async getPlatformVersion() {
|
|
260
|
+
return '';
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
async getDeviceName() {
|
|
264
|
+
return 'VIZIO SmartCast';
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
async getModelName() {
|
|
268
|
+
return this.deviceModel;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
async getFirmware() {
|
|
272
|
+
return this.deviceFirmware;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
async is4KSupported() {
|
|
276
|
+
return this.devicePlaybackQualities.includes('UHD');
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
async is8KSupported() {
|
|
280
|
+
return false;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
async getUuid() {
|
|
284
|
+
return this.deviceId;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
async getAdInfo() {
|
|
288
|
+
const adId = this.IFA?.IFA ?? null;
|
|
289
|
+
const type = this.IFA?.IFA_TYPE ?? 'vida';
|
|
290
|
+
const latEnabled = (this.IFA?.LMT !== null || this.IFA?.LMT !== undefined)
|
|
291
|
+
? Boolean(this.IFA?.LMT)
|
|
292
|
+
: true;
|
|
293
|
+
return { adId, type, latEnabled };
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
async getOsLanguage() {
|
|
297
|
+
return this.deviceLanguage?.code || '';
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
async getVolume() {
|
|
301
|
+
return VolumeRange.UNSUPPORTED;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
305
|
+
async setVolume(volumePercentage: number) {
|
|
306
|
+
// not supported on SmartCast platform
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
310
|
+
async mute(mute: boolean) {
|
|
311
|
+
// not supported on SmartCast platform
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
async isMute() {
|
|
315
|
+
return false;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
async getScreenSaver() {
|
|
319
|
+
return { enabled: false };
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
323
|
+
async setScreenSaver(status: ScreenSaverStatus) {
|
|
324
|
+
// not supported on SmartCast platform
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
328
|
+
async setUserAgent(userAgent: string) {
|
|
329
|
+
return false;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
async getConnectionType() {
|
|
333
|
+
return 'unknown' as ConnectionType;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
async isNetworkConnected() {
|
|
337
|
+
return window.navigator.onLine;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
async getLocalIP() {
|
|
341
|
+
// not supported on SmartCast platform
|
|
342
|
+
return '';
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
async getMacAddress() {
|
|
346
|
+
// not supported on SmartCast platform
|
|
347
|
+
return '';
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
registerPartner(callback: (challenge: string) => Promise<string>, appKeyId: string) {
|
|
351
|
+
this.API!.Account.registerPartner(callback, appKeyId);
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
async checkAndLinkTv() {
|
|
355
|
+
const isLinked = await this.API!.Account.getLinkStatus();
|
|
356
|
+
if (!isLinked) await this.API!.Account.startTVLink();
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
async purchaseProduct({ sku, serviceId }: IAPPurchaseProductData): Promise<IAPSuccessPayload> {
|
|
360
|
+
await this.checkAndLinkTv();
|
|
361
|
+
await this.API!.Account.getPlans({ includeBundlePlans: true });
|
|
362
|
+
const purchaseResult = await this.API!.Account.startSVODPurchase(
|
|
363
|
+
sku, serviceId ?? '',
|
|
364
|
+
);
|
|
365
|
+
const receiptPayload: PurchaseData = {
|
|
366
|
+
customerId: purchaseResult.data.customerId,
|
|
367
|
+
partnerAccountId: purchaseResult.data.partnerAccountId,
|
|
368
|
+
planCode: purchaseResult.data.planCode,
|
|
369
|
+
addOnCodes: purchaseResult.data.addOnCodes,
|
|
370
|
+
subscriptionId: purchaseResult.data.subscriptionId,
|
|
371
|
+
};
|
|
372
|
+
return { platform: VendorType.VIZIO, receiptPayload };
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
376
|
+
async cancelSubscription(data: IAPPurchaseProductData): Promise<void> {
|
|
377
|
+
// not supported
|
|
378
|
+
throw new Error('Not supported');
|
|
379
|
+
}
|
|
380
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { IFA, ISmartCastApi, DevicePlaybackQuality, DeviceLanguage } from '../types';
|
|
2
|
+
|
|
3
|
+
export const deviceId = '2bd671ef-02cd-445f-9295-b3565dbaf1e8';
|
|
4
|
+
export const deviceModel = 'D24f4-J01';
|
|
5
|
+
export const firmware = '3.520.28.1-2';
|
|
6
|
+
export const playbackQualities = ['UHD', 'HD'] as DevicePlaybackQuality[];
|
|
7
|
+
// eslint-disable-next-line max-len
|
|
8
|
+
export const deeplinkUrl = 'https://smartapps-bigscreen.24i.com/#/detail/SERIES/FO03OogBXRsigNB1VRz_/undefined/undefined/';
|
|
9
|
+
// eslint-disable-next-line max-len
|
|
10
|
+
export const deeplinkUrl2 = 'https://smartapps-bigscreen.24i.com/#/detail/SERIES/Ge1sO4gBXRsigNB1TBwy/undefined/undefined/';
|
|
11
|
+
// eslint-disable-next-line max-len
|
|
12
|
+
export const vastTagTemplate = 'w={{width}}&h={{height}}&did={{ifa}}&ifa_type={{ifa_type}}&lmt={{lmt}}&ip={{ip_address}}&us_privacy={{us_privacy}}';
|
|
13
|
+
|
|
14
|
+
export const SmartCastMockApi: ISmartCastApi = {
|
|
15
|
+
deviceModel,
|
|
16
|
+
|
|
17
|
+
getDeviceId: (callback: (id: string) => void): void => callback(deviceId),
|
|
18
|
+
|
|
19
|
+
getFirmwareVersion: (callback: (id: string) => void): void => callback(firmware),
|
|
20
|
+
|
|
21
|
+
getDevicePlaybackQualities: (
|
|
22
|
+
callback: (
|
|
23
|
+
qualities: DevicePlaybackQuality[]
|
|
24
|
+
) => void,
|
|
25
|
+
): void => callback(playbackQualities),
|
|
26
|
+
|
|
27
|
+
exitApplication: (): void => {},
|
|
28
|
+
|
|
29
|
+
setClosedCaptionHandler: (callback: (isEnabled: boolean) => void): void => callback(false),
|
|
30
|
+
|
|
31
|
+
setAdvertiserIDListener: (callback: (advertiserID: IFA) => void): void => callback({
|
|
32
|
+
IFA: deviceId,
|
|
33
|
+
IFA_TYPE: 'vida',
|
|
34
|
+
LMT: 0,
|
|
35
|
+
}),
|
|
36
|
+
|
|
37
|
+
setContentChangeHandler:
|
|
38
|
+
(callback: (contentUrl: string) => void): void => callback(deeplinkUrl),
|
|
39
|
+
|
|
40
|
+
setDeviceLanguageHandler: (
|
|
41
|
+
callback: (deviceLanguage: DeviceLanguage) => void,
|
|
42
|
+
): void => callback({ code: 'en', name: 'English' }),
|
|
43
|
+
|
|
44
|
+
Chromevox: {
|
|
45
|
+
cancel: (): void => {
|
|
46
|
+
throw new Error('Function not implemented.');
|
|
47
|
+
},
|
|
48
|
+
play: (text: string): void => {
|
|
49
|
+
// eslint-disable-next-line no-console
|
|
50
|
+
console.log(text);
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
|
|
54
|
+
Account: {
|
|
55
|
+
startSVODPurchase: async () => ({
|
|
56
|
+
id: 'id',
|
|
57
|
+
data: {
|
|
58
|
+
customerId: 'customerId',
|
|
59
|
+
partnerAccountId: 'partnerAccountId',
|
|
60
|
+
planCode: 'planCode',
|
|
61
|
+
subscriptionId: 'subscriptionId',
|
|
62
|
+
},
|
|
63
|
+
}),
|
|
64
|
+
registerPartner: jest.fn(),
|
|
65
|
+
getLinkStatus: async () => true,
|
|
66
|
+
startTVLink: async () => ({}),
|
|
67
|
+
getPlans: async () => ({ id: 'id', data: [] }),
|
|
68
|
+
},
|
|
69
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { DeviceSmartCast } from './DeviceSmartCast';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { generateKeyCodeKeyMap, overrideValues } from '@24i/bigscreen-sdk/driver-base/keymap';
|
|
2
|
+
|
|
3
|
+
export const getKeyMap = () => {
|
|
4
|
+
overrideValues({
|
|
5
|
+
CHANNEL_PREVIOUS: { code: 'PrevCh', keyCode: 500 },
|
|
6
|
+
SUBTITLES: { keyCode: 204 },
|
|
7
|
+
});
|
|
8
|
+
return generateKeyCodeKeyMap();
|
|
9
|
+
};
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
export type ISmartCastApi = {
|
|
2
|
+
/**
|
|
3
|
+
* Sets the callback to receive the device UID in standard 32 digits.
|
|
4
|
+
*/
|
|
5
|
+
getDeviceId: (callback: (id: string) => void) => void;
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Sets the callback to receive the device firmware version.
|
|
9
|
+
*/
|
|
10
|
+
getFirmwareVersion: (callback: (firmwareVersion: string) => void) => void;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Sets the callback to receive the device playback qualities.
|
|
14
|
+
*/
|
|
15
|
+
getDevicePlaybackQualities: (callback: (qualities: DevicePlaybackQuality[]) => void) => void;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Exits the application.
|
|
19
|
+
*/
|
|
20
|
+
exitApplication: () => void;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Sets the callback to receive the device CC toggle event.
|
|
24
|
+
*/
|
|
25
|
+
setClosedCaptionHandler: (callback: (isEnabled: boolean) => void) => void;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Sets the callback to receive IFA object with the device ads related parameters.
|
|
29
|
+
*/
|
|
30
|
+
setAdvertiserIDListener: (callback: (advertiserID: IFA) => void) => void;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Sets the callback to receive the device content change event.
|
|
34
|
+
*/
|
|
35
|
+
setContentChangeHandler: (callback: (contentUrl: string) => void) => void;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Sets the callback to receive device language object.
|
|
39
|
+
*/
|
|
40
|
+
setDeviceLanguageHandler: (callback: (deviceLanguage: DeviceLanguage) => void) => void;
|
|
41
|
+
|
|
42
|
+
Account: {
|
|
43
|
+
startSVODPurchase: (
|
|
44
|
+
planCode: string,
|
|
45
|
+
partnerAccountId: string,
|
|
46
|
+
couponCode?: string,
|
|
47
|
+
addOnCodes?: string[],
|
|
48
|
+
noFreeTrial?: boolean,
|
|
49
|
+
) => Promise<{ id: string, data: PurchaseData }>
|
|
50
|
+
registerPartner: (callback:(challenge: string) => Promise<string>, keyId: string) => void
|
|
51
|
+
getLinkStatus: () => Promise<boolean>
|
|
52
|
+
startTVLink: () => Promise<object>
|
|
53
|
+
getPlans: (options: { includeBundlePlans?: boolean }) => Promise<{
|
|
54
|
+
id: string, data: object[]
|
|
55
|
+
}>
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Device model.
|
|
60
|
+
*/
|
|
61
|
+
deviceModel: string;
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Chromevox Text-to-Speech accessibility playback engine.
|
|
65
|
+
*/
|
|
66
|
+
Chromevox: {
|
|
67
|
+
cancel: () => void,
|
|
68
|
+
play: (text: string) => void,
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
/**
|
|
72
|
+
* Data type when purchase successfull.
|
|
73
|
+
*/
|
|
74
|
+
|
|
75
|
+
export type PurchaseData = {
|
|
76
|
+
customerId: string,
|
|
77
|
+
partnerAccountId: string,
|
|
78
|
+
planCode: string,
|
|
79
|
+
addOnCodes?: string[],
|
|
80
|
+
subscriptionId: string
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Identifier For Advertising (IFA) and Limited Tracking parameter object
|
|
85
|
+
*/
|
|
86
|
+
export type IFA = {
|
|
87
|
+
/** Unique identifier string for advertising */
|
|
88
|
+
IFA: string,
|
|
89
|
+
/** String value for IFA type ("vida") */
|
|
90
|
+
IFA_TYPE: string,
|
|
91
|
+
/** 0=Limited tracking not enabled, 1=Limited tracking enabled */
|
|
92
|
+
LMT: 0 | 1,
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
export type DevicePlaybackQuality = 'UHD' | 'HD' | 'SD';
|
|
96
|
+
|
|
97
|
+
export const DEFAULT_TTS_TIMEOUT = 3000;
|
|
98
|
+
|
|
99
|
+
export type DeviceLanguage = {
|
|
100
|
+
code: string,
|
|
101
|
+
name: string,
|
|
102
|
+
};
|