@ray-js/ipc-player-integration 0.0.67-beta.1 → 0.0.68-beta.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/README.md +6 -0
- package/lib/ctx/ctx.composition.js +3 -13
- package/lib/ctx/ctx.js +35 -48
- package/lib/ctx/multiCameraCtx.d.ts +0 -2
- package/lib/ctx/multiCameraCtx.js +1 -17
- package/lib/i18n/index.d.ts +0 -12
- package/lib/i18n/strings.d.ts +0 -6
- package/lib/i18n/strings.js +0 -6
- package/lib/index.d.ts +4 -0
- package/lib/index.js +3 -1
- package/lib/interface.d.ts +3 -18
- package/lib/renderer/capabilities.d.ts +8 -0
- package/lib/renderer/capabilities.js +19 -0
- package/lib/renderer/context.d.ts +5 -0
- package/lib/renderer/context.js +6 -0
- package/lib/renderer/directionControl.d.ts +6 -0
- package/lib/renderer/directionControl.js +3 -0
- package/lib/renderer/font-manifest.json +9 -0
- package/lib/renderer/font.less +5 -0
- package/lib/renderer/glyphs.d.ts +1 -0
- package/lib/renderer/glyphs.js +256 -0
- package/lib/renderer/index.module.less +48 -0
- package/lib/renderer/overlay.d.ts +4 -0
- package/lib/renderer/overlay.js +6 -0
- package/lib/renderer/ptzZoom.d.ts +6 -0
- package/lib/renderer/ptzZoom.js +3 -0
- package/lib/renderer/text.d.ts +4 -0
- package/lib/renderer/text.js +32 -0
- package/lib/renderer/text.module.less +4 -0
- package/lib/renderer/viewport.d.ts +7 -0
- package/lib/renderer/viewport.js +24 -0
- package/lib/res/lynx-signal/index.d.ts +1 -0
- package/lib/res/lynx-signal/index.js +22 -0
- package/lib/res/lynx-signal/signalFour0.png +0 -0
- package/lib/res/lynx-signal/signalFour1.png +0 -0
- package/lib/res/lynx-signal/signalFour2.png +0 -0
- package/lib/res/lynx-signal/signalFour3.png +0 -0
- package/lib/res/lynx-signal/signalFour4.png +0 -0
- package/lib/res/lynx-signal/signalThree0.png +0 -0
- package/lib/res/lynx-signal/signalThree1.png +0 -0
- package/lib/res/lynx-signal/signalThree2.png +0 -0
- package/lib/res/lynx-signal/signalThree3.png +0 -0
- package/lib/res/player-charging.png +0 -0
- package/lib/res/player-more-arrow.png +0 -0
- package/lib/res/player-solar.png +0 -0
- package/lib/ui/bottomLeftContent.js +122 -56
- package/lib/ui/bottomRightContent.js +10 -5
- package/lib/ui/scrollHintArrow.d.ts +23 -0
- package/lib/ui/scrollHintArrow.js +83 -0
- package/lib/ui/topLeftContent.js +4 -2
- package/lib/ui/topRightContent.js +4 -2
- package/lib/ui/ui.d.ts +5 -0
- package/lib/ui/ui.js +93 -100
- package/lib/utils/navigation.d.ts +1 -2
- package/lib/utils/navigation.js +3 -13
- package/lib/widgets/battery/battery.js +7 -5
- package/lib/widgets/battery/batteryFull.js +7 -5
- package/lib/widgets/battery/statusIcon.d.ts +6 -0
- package/lib/widgets/battery/statusIcon.js +36 -0
- package/lib/widgets/battery/statusIcon.less +24 -0
- package/lib/widgets/captureToast/captureToast.d.ts +9 -0
- package/lib/widgets/captureToast/captureToast.js +73 -0
- package/lib/widgets/floodlight/floodlight.js +2 -1
- package/lib/widgets/flowLowTip/flowLowTip.js +2 -1
- package/lib/widgets/fullScreen/fullScreen.js +18 -4
- package/lib/widgets/fullScreen/fullTravelRouteControl.d.ts +1 -1
- package/lib/widgets/fullScreen/fullTravelRouteControl.js +1 -1
- package/lib/widgets/fullScreen/verticalScreen.js +2 -1
- package/lib/widgets/index.d.ts +0 -1
- package/lib/widgets/index.js +1 -2
- package/lib/widgets/moveInteractiveControl/controlButton.js +2 -1
- package/lib/widgets/moveInteractiveControl/moveInteractiveControlUI.js +16 -5
- package/lib/widgets/moveInteractiveControl/moveInteractiveControlUI.less +24 -4
- package/lib/widgets/multiCamera/index.less +0 -1
- package/lib/widgets/multiCamera/landscapeTip.js +5 -2
- package/lib/widgets/multiCamera/moveablePtzControl.js +9 -7
- package/lib/widgets/multiCamera/multiPtz.js +3 -2
- package/lib/widgets/multiCamera/ptzMoveableTip.js +5 -2
- package/lib/widgets/multiCamera/switchLayout.js +2 -1
- package/lib/widgets/multiCamera/tileMultiPtz.js +3 -2
- package/lib/widgets/multiCamera/tileSwitchLayout.js +2 -1
- package/lib/widgets/multiCamera/tileTip.js +5 -2
- package/lib/widgets/muted/muted.js +2 -1
- package/lib/widgets/muted/muted.test.js +66 -52
- package/lib/widgets/ptz/ptz.js +2 -1
- package/lib/widgets/ptz/ptzControl.js +4 -3
- package/lib/widgets/ptzControlTip/ptzControlTip.js +9 -4
- package/lib/widgets/ptzControlTip/ptzControlTip.less +6 -0
- package/lib/widgets/realTimeMagnification/realTimeMagnification.js +2 -1
- package/lib/widgets/recordVideo/recordVideo.js +32 -178
- package/lib/widgets/recordVideo/recordVideo.less +74 -17
- package/lib/widgets/recordVideo/recordVideo.test.js +169 -3
- package/lib/widgets/recordVideo/recordVideoTimer.d.ts +3 -0
- package/lib/widgets/recordVideo/recordVideoTimer.js +26 -0
- package/lib/widgets/resolution/fullResolutionControl.js +29 -19
- package/lib/widgets/resolution/resolution.js +3 -2
- package/lib/widgets/screenshot/screenshot.js +35 -125
- package/lib/widgets/screenshot/screenshot.less +40 -1
- package/lib/widgets/screenshot/screenshot.test.js +108 -113
- package/lib/widgets/signal4G/signal4G.js +4 -1
- package/lib/widgets/siren/siren.js +2 -1
- package/lib/widgets/tempHumidity/tempHumidity.js +2 -1
- package/lib/widgets/toggleVerticalFull/toggleVerticalFull.js +2 -1
- package/lib/widgets/trialBadge/index.d.ts +1 -2
- package/lib/widgets/trialBadge/index.js +17 -20
- package/lib/widgets/trialBadge/index.less +24 -0
- package/lib/widgets/trialBadge/useTrialBadge.d.ts +2 -3
- package/lib/widgets/trialBadge/useTrialBadge.js +3 -21
- package/lib/widgets/tryExperience/tryExperience.js +2 -1
- package/lib/widgets/videoBitKBP/videoBitKBP.js +2 -1
- package/lib/widgets/voiceIntercom/voiceIntercom.js +50 -24
- package/lib/widgets/voiceIntercom/voiceIntercom.less +16 -0
- package/lib/widgets/zoomTurntable/lynxDockLayout.d.ts +6 -0
- package/lib/widgets/zoomTurntable/lynxDockLayout.js +30 -0
- package/lib/widgets/zoomTurntable/turntable/index.d.ts +5 -7
- package/lib/widgets/zoomTurntable/turntable/index.js +3 -1
- package/lib/widgets/zoomTurntable/turntable/lynx.d.ts +5 -0
- package/lib/widgets/zoomTurntable/turntable/lynx.js +273 -0
- package/lib/widgets/zoomTurntable/turntable/lynx.less +9 -0
- package/lib/widgets/zoomTurntable/turntable/lynxModel.d.ts +37 -0
- package/lib/widgets/zoomTurntable/turntable/lynxModel.js +122 -0
- package/lib/widgets/zoomTurntable/turntable/lynxPaint.d.ts +3 -0
- package/lib/widgets/zoomTurntable/turntable/lynxPaint.js +36 -0
- package/lib/widgets/zoomTurntable/zoomTurntableDock.d.ts +5 -3
- package/lib/widgets/zoomTurntable/zoomTurntableDock.js +4 -4
- package/lib/widgets/zoomTurntable/zoomTurntableEntry.js +32 -19
- package/lib/widgets/zoomTurntable/zoomTurntableTip.js +24 -3
- package/package.json +15 -7
- package/lib/ctx/ctx.album.test.d.ts +0 -1
- package/lib/ctx/ctx.album.test.js +0 -197
- package/lib/ctx/multiCameraCtx.test.d.ts +0 -1
- package/lib/ctx/multiCameraCtx.test.js +0 -65
- package/lib/ui/absoluteContent.d.ts +0 -2
- package/lib/ui/absoluteContent.js +0 -3
- package/lib/utils/captureResult.d.ts +0 -12
- package/lib/utils/captureResult.js +0 -70
- package/lib/utils/captureResult.test.d.ts +0 -1
- package/lib/utils/captureResult.test.js +0 -223
- package/lib/utils/fullLinkTracking.d.ts +0 -5
- package/lib/utils/fullLinkTracking.js +0 -71
- package/lib/widgets/captureResult/captureResult.d.ts +0 -16
- package/lib/widgets/captureResult/captureResult.js +0 -85
- package/lib/widgets/captureResult/captureResult.less +0 -144
- package/lib/widgets/captureResult/captureResult.test.d.ts +0 -1
- package/lib/widgets/captureResult/captureResult.test.js +0 -84
- package/lib/widgets/captureResult/index.d.ts +0 -2
- package/lib/widgets/captureResult/index.js +0 -2
- package/lib/widgets/recordVideo/recordVideo.lifecycle.test.d.ts +0 -1
- package/lib/widgets/recordVideo/recordVideo.lifecycle.test.js +0 -106
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
import "core-js/modules/esnext.iterator.constructor.js";
|
|
2
|
-
import "core-js/modules/esnext.iterator.filter.js";
|
|
3
|
-
import "core-js/modules/esnext.iterator.map.js";
|
|
4
|
-
import React, { useState } from 'react';
|
|
5
|
-
import ReactDOM from 'react-dom';
|
|
6
|
-
import { act, Simulate } from 'react-dom/test-utils';
|
|
7
|
-
import { atom, getDefaultStore } from 'jotai';
|
|
8
|
-
import { PlayState } from '../../interface';
|
|
9
|
-
import { RecordVideo } from './recordVideo';
|
|
10
|
-
jest.mock('@ray-js/ray', () => ({
|
|
11
|
-
View: 'div',
|
|
12
|
-
Text: 'span',
|
|
13
|
-
Image: 'img',
|
|
14
|
-
getSystemInfoSync: () => ({
|
|
15
|
-
platform: 'android'
|
|
16
|
-
})
|
|
17
|
-
}));
|
|
18
|
-
jest.mock('@ray-js/ray-ipc-utils', () => ({
|
|
19
|
-
goToIpcPageNativeRoute: jest.fn()
|
|
20
|
-
}));
|
|
21
|
-
jest.mock('@ray-js/ray-ipc-utils/lib/interface', () => ({}));
|
|
22
|
-
jest.mock('../../utils/device', () => ({
|
|
23
|
-
getDeviceInfo: jest.fn()
|
|
24
|
-
}));
|
|
25
|
-
jest.mock('../../i18n', () => ({
|
|
26
|
-
__esModule: true,
|
|
27
|
-
default: {
|
|
28
|
-
getLang: key => key
|
|
29
|
-
}
|
|
30
|
-
}));
|
|
31
|
-
jest.mock('./recordVideo.less', () => ({}));
|
|
32
|
-
jest.mock('../captureResult/captureResult.less', () => ({}));
|
|
33
|
-
describe('RecordVideo', () => {
|
|
34
|
-
let container;
|
|
35
|
-
beforeEach(() => {
|
|
36
|
-
jest.useFakeTimers('modern');
|
|
37
|
-
container = document.createElement('div');
|
|
38
|
-
document.body.appendChild(container);
|
|
39
|
-
});
|
|
40
|
-
afterEach(() => {
|
|
41
|
-
act(() => ReactDOM.unmountComponentAtNode(container));
|
|
42
|
-
container.remove();
|
|
43
|
-
jest.clearAllTimers();
|
|
44
|
-
jest.useRealTimers();
|
|
45
|
-
});
|
|
46
|
-
it.each([false, true])('removes the recording timer after stop (remounted: %s)', async remount => {
|
|
47
|
-
var _container$querySelec, _container$querySelec2;
|
|
48
|
-
const store = getDefaultStore();
|
|
49
|
-
const recording = atom(false);
|
|
50
|
-
const recordingDisabled = atom(false);
|
|
51
|
-
const screenType = atom('vertical');
|
|
52
|
-
const setRecording = jest.fn(async value => {
|
|
53
|
-
store.set(recording, value);
|
|
54
|
-
return value ? true : {
|
|
55
|
-
tempImagePath: 'thingfile://record.jpg'
|
|
56
|
-
};
|
|
57
|
-
});
|
|
58
|
-
function Harness(_ref) {
|
|
59
|
-
let {
|
|
60
|
-
widgetKey
|
|
61
|
-
} = _ref;
|
|
62
|
-
const [contents, setContents] = useState([]);
|
|
63
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(RecordVideo, {
|
|
64
|
-
key: widgetKey,
|
|
65
|
-
devId: 'device',
|
|
66
|
-
recording,
|
|
67
|
-
recordingDisabled,
|
|
68
|
-
screenType,
|
|
69
|
-
brandColor: atom('#ff592a'),
|
|
70
|
-
playState: atom(PlayState.PLAYING),
|
|
71
|
-
setRecording,
|
|
72
|
-
setRecordingDisabled: value => store.set(recordingDisabled, value),
|
|
73
|
-
addContent: (_type, content) => setContents(items => [...items, content]),
|
|
74
|
-
deleteContent: (_type, id) => setContents(items => items.filter(item => item.id !== id))
|
|
75
|
-
}), contents.map(item => /*#__PURE__*/React.createElement(item.content, {
|
|
76
|
-
key: item.id
|
|
77
|
-
})));
|
|
78
|
-
}
|
|
79
|
-
const clickRecord = async () => {
|
|
80
|
-
await act(async () => {
|
|
81
|
-
Simulate.click(container.querySelector('.ipc-player-plugin-record-video-icon').parentElement);
|
|
82
|
-
});
|
|
83
|
-
};
|
|
84
|
-
await act(async () => {
|
|
85
|
-
ReactDOM.render(/*#__PURE__*/React.createElement(Harness, {
|
|
86
|
-
widgetKey: 0
|
|
87
|
-
}), container);
|
|
88
|
-
});
|
|
89
|
-
await clickRecord();
|
|
90
|
-
act(() => jest.advanceTimersByTime(3000));
|
|
91
|
-
expect((_container$querySelec = container.querySelector('.ipc-player-plugin-record-video-toast-time')) === null || _container$querySelec === void 0 ? void 0 : _container$querySelec.textContent).toBe('00:03');
|
|
92
|
-
if (remount) {
|
|
93
|
-
await act(async () => {
|
|
94
|
-
store.set(screenType, 'full');
|
|
95
|
-
ReactDOM.render(/*#__PURE__*/React.createElement(Harness, {
|
|
96
|
-
widgetKey: 1
|
|
97
|
-
}), container);
|
|
98
|
-
});
|
|
99
|
-
}
|
|
100
|
-
expect((_container$querySelec2 = container.querySelector('.ipc-player-plugin-record-video-toast-time')) === null || _container$querySelec2 === void 0 ? void 0 : _container$querySelec2.textContent).toBe('00:03');
|
|
101
|
-
await clickRecord();
|
|
102
|
-
expect(setRecording).toHaveBeenLastCalledWith(false);
|
|
103
|
-
expect(container.querySelector('.icon-panel-record-stop')).toBeNull();
|
|
104
|
-
expect(container.querySelector('.ipc-player-plugin-record-video-toast-time')).toBeNull();
|
|
105
|
-
});
|
|
106
|
-
});
|