@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
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRef, Component, DeclareProps } from '@24i/bigscreen-sdk/jsx';
|
|
2
2
|
|
|
3
3
|
export type Props = {
|
|
4
|
-
src
|
|
4
|
+
src?: string;
|
|
5
5
|
clearBeforeLoading?: boolean;
|
|
6
6
|
onImageLoad?: (src: string) => void;
|
|
7
7
|
onImageError?: (src: string) => void;
|
|
@@ -17,6 +17,7 @@ export class AsyncImage extends Component<Props> {
|
|
|
17
17
|
isCleared = true;
|
|
18
18
|
|
|
19
19
|
static defaultProps = {
|
|
20
|
+
src: undefined,
|
|
20
21
|
clearBeforeLoading: true,
|
|
21
22
|
};
|
|
22
23
|
|
|
@@ -30,7 +31,7 @@ export class AsyncImage extends Component<Props> {
|
|
|
30
31
|
|
|
31
32
|
componentDidMount() {
|
|
32
33
|
const { src } = this.props;
|
|
33
|
-
this.updateImage(src);
|
|
34
|
+
this.updateImage(src!);
|
|
34
35
|
}
|
|
35
36
|
|
|
36
37
|
private readonly onLoad = () => {
|
|
@@ -47,27 +48,31 @@ export class AsyncImage extends Component<Props> {
|
|
|
47
48
|
private readonly onError = () => {
|
|
48
49
|
if (this.isMounted) {
|
|
49
50
|
const { onImageError } = this.props;
|
|
50
|
-
this.
|
|
51
|
+
this.clearBackground();
|
|
51
52
|
if (typeof onImageError === 'function') {
|
|
52
53
|
onImageError(this.src);
|
|
53
54
|
}
|
|
54
55
|
}
|
|
55
56
|
};
|
|
56
57
|
|
|
57
|
-
private
|
|
58
|
+
private clearBackground() {
|
|
58
59
|
if (!this.isCleared) {
|
|
59
60
|
this.domRef.current!.style.backgroundImage = '';
|
|
60
61
|
this.isCleared = true;
|
|
61
62
|
}
|
|
62
63
|
}
|
|
63
64
|
|
|
65
|
+
clearImage() {
|
|
66
|
+
this.src = '';
|
|
67
|
+
this.clearBackground();
|
|
68
|
+
}
|
|
69
|
+
|
|
64
70
|
updateImage(src: string) {
|
|
65
|
-
if (src
|
|
66
|
-
if (
|
|
71
|
+
if (typeof src !== 'string') return;
|
|
72
|
+
if (src === '') {
|
|
67
73
|
this.src = '';
|
|
68
|
-
this.
|
|
69
|
-
|
|
70
|
-
} else {
|
|
74
|
+
this.onError();
|
|
75
|
+
} else if (src !== this.src) {
|
|
71
76
|
this.src = src;
|
|
72
77
|
this.loadImage(src);
|
|
73
78
|
}
|
|
@@ -77,7 +82,7 @@ export class AsyncImage extends Component<Props> {
|
|
|
77
82
|
const { props: { clearBeforeLoading }, image } = this;
|
|
78
83
|
image.src = src;
|
|
79
84
|
if (clearBeforeLoading === true && !image.complete) {
|
|
80
|
-
this.
|
|
85
|
+
this.clearBackground();
|
|
81
86
|
}
|
|
82
87
|
}
|
|
83
88
|
|
|
@@ -351,6 +351,7 @@ export class DeveloperConsole extends Component<Props> implements IDeveloperTool
|
|
|
351
351
|
ref={this.developerConsoleRef}
|
|
352
352
|
onKeyDown={this.onKeyDown}
|
|
353
353
|
tabIndex={0}
|
|
354
|
+
dir="ltr"
|
|
354
355
|
>
|
|
355
356
|
<div className="developer-console-panel" ref={this.developerConsolePanelRef} />
|
|
356
357
|
<div className="developer-console-controls">
|
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
import { BACK } from '@24i/bigscreen-sdk/device/keymap';
|
|
8
8
|
import { DISPLAY_NONE, getDisplayToggler, stopEvent } from '@24i/bigscreen-sdk/utils';
|
|
9
9
|
import { map } from '@24i/bigscreen-sdk/perf-utils/array';
|
|
10
|
+
import { Storage } from '@24i/bigscreen-sdk/storage';
|
|
10
11
|
import { IDeveloperTool, DeveloperToolProps } from '../IDeveloperTool';
|
|
11
12
|
import { DeveloperToolItem } from './DeveloperToolItem';
|
|
12
13
|
import { reloadApp } from '../utils/reload';
|
|
@@ -39,6 +40,11 @@ export class DeveloperToolsList extends Component<Props> {
|
|
|
39
40
|
reloadApp();
|
|
40
41
|
};
|
|
41
42
|
|
|
43
|
+
async onClearDataToolPress() {
|
|
44
|
+
await Storage.clear();
|
|
45
|
+
reloadApp();
|
|
46
|
+
}
|
|
47
|
+
|
|
42
48
|
onKeyDown = (event: KeyboardEvent) => {
|
|
43
49
|
if (BACK.is(event)) {
|
|
44
50
|
const { onBack } = this.props;
|
|
@@ -90,6 +96,11 @@ export class DeveloperToolsList extends Component<Props> {
|
|
|
90
96
|
/>
|
|
91
97
|
);
|
|
92
98
|
})}
|
|
99
|
+
<DeveloperToolItem
|
|
100
|
+
ref={this.getNavigationRef()}
|
|
101
|
+
label="Clear data"
|
|
102
|
+
onPress={this.onClearDataToolPress}
|
|
103
|
+
/>
|
|
93
104
|
<DeveloperToolItem
|
|
94
105
|
ref={this.getNavigationRef()}
|
|
95
106
|
label="Restart app"
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { Component, createRef, DeclareProps } from '@24i/bigscreen-sdk/jsx';
|
|
2
2
|
import { DISPLAY_NONE, getDisplayToggler } from '@24i/bigscreen-sdk/utils';
|
|
3
3
|
import { createInterval } from '@24i/bigscreen-sdk/utils/timers';
|
|
4
|
-
import { IMediaInfo, PlayerBase } from '@24i/
|
|
4
|
+
import { IMediaInfo, PlayerBase } from '@24i/bigscreen-players-engine-base';
|
|
5
5
|
import { IDeveloperTool } from '../IDeveloperTool';
|
|
6
6
|
import { MEDIA_INFO_DESCRIPTION, MediaInfo } from './constants';
|
|
7
7
|
|
|
8
8
|
export type Props = {
|
|
9
|
-
playerInstance?: PlayerBase
|
|
9
|
+
playerInstance?: PlayerBase;
|
|
10
10
|
updateInterval?: number;
|
|
11
11
|
onClose?: () => void;
|
|
12
12
|
};
|
|
@@ -16,7 +16,7 @@ export class PlayerDebugWindow extends Component<Props> implements IDeveloperToo
|
|
|
16
16
|
|
|
17
17
|
div = createRef<HTMLDivElement>();
|
|
18
18
|
|
|
19
|
-
playerInstance: PlayerBase
|
|
19
|
+
playerInstance: PlayerBase | null = null;
|
|
20
20
|
|
|
21
21
|
interval = createInterval();
|
|
22
22
|
|
|
@@ -34,12 +34,12 @@ export class PlayerDebugWindow extends Component<Props> implements IDeveloperToo
|
|
|
34
34
|
if (playerInstance) this.setPlayerInstance(playerInstance);
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
setPlayerInstance(playerInstance: PlayerBase
|
|
37
|
+
setPlayerInstance(playerInstance: PlayerBase) {
|
|
38
38
|
this.playerInstance = playerInstance;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
getMediaInfo() {
|
|
42
|
-
return this.playerInstance?.
|
|
42
|
+
return this.playerInstance?.mediaInfo || {};
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
getFormattedValue(item: MediaInfo, value: any) {
|
|
@@ -49,6 +49,21 @@ export const MEDIA_INFO_DESCRIPTION: Record<string, MediaInfo> = {
|
|
|
49
49
|
audioCodec: {
|
|
50
50
|
title: 'Audio codec',
|
|
51
51
|
},
|
|
52
|
+
audioBitrate: {
|
|
53
|
+
title: 'Audio bitrate',
|
|
54
|
+
},
|
|
55
|
+
audioSamplingRate: {
|
|
56
|
+
title: 'Audio sampling rate',
|
|
57
|
+
},
|
|
58
|
+
audioLanguage: {
|
|
59
|
+
title: 'Audio language',
|
|
60
|
+
},
|
|
61
|
+
subtitlesAvailable: {
|
|
62
|
+
title: 'Subtitles available',
|
|
63
|
+
},
|
|
64
|
+
availableSubtitlesListString: {
|
|
65
|
+
title: 'List of available subtitles',
|
|
66
|
+
},
|
|
52
67
|
drmProtection: {
|
|
53
68
|
title: 'DRM protection',
|
|
54
69
|
},
|
|
@@ -88,6 +88,7 @@ export class TechnicalInfo extends Component<Props> implements IDeveloperTool<Pr
|
|
|
88
88
|
ref={this.horizontalNavigation}
|
|
89
89
|
domRef={this.rootRef}
|
|
90
90
|
focusableChildren={[this.technicalInfoRef, this.closeButtonRef]}
|
|
91
|
+
dir="ltr"
|
|
91
92
|
>
|
|
92
93
|
<div className="content">
|
|
93
94
|
<TechnicalInfoDetail
|
|
@@ -117,6 +118,7 @@ export class TechnicalInfo extends Component<Props> implements IDeveloperTool<Pr
|
|
|
117
118
|
ref={this.rootRef}
|
|
118
119
|
className={`technical-info ${DISPLAY_NONE}`}
|
|
119
120
|
onKeyDown={this.onKeyDown}
|
|
121
|
+
dir="ltr"
|
|
120
122
|
/>
|
|
121
123
|
);
|
|
122
124
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { createRef, Component } from '@24i/bigscreen-sdk/jsx';
|
|
2
|
+
import { hasFocus } from '@24i/bigscreen-sdk/focus';
|
|
2
3
|
import { ScrollText } from '@24i/bigscreen-sdk/scroll-text';
|
|
3
4
|
import { map } from '@24i/bigscreen-sdk/perf-utils/array';
|
|
4
5
|
import { ITechnicalInfoProvider, TechnicalInfoData } from './ITechnicalInfoProvider';
|
|
@@ -38,7 +39,7 @@ class TechnicalInfoDetail extends Component<Props> {
|
|
|
38
39
|
}
|
|
39
40
|
|
|
40
41
|
hasFocus() {
|
|
41
|
-
return this.wrapRef
|
|
42
|
+
return hasFocus(this.wrapRef);
|
|
42
43
|
}
|
|
43
44
|
|
|
44
45
|
renderInfoData(data: TechnicalInfoData) {
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { DeviceBase } from '@24i/bigscreen-sdk/driver-base';
|
|
2
|
+
import { DeviceAndroidTV } from '@24i/bigscreen-sdk/driver-androidtv';
|
|
2
3
|
import { IStorage } from '@24i/bigscreen-sdk/storage/interface';
|
|
3
4
|
import { getUsedJSHeapSize, getTotalJSHeapSize } from '@24i/bigscreen-sdk/utils/memoryInfo';
|
|
4
5
|
import { ipify } from '@24i/bigscreen-sdk/ipify';
|
|
5
6
|
import { map } from '@24i/bigscreen-sdk/perf-utils/array';
|
|
6
|
-
import { PlayerBase } from '@24i/
|
|
7
|
+
import { PlayerBase } from '@24i/bigscreen-players-engine-base';
|
|
7
8
|
import { hasEMESupport, getListOfSupportedDRM } from './utils/emeSupport';
|
|
8
9
|
import {
|
|
9
10
|
hasEMESupport as hasEMESupport01b,
|
|
@@ -35,6 +36,8 @@ type Props = {
|
|
|
35
36
|
profileName: string,
|
|
36
37
|
/** Version of application. */
|
|
37
38
|
appVersion: string,
|
|
39
|
+
/** Version of the currently used core packages. */
|
|
40
|
+
appCoreVersions: string,
|
|
38
41
|
/** App resolution, in format like "1280x720". */
|
|
39
42
|
appResolution: string,
|
|
40
43
|
/** OVP/CMS back-end base URL. */
|
|
@@ -108,6 +111,15 @@ class TechnicalInfoProvider implements ITechnicalInfoProvider {
|
|
|
108
111
|
return value || unknown;
|
|
109
112
|
}
|
|
110
113
|
|
|
114
|
+
async getDeviceOsLanguage() {
|
|
115
|
+
let value;
|
|
116
|
+
const { unknown } = this.translations;
|
|
117
|
+
try {
|
|
118
|
+
value = await this.props.device.getOsLanguage();
|
|
119
|
+
} catch (e) {}
|
|
120
|
+
return value || unknown;
|
|
121
|
+
}
|
|
122
|
+
|
|
111
123
|
async getPlatformType() {
|
|
112
124
|
let value;
|
|
113
125
|
const { unknown } = this.translations;
|
|
@@ -134,6 +146,16 @@ class TechnicalInfoProvider implements ITechnicalInfoProvider {
|
|
|
134
146
|
return value || unknown;
|
|
135
147
|
}
|
|
136
148
|
|
|
149
|
+
async getAdInfo() {
|
|
150
|
+
let value;
|
|
151
|
+
const { unknown } = this.translations;
|
|
152
|
+
try {
|
|
153
|
+
const { adId, type, latEnabled } = await this.props.device.getAdInfo();
|
|
154
|
+
value = `LAT: ${latEnabled}, AD ID TYPE: ${type}, AD ID: ${adId}`;
|
|
155
|
+
} catch (e) {}
|
|
156
|
+
return value || unknown;
|
|
157
|
+
}
|
|
158
|
+
|
|
137
159
|
async getLocalIpAddress() {
|
|
138
160
|
let value;
|
|
139
161
|
const { unknown } = this.translations;
|
|
@@ -263,24 +285,42 @@ class TechnicalInfoProvider implements ITechnicalInfoProvider {
|
|
|
263
285
|
return this.props.backendBaseUrl || unknown;
|
|
264
286
|
}
|
|
265
287
|
|
|
266
|
-
|
|
288
|
+
async getAppCoreVersions() {
|
|
289
|
+
const { unknown } = this.translations;
|
|
290
|
+
return this.props.appCoreVersions || unknown;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
async getWrapperVersion() {
|
|
294
|
+
let value;
|
|
295
|
+
const { unknown } = this.translations;
|
|
296
|
+
try {
|
|
297
|
+
value = await (this.props.device as DeviceAndroidTV).getWrapperVersion();
|
|
298
|
+
} catch (e) {}
|
|
299
|
+
return value || unknown;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
async getSourceDataLayout() {
|
|
267
303
|
const {
|
|
268
304
|
username, profile, appVersion, firmwareVersion, deviceModel,
|
|
269
|
-
deviceManufacturer, platform, player, serialNumber,
|
|
270
|
-
publicIpAddress, connectionType, macAddress, memoryHeapSize,
|
|
305
|
+
deviceManufacturer, deviceLanguage, platform, player, serialNumber, adInfo,
|
|
306
|
+
localIpAddress, publicIpAddress, connectionType, macAddress, memoryHeapSize,
|
|
271
307
|
usedLocalStorage, timeZone, dateAndTime, flavour, userAgent,
|
|
272
308
|
emeSupport, emeDrmSystems, mseSupport, fourKSupport, resolution, baseUrl,
|
|
309
|
+
appCoreVersions, androidWrapperVersion,
|
|
273
310
|
} = this.translations;
|
|
274
311
|
const dataLayout: SourceDataLayout = [
|
|
275
312
|
{ label: username, getter: this.getUserName },
|
|
276
313
|
{ label: profile, getter: this.getProfileName },
|
|
277
314
|
{ label: appVersion, getter: this.getAppVersion },
|
|
315
|
+
{ label: appCoreVersions, getter: this.getAppCoreVersions },
|
|
278
316
|
{ label: firmwareVersion, getter: this.getFirmwareVersion },
|
|
279
317
|
{ label: deviceModel, getter: this.getDeviceModelName },
|
|
280
318
|
{ label: deviceManufacturer, getter: this.getDeviceManufacturer },
|
|
319
|
+
{ label: deviceLanguage, getter: this.getDeviceOsLanguage },
|
|
281
320
|
{ label: platform, getter: this.getPlatformType },
|
|
282
321
|
{ label: player, getter: this.getPlayerType },
|
|
283
322
|
{ label: serialNumber, getter: this.getDeviceSerialNumber },
|
|
323
|
+
{ label: adInfo, getter: this.getAdInfo },
|
|
284
324
|
{ label: localIpAddress, getter: this.getLocalIpAddress },
|
|
285
325
|
{ label: publicIpAddress, getter: this.getPublicIpAddress },
|
|
286
326
|
{ label: connectionType, getter: this.getConnectionType },
|
|
@@ -298,9 +338,21 @@ class TechnicalInfoProvider implements ITechnicalInfoProvider {
|
|
|
298
338
|
{ label: resolution, getter: this.getAppResolution },
|
|
299
339
|
{ label: baseUrl, getter: this.getBackendBaseUrl },
|
|
300
340
|
];
|
|
341
|
+
|
|
342
|
+
if (await this.isAndroidTV()) {
|
|
343
|
+
dataLayout.push(
|
|
344
|
+
{ label: androidWrapperVersion, getter: this.getWrapperVersion },
|
|
345
|
+
);
|
|
346
|
+
}
|
|
347
|
+
|
|
301
348
|
return dataLayout;
|
|
302
349
|
}
|
|
303
350
|
|
|
351
|
+
async isAndroidTV() {
|
|
352
|
+
const platformName = await this.props.device.getPlatformName();
|
|
353
|
+
return platformName === 'AndroidTV';
|
|
354
|
+
}
|
|
355
|
+
|
|
304
356
|
async loadDataLayout(dataLayout: SourceDataLayout) {
|
|
305
357
|
const promises = map(dataLayout, async (item) => item.getter.call(this));
|
|
306
358
|
const values = await Promise.all(promises);
|
|
@@ -310,7 +362,7 @@ class TechnicalInfoProvider implements ITechnicalInfoProvider {
|
|
|
310
362
|
}
|
|
311
363
|
|
|
312
364
|
async getInfoData() {
|
|
313
|
-
const sourceDataLayout = this.getSourceDataLayout();
|
|
365
|
+
const sourceDataLayout = await this.getSourceDataLayout();
|
|
314
366
|
return this.loadDataLayout(sourceDataLayout);
|
|
315
367
|
}
|
|
316
368
|
}
|
|
@@ -43,9 +43,21 @@ class Device {
|
|
|
43
43
|
return 'connection type';
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
+
async getOsLanguage() {
|
|
47
|
+
return 'device language';
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
async getAdInfo() {
|
|
51
|
+
return { adId: 'ad-id', type: 'ad-id-type', latEnabled: false };
|
|
52
|
+
}
|
|
53
|
+
|
|
46
54
|
async getMacAddress() {
|
|
47
55
|
return 'mac address';
|
|
48
56
|
}
|
|
57
|
+
|
|
58
|
+
async getWrapperVersion() {
|
|
59
|
+
return 'android wrapper version';
|
|
60
|
+
}
|
|
49
61
|
}
|
|
50
62
|
|
|
51
63
|
export { Device };
|
|
@@ -3,6 +3,7 @@ export type Translations = TranslationKeys | { [K in keyof TranslationKeys]?: ne
|
|
|
3
3
|
export type TranslationKeys = {
|
|
4
4
|
unknown: string
|
|
5
5
|
anonymous: string,
|
|
6
|
+
androidWrapperVersion: string,
|
|
6
7
|
yes: string,
|
|
7
8
|
no: string,
|
|
8
9
|
prefixed: string,
|
|
@@ -10,12 +11,15 @@ export type TranslationKeys = {
|
|
|
10
11
|
username: string,
|
|
11
12
|
profile: string,
|
|
12
13
|
appVersion: string,
|
|
14
|
+
appCoreVersions: string,
|
|
13
15
|
firmwareVersion: string,
|
|
14
16
|
deviceModel: string,
|
|
15
17
|
deviceManufacturer: string,
|
|
18
|
+
deviceLanguage: string;
|
|
16
19
|
platform: string,
|
|
17
20
|
player: string,
|
|
18
21
|
serialNumber: string,
|
|
22
|
+
adInfo: string,
|
|
19
23
|
localIpAddress: string,
|
|
20
24
|
publicIpAddress: string,
|
|
21
25
|
connectionType: string,
|
|
@@ -40,6 +44,7 @@ export type TranslationKeys = {
|
|
|
40
44
|
export const defaultTranslations = {
|
|
41
45
|
unknown: 'UNKNOWN',
|
|
42
46
|
anonymous: 'ANONYMOUS',
|
|
47
|
+
androidWrapperVersion: 'Android wrapper version',
|
|
43
48
|
yes: 'Yes',
|
|
44
49
|
no: 'No',
|
|
45
50
|
prefixed: 'prefixed',
|
|
@@ -47,12 +52,15 @@ export const defaultTranslations = {
|
|
|
47
52
|
username: 'Username',
|
|
48
53
|
profile: 'Profile',
|
|
49
54
|
appVersion: 'App version',
|
|
55
|
+
appCoreVersions: 'Core versions',
|
|
50
56
|
firmwareVersion: 'Firmware version',
|
|
51
57
|
deviceModel: 'Device model',
|
|
52
58
|
deviceManufacturer: 'Device manufacturer',
|
|
59
|
+
deviceLanguage: 'Device Language',
|
|
53
60
|
platform: 'Platform',
|
|
54
61
|
player: 'Player',
|
|
55
62
|
serialNumber: 'Serial number',
|
|
63
|
+
adInfo: 'Ad info',
|
|
56
64
|
localIpAddress: 'Local IP address',
|
|
57
65
|
publicIpAddress: 'Public IP address',
|
|
58
66
|
connectionType: 'Connection type',
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { DeviceAndroidTV as Device } from '@24i/bigscreen-sdk/driver-androidtv';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { DeviceFireTV as Device } from '@24i/bigscreen-sdk/driver-firetv';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { DeviceSmartCast as Device } from '@24i/bigscreen-sdk/driver-smartcast';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { KeycodeKeyMap } from '@24i/bigscreen-sdk/driver-base';
|
|
2
2
|
|
|
3
3
|
export const createGetKeyDigit = (
|
|
4
|
-
getKeyMap: () => Partial<KeycodeKeyMap
|
|
5
|
-
|
|
4
|
+
getKeyMap: () => Partial<KeycodeKeyMap>,
|
|
5
|
+
): (event: KeyboardEvent) => number | undefined => {
|
|
6
6
|
const {
|
|
7
7
|
NUM_0, NUM_1, NUM_2, NUM_3, NUM_4, NUM_5, NUM_6, NUM_7, NUM_8, NUM_9,
|
|
8
8
|
KP_0, KP_1, KP_2, KP_3, KP_4, KP_5, KP_6, KP_7, KP_8, KP_9,
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { KeycodeKeyMap, DeviceEventMap } from '@24i/bigscreen-sdk/driver-base';
|
|
2
|
+
import { DeviceAndroidTV } from '@24i/bigscreen-sdk/driver-androidtv';
|
|
2
3
|
import { DeviceBrowser } from '@24i/bigscreen-sdk/driver-browser';
|
|
3
4
|
import { DeviceEntone } from '@24i/bigscreen-sdk/driver-entone';
|
|
5
|
+
import { DeviceFireTV } from '@24i/bigscreen-sdk/driver-firetv';
|
|
4
6
|
import { DeviceHbbTV } from '@24i/bigscreen-sdk/driver-hbbtv';
|
|
5
7
|
import { DeviceKreaTV } from '@24i/bigscreen-sdk/driver-kreatv';
|
|
6
8
|
import { DeviceSaphi } from '@24i/bigscreen-sdk/driver-saphi';
|
|
7
9
|
import { DeviceTizen } from '@24i/bigscreen-sdk/driver-tizen';
|
|
8
10
|
import { DeviceVidaa } from '@24i/bigscreen-sdk/driver-vidaa';
|
|
11
|
+
import { DeviceSmartCast } from '@24i/bigscreen-sdk/driver-smartcast';
|
|
9
12
|
import { DeviceWebos } from '@24i/bigscreen-sdk/driver-webos';
|
|
10
13
|
import { DeviceXbox } from '@24i/bigscreen-sdk/driver-xbox';
|
|
11
14
|
|
|
@@ -19,10 +22,26 @@ const getDevice = () => {
|
|
|
19
22
|
info('HbbTV');
|
|
20
23
|
return new DeviceHbbTV();
|
|
21
24
|
}
|
|
25
|
+
// any because JavaScriptBridge property is defined on Android TV Bridge platform
|
|
26
|
+
if (typeof (window as any).JavaScriptBridge !== 'undefined'
|
|
27
|
+
&& (userAgent.match(/AFT/) || userAgent.match('AmazonWebAppPlatform'))
|
|
28
|
+
) {
|
|
29
|
+
info('FireTV');
|
|
30
|
+
return new DeviceFireTV();
|
|
31
|
+
}
|
|
32
|
+
// any because JavaScriptBridge property is defined on Android TV Bridge platform
|
|
33
|
+
if (typeof (window as any).JavaScriptBridge !== 'undefined') {
|
|
34
|
+
info('AndroidTV');
|
|
35
|
+
return new DeviceAndroidTV();
|
|
36
|
+
}
|
|
22
37
|
if (userAgent.match(/Tizen/)) {
|
|
23
38
|
info('Tizen');
|
|
24
39
|
return new DeviceTizen();
|
|
25
40
|
}
|
|
41
|
+
if (userAgent.match(/Vizio/i)) {
|
|
42
|
+
info('SmartCast');
|
|
43
|
+
return new DeviceSmartCast();
|
|
44
|
+
}
|
|
26
45
|
if (userAgent.match(/Web0S/)) { // Yes, it is Web ZERO S
|
|
27
46
|
info('WebOS');
|
|
28
47
|
return new DeviceWebos();
|
|
@@ -8,9 +8,14 @@ export type Props = {
|
|
|
8
8
|
withSeconds?: boolean,
|
|
9
9
|
domRef?: Reference<HTMLDivElement>,
|
|
10
10
|
className?: string,
|
|
11
|
+
isHiddenForAria?: boolean,
|
|
11
12
|
};
|
|
12
13
|
|
|
13
|
-
const WITHOUT_SECONDS_OPTIONS = {
|
|
14
|
+
const WITHOUT_SECONDS_OPTIONS = {
|
|
15
|
+
hour: 'numeric',
|
|
16
|
+
minute: '2-digit',
|
|
17
|
+
formatType: 'timeFormat',
|
|
18
|
+
} as const;
|
|
14
19
|
const WITH_SECONDS_OPTIONS = { ...WITHOUT_SECONDS_OPTIONS, second: '2-digit' } as const;
|
|
15
20
|
|
|
16
21
|
export class DigitalClock extends Component<Props> {
|
|
@@ -40,7 +45,7 @@ export class DigitalClock extends Component<Props> {
|
|
|
40
45
|
|
|
41
46
|
setTime() {
|
|
42
47
|
const { withSeconds } = this.props;
|
|
43
|
-
const currentTimestampMs = time.
|
|
48
|
+
const currentTimestampMs = time.getCurrentTime().getTime();
|
|
44
49
|
if (this.oldUnixTimestampMs !== currentTimestampMs) {
|
|
45
50
|
const options = withSeconds ? WITH_SECONDS_OPTIONS : WITHOUT_SECONDS_OPTIONS;
|
|
46
51
|
this.clearMount((
|
|
@@ -61,7 +66,13 @@ export class DigitalClock extends Component<Props> {
|
|
|
61
66
|
}
|
|
62
67
|
|
|
63
68
|
render() {
|
|
64
|
-
const { className } = this.props;
|
|
65
|
-
return
|
|
69
|
+
const { className, isHiddenForAria } = this.props;
|
|
70
|
+
return (
|
|
71
|
+
<div
|
|
72
|
+
ref={this.clockRef}
|
|
73
|
+
className={className}
|
|
74
|
+
{...isHiddenForAria && { 'aria-hidden': true }}
|
|
75
|
+
/>
|
|
76
|
+
);
|
|
66
77
|
}
|
|
67
78
|
}
|