@ray-js/ipc-player-integration 0.0.66-beta.0 → 0.0.67-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 +0 -6
- package/lib/ctx/ctx.album.test.d.ts +1 -0
- package/lib/ctx/ctx.album.test.js +197 -0
- package/lib/ctx/ctx.composition.js +13 -3
- package/lib/ctx/ctx.js +46 -35
- package/lib/ctx/multiCameraCtx.d.ts +2 -0
- package/lib/ctx/multiCameraCtx.js +17 -1
- package/lib/ctx/multiCameraCtx.test.d.ts +1 -0
- package/lib/ctx/multiCameraCtx.test.js +65 -0
- package/lib/i18n/index.d.ts +12 -0
- package/lib/i18n/strings.d.ts +6 -0
- package/lib/i18n/strings.js +6 -0
- package/lib/index.d.ts +0 -4
- package/lib/index.js +1 -3
- package/lib/interface.d.ts +17 -3
- package/lib/ui/absoluteContent.d.ts +2 -0
- package/lib/ui/absoluteContent.js +3 -0
- package/lib/ui/bottomLeftContent.js +55 -119
- package/lib/ui/bottomRightContent.js +3 -6
- package/lib/ui/ui.d.ts +0 -5
- package/lib/ui/ui.js +98 -89
- package/lib/utils/captureResult.d.ts +12 -0
- package/lib/utils/captureResult.js +70 -0
- package/lib/utils/captureResult.test.d.ts +1 -0
- package/lib/utils/captureResult.test.js +223 -0
- package/lib/utils/fullLinkTracking.d.ts +5 -0
- package/lib/utils/fullLinkTracking.js +71 -0
- package/lib/utils/navigation.d.ts +2 -1
- package/lib/utils/navigation.js +13 -3
- package/lib/widgets/battery/battery.js +5 -7
- package/lib/widgets/battery/batteryFull.js +5 -7
- package/lib/widgets/captureResult/captureResult.d.ts +16 -0
- package/lib/widgets/captureResult/captureResult.js +85 -0
- package/lib/widgets/captureResult/captureResult.less +144 -0
- package/lib/widgets/captureResult/captureResult.test.d.ts +1 -0
- package/lib/widgets/captureResult/captureResult.test.js +84 -0
- package/lib/widgets/captureResult/index.d.ts +2 -0
- package/lib/widgets/captureResult/index.js +2 -0
- package/lib/widgets/floodlight/floodlight.js +1 -2
- package/lib/widgets/flowLowTip/flowLowTip.js +1 -2
- package/lib/widgets/fullScreen/fullScreen.js +4 -18
- package/lib/widgets/fullScreen/fullTravelRouteControl.d.ts +1 -1
- package/lib/widgets/fullScreen/fullTravelRouteControl.js +1 -1
- package/lib/widgets/fullScreen/verticalScreen.js +1 -2
- package/lib/widgets/index.d.ts +1 -0
- package/lib/widgets/index.js +2 -1
- package/lib/widgets/moveInteractiveControl/controlButton.js +1 -2
- package/lib/widgets/moveInteractiveControl/moveInteractiveControlUI.js +3 -12
- package/lib/widgets/moveInteractiveControl/moveInteractiveControlUI.less +4 -24
- package/lib/widgets/multiCamera/index.less +1 -0
- package/lib/widgets/multiCamera/landscapeTip.js +1 -2
- package/lib/widgets/multiCamera/moveablePtzControl.js +5 -5
- package/lib/widgets/multiCamera/multiPtz.js +2 -3
- package/lib/widgets/multiCamera/ptzMoveableTip.js +1 -2
- package/lib/widgets/multiCamera/switchLayout.js +1 -2
- package/lib/widgets/multiCamera/tileMultiPtz.js +2 -3
- package/lib/widgets/multiCamera/tileSwitchLayout.js +1 -2
- package/lib/widgets/multiCamera/tileTip.js +1 -2
- package/lib/widgets/muted/muted.js +1 -2
- package/lib/widgets/muted/muted.test.js +52 -66
- package/lib/widgets/ptz/ptz.js +1 -2
- package/lib/widgets/ptz/ptzControl.js +1 -1
- package/lib/widgets/ptzControlTip/ptzControlTip.js +3 -6
- package/lib/widgets/ptzControlTip/ptzControlTip.less +0 -6
- package/lib/widgets/realTimeMagnification/realTimeMagnification.js +1 -2
- package/lib/widgets/recordVideo/recordVideo.js +58 -54
- package/lib/widgets/recordVideo/recordVideo.less +17 -74
- package/lib/widgets/recordVideo/recordVideo.lifecycle.test.d.ts +1 -0
- package/lib/widgets/recordVideo/recordVideo.lifecycle.test.js +106 -0
- package/lib/widgets/recordVideo/recordVideo.test.js +1 -0
- package/lib/widgets/resolution/fullResolutionControl.js +19 -29
- package/lib/widgets/resolution/resolution.js +2 -3
- package/lib/widgets/screenshot/screenshot.js +67 -45
- package/lib/widgets/screenshot/screenshot.less +1 -40
- package/lib/widgets/screenshot/screenshot.test.d.ts +1 -0
- package/lib/widgets/screenshot/screenshot.test.js +135 -0
- package/lib/widgets/signal4G/signal4G.js +1 -4
- package/lib/widgets/siren/siren.js +1 -2
- package/lib/widgets/tempHumidity/tempHumidity.js +1 -2
- package/lib/widgets/toggleVerticalFull/toggleVerticalFull.js +1 -2
- package/lib/widgets/trialBadge/index.d.ts +2 -1
- package/lib/widgets/trialBadge/index.js +20 -17
- package/lib/widgets/trialBadge/index.less +0 -24
- package/lib/widgets/trialBadge/useTrialBadge.d.ts +3 -2
- package/lib/widgets/trialBadge/useTrialBadge.js +13 -2
- package/lib/widgets/tryExperience/tryExperience.js +1 -2
- package/lib/widgets/videoBitKBP/videoBitKBP.js +1 -2
- package/lib/widgets/voiceIntercom/voiceIntercom.js +24 -50
- package/lib/widgets/voiceIntercom/voiceIntercom.less +0 -16
- package/lib/widgets/zoomTurntable/turntable/index.d.ts +7 -5
- package/lib/widgets/zoomTurntable/turntable/index.js +1 -3
- package/lib/widgets/zoomTurntable/zoomTurntableDock.d.ts +0 -2
- package/lib/widgets/zoomTurntable/zoomTurntableDock.js +1 -1
- package/lib/widgets/zoomTurntable/zoomTurntableEntry.js +18 -31
- package/lib/widgets/zoomTurntable/zoomTurntableTip.js +3 -23
- package/package.json +7 -15
- package/lib/renderer/capabilities.d.ts +0 -8
- package/lib/renderer/capabilities.js +0 -19
- package/lib/renderer/context.d.ts +0 -5
- package/lib/renderer/context.js +0 -6
- package/lib/renderer/directionControl.d.ts +0 -6
- package/lib/renderer/directionControl.js +0 -3
- package/lib/renderer/font.less +0 -5
- package/lib/renderer/glyphs.d.ts +0 -1
- package/lib/renderer/glyphs.js +0 -256
- package/lib/renderer/index.module.less +0 -48
- package/lib/renderer/ptzZoom.d.ts +0 -6
- package/lib/renderer/ptzZoom.js +0 -3
- package/lib/renderer/text.d.ts +0 -4
- package/lib/renderer/text.js +0 -32
- package/lib/renderer/text.module.less +0 -4
- package/lib/renderer/viewport.d.ts +0 -7
- package/lib/renderer/viewport.js +0 -24
- package/lib/res/lynx-signal/index.d.ts +0 -1
- package/lib/res/lynx-signal/index.js +0 -22
- 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/scrollHintArrow.d.ts +0 -23
- package/lib/ui/scrollHintArrow.js +0 -82
- package/lib/widgets/battery/statusIcon.d.ts +0 -6
- package/lib/widgets/battery/statusIcon.js +0 -36
- package/lib/widgets/battery/statusIcon.less +0 -24
- package/lib/widgets/zoomTurntable/lynxDockLayout.d.ts +0 -6
- package/lib/widgets/zoomTurntable/lynxDockLayout.js +0 -30
- package/lib/widgets/zoomTurntable/turntable/lynx.d.ts +0 -5
- package/lib/widgets/zoomTurntable/turntable/lynx.js +0 -273
- package/lib/widgets/zoomTurntable/turntable/lynx.less +0 -9
- package/lib/widgets/zoomTurntable/turntable/lynxModel.d.ts +0 -37
- package/lib/widgets/zoomTurntable/turntable/lynxModel.js +0 -122
- package/lib/widgets/zoomTurntable/turntable/lynxPaint.d.ts +0 -3
- package/lib/widgets/zoomTurntable/turntable/lynxPaint.js +0 -36
package/README.md
CHANGED
|
@@ -359,9 +359,3 @@ yarn build
|
|
|
359
359
|
```
|
|
360
360
|
|
|
361
361
|
Other available scripts: `start:wechat`, `start:web`, `start:native`, `build:tuya`, `build:wechat`, `build:web`, `build:native`.
|
|
362
|
-
|
|
363
|
-
## Lynx integration
|
|
364
|
-
|
|
365
|
-
This branch includes master `1c07c0b` (`0.0.64`) updates for automatic clarity, offline notifications and album permissions. Set `renderMode="lynx"` explicitly; the default remains `webview`.
|
|
366
|
-
|
|
367
|
-
Use **`@ray-js/ray-ipc-player: 2.1.8-beta.0`** exactly and **`@ray-js/ray-ipc-utils: ^1.1.18`** (currently locked to `1.1.18`). Pin **`@ray-js/direction-control: 0.0.13-beta.1`** and **`@ray-js/ipc-ptz-zoom: 0.0.5-beta.0`** as the published Lynx versions. PTZ and direction widgets require compatible `lynxAdapters`; the turntable has a built-in Lynx renderer and still accepts a custom adapter override. See [Lynx integration notes](./README-LYNX.md) for adapter requirements, verification and remaining runtime limitations.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
+
import { act, renderHook } from '@testing-library/react-hooks/dom';
|
|
3
|
+
import { authorize, authorizeStatus, getSystemInfoSync, showModal } from '@ray-js/ray';
|
|
4
|
+
import { createUseCtx } from './ctx';
|
|
5
|
+
import { useStore } from './store';
|
|
6
|
+
jest.mock('@ray-js/ray', () => ({
|
|
7
|
+
authorize: jest.fn(),
|
|
8
|
+
authorizeStatus: jest.fn(),
|
|
9
|
+
getSystemInfoSync: jest.fn(),
|
|
10
|
+
openAppSystemSettingPage: jest.fn(),
|
|
11
|
+
showModal: jest.fn()
|
|
12
|
+
}));
|
|
13
|
+
jest.mock('@ray-js/ray-ipc-utils/lib/interface', () => ({
|
|
14
|
+
ClarityType: {
|
|
15
|
+
HD: 'HD',
|
|
16
|
+
SD: 'SD',
|
|
17
|
+
AUTO: 'AUTO'
|
|
18
|
+
},
|
|
19
|
+
IntercomMode: {
|
|
20
|
+
OneWay: 'OneWay',
|
|
21
|
+
TwoWay: 'TwoWay'
|
|
22
|
+
}
|
|
23
|
+
}));
|
|
24
|
+
jest.mock('../i18n', () => ({
|
|
25
|
+
__esModule: true,
|
|
26
|
+
default: {
|
|
27
|
+
getLang: key => key
|
|
28
|
+
}
|
|
29
|
+
}));
|
|
30
|
+
jest.mock('./multiCameraCtx', () => ({
|
|
31
|
+
isMultiCameraTileSupported: () => false,
|
|
32
|
+
useMultiCameraCtx: () => ({})
|
|
33
|
+
}));
|
|
34
|
+
jest.mock('../utils/ttt', () => ({
|
|
35
|
+
getCachedAutoClarity: jest.fn(),
|
|
36
|
+
isClarityChangedSupported: () => false,
|
|
37
|
+
setCachedAutoClarity: jest.fn(),
|
|
38
|
+
subscribeClarityChanged: () => () => undefined
|
|
39
|
+
}));
|
|
40
|
+
beforeEach(() => {
|
|
41
|
+
jest.clearAllMocks();
|
|
42
|
+
getSystemInfoSync.mockReturnValue({
|
|
43
|
+
platform: 'android',
|
|
44
|
+
system: 'android 12'
|
|
45
|
+
});
|
|
46
|
+
authorizeStatus.mockImplementation(_ref => {
|
|
47
|
+
let {
|
|
48
|
+
fail
|
|
49
|
+
} = _ref;
|
|
50
|
+
return fail({
|
|
51
|
+
errorCode: 9004
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
authorize.mockImplementation(_ref2 => {
|
|
55
|
+
let {
|
|
56
|
+
fail
|
|
57
|
+
} = _ref2;
|
|
58
|
+
return fail({
|
|
59
|
+
errorCode: 9004
|
|
60
|
+
});
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
const mountContext = function () {
|
|
64
|
+
let saveToAlbum = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
|
|
65
|
+
const capture = {
|
|
66
|
+
tempImagePath: 'thingfile://capture.jpg',
|
|
67
|
+
filePath: 'thingfile://record.mp4'
|
|
68
|
+
};
|
|
69
|
+
const startRecord = jest.fn(_ref3 => {
|
|
70
|
+
let {
|
|
71
|
+
success
|
|
72
|
+
} = _ref3;
|
|
73
|
+
return success();
|
|
74
|
+
});
|
|
75
|
+
const stopRecord = jest.fn(_ref4 => {
|
|
76
|
+
let {
|
|
77
|
+
success
|
|
78
|
+
} = _ref4;
|
|
79
|
+
return success(capture);
|
|
80
|
+
});
|
|
81
|
+
const useCtx = createUseCtx({
|
|
82
|
+
createPlayContext: () => ({
|
|
83
|
+
startRecord,
|
|
84
|
+
stopRecord
|
|
85
|
+
}),
|
|
86
|
+
getMemoryState: jest.fn().mockResolvedValue({
|
|
87
|
+
resolution: 'HD',
|
|
88
|
+
resolutionList: ['HD', 'SD'],
|
|
89
|
+
mute: true,
|
|
90
|
+
intercomMode: 'TwoWay',
|
|
91
|
+
isIntercomSupported: false
|
|
92
|
+
}),
|
|
93
|
+
setResolutionMemoryState: jest.fn(),
|
|
94
|
+
setMuteMemoryState: jest.fn(),
|
|
95
|
+
authorizeStatus: jest.fn(),
|
|
96
|
+
toast: jest.fn()
|
|
97
|
+
});
|
|
98
|
+
const hook = renderHook(() => {
|
|
99
|
+
const ctx = useCtx({
|
|
100
|
+
devId: 'camera-1',
|
|
101
|
+
multiLens: true,
|
|
102
|
+
saveToAlbum
|
|
103
|
+
});
|
|
104
|
+
const state = useStore({
|
|
105
|
+
recording: ctx.recording
|
|
106
|
+
});
|
|
107
|
+
return _objectSpread(_objectSpread({}, ctx), {}, {
|
|
108
|
+
state
|
|
109
|
+
});
|
|
110
|
+
});
|
|
111
|
+
return _objectSpread(_objectSpread({}, hook), {}, {
|
|
112
|
+
startRecord,
|
|
113
|
+
stopRecord,
|
|
114
|
+
capture
|
|
115
|
+
});
|
|
116
|
+
};
|
|
117
|
+
it('starts without legacy authorization and retains the native stop result', async () => {
|
|
118
|
+
const {
|
|
119
|
+
result,
|
|
120
|
+
startRecord,
|
|
121
|
+
stopRecord,
|
|
122
|
+
capture,
|
|
123
|
+
unmount
|
|
124
|
+
} = mountContext();
|
|
125
|
+
await act(async () => {
|
|
126
|
+
expect(await result.current.setRecording(true)).toBe(true);
|
|
127
|
+
});
|
|
128
|
+
expect(startRecord).toHaveBeenCalledWith(expect.objectContaining({
|
|
129
|
+
saveToAlbum: 1
|
|
130
|
+
}));
|
|
131
|
+
expect(result.current.state.recording).toBe(true);
|
|
132
|
+
expect(result.current.multiLens).toBe(true);
|
|
133
|
+
await act(async () => {
|
|
134
|
+
expect(await result.current.setRecording(false)).toEqual(capture);
|
|
135
|
+
});
|
|
136
|
+
expect(stopRecord).toHaveBeenCalledTimes(1);
|
|
137
|
+
expect(result.current.state.recording).toBe(false);
|
|
138
|
+
expect(authorizeStatus).not.toHaveBeenCalled();
|
|
139
|
+
expect(authorize).not.toHaveBeenCalled();
|
|
140
|
+
unmount();
|
|
141
|
+
});
|
|
142
|
+
it('settles a denied start without calling the native recorder', async () => {
|
|
143
|
+
getSystemInfoSync.mockReturnValue({
|
|
144
|
+
platform: 'ios',
|
|
145
|
+
system: 'iOS 18'
|
|
146
|
+
});
|
|
147
|
+
const {
|
|
148
|
+
result,
|
|
149
|
+
startRecord,
|
|
150
|
+
unmount
|
|
151
|
+
} = mountContext();
|
|
152
|
+
await act(async () => {
|
|
153
|
+
expect(await result.current.setRecording(true)).toBe(false);
|
|
154
|
+
});
|
|
155
|
+
expect(startRecord).not.toHaveBeenCalled();
|
|
156
|
+
expect(result.current.state.recording).toBe(false);
|
|
157
|
+
expect(showModal).toHaveBeenCalledTimes(1);
|
|
158
|
+
unmount();
|
|
159
|
+
});
|
|
160
|
+
it('propagates a native start failure without entering recording state', async () => {
|
|
161
|
+
const {
|
|
162
|
+
result,
|
|
163
|
+
startRecord,
|
|
164
|
+
unmount
|
|
165
|
+
} = mountContext();
|
|
166
|
+
const error = {
|
|
167
|
+
errorCode: 1001,
|
|
168
|
+
errorMsg: 'Start failed'
|
|
169
|
+
};
|
|
170
|
+
startRecord.mockImplementationOnce(_ref5 => {
|
|
171
|
+
let {
|
|
172
|
+
fail
|
|
173
|
+
} = _ref5;
|
|
174
|
+
return fail(error);
|
|
175
|
+
});
|
|
176
|
+
await act(async () => {
|
|
177
|
+
await expect(result.current.setRecording(true)).rejects.toEqual(error);
|
|
178
|
+
});
|
|
179
|
+
expect(result.current.state.recording).toBe(false);
|
|
180
|
+
unmount();
|
|
181
|
+
});
|
|
182
|
+
it('keeps the requested album when stopping on page unload', async () => {
|
|
183
|
+
const {
|
|
184
|
+
result,
|
|
185
|
+
stopRecord,
|
|
186
|
+
capture,
|
|
187
|
+
unmount
|
|
188
|
+
} = mountContext(0);
|
|
189
|
+
await act(async () => {
|
|
190
|
+
expect(await result.current.stopRecordingOnUnload()).toEqual(capture);
|
|
191
|
+
});
|
|
192
|
+
expect(stopRecord).toHaveBeenCalledWith(expect.objectContaining({
|
|
193
|
+
saveToAlbum: 0
|
|
194
|
+
}));
|
|
195
|
+
expect(authorizeStatus).not.toHaveBeenCalled();
|
|
196
|
+
unmount();
|
|
197
|
+
});
|
|
@@ -6,6 +6,7 @@ import { IntercomMode, MuteMode, ClarityType } from '@ray-js/ray-ipc-utils/lib/i
|
|
|
6
6
|
import { createUseCtx } from './ctx';
|
|
7
7
|
import { FullSmallIntercom, VerticalSmallIntercom, BatteryFull, Battery, Screenshot, TempHumidity, Signal4G, RecordVideo, FullScreen, VideoBitKBP, Muted, Floodlight, Siren, TryExperience, Resolution, Ptz, MultiPtz, TileTip, PtzMoveableTip, LandscapeTip, TileActions, MoveablePtzControl, SwitchLayout, ToggleVerticalFull, RealTimeMagnification, ZoomTurntableEntry } from '../widgets';
|
|
8
8
|
import { authorizeStatus } from '../utils/authorize';
|
|
9
|
+
import { PlayState } from '../interface';
|
|
9
10
|
import { landscapeTipId, moveablePtzControlId, multiPtzId, ptzMoveableTipId, tileActionsId, tileTipId } from '../ui/constant';
|
|
10
11
|
import { multiPrefix } from '../widgets/multiCamera/constants';
|
|
11
12
|
const createPlayContext = ty.createIpcPlayerContext;
|
|
@@ -87,20 +88,29 @@ export const defaultBottomRightContent = [{
|
|
|
87
88
|
content: FullScreen
|
|
88
89
|
}];
|
|
89
90
|
const absoluteContent = [];
|
|
91
|
+
const renderWhenPlaying = _ref => {
|
|
92
|
+
let {
|
|
93
|
+
playState
|
|
94
|
+
} = _ref;
|
|
95
|
+
return playState === PlayState.PLAYING;
|
|
96
|
+
};
|
|
90
97
|
export const multiCameraAbsoluteContent = [{
|
|
91
98
|
id: tileTipId,
|
|
92
99
|
content: TileTip,
|
|
93
100
|
absoluteContentClassName: `${multiPrefix}-tile-tip-wrap`,
|
|
101
|
+
renderWhen: renderWhenPlaying,
|
|
94
102
|
hidden: true
|
|
95
103
|
}, {
|
|
96
104
|
id: ptzMoveableTipId,
|
|
97
105
|
content: PtzMoveableTip,
|
|
98
106
|
absoluteContentClassName: `${multiPrefix}-tile-tip-wrap`,
|
|
107
|
+
renderWhen: renderWhenPlaying,
|
|
99
108
|
hidden: true
|
|
100
109
|
}, {
|
|
101
110
|
id: landscapeTipId,
|
|
102
111
|
content: LandscapeTip,
|
|
103
112
|
absoluteContentClassName: `${multiPrefix}-tile-tip-wrap`,
|
|
113
|
+
renderWhen: renderWhenPlaying,
|
|
104
114
|
hidden: true
|
|
105
115
|
}, {
|
|
106
116
|
id: tileActionsId,
|
|
@@ -112,12 +122,12 @@ export const multiCameraAbsoluteContent = [{
|
|
|
112
122
|
absoluteNoCoverView: true,
|
|
113
123
|
hidden: true
|
|
114
124
|
}];
|
|
115
|
-
const toast =
|
|
125
|
+
const toast = _ref2 => {
|
|
116
126
|
let {
|
|
117
127
|
title,
|
|
118
128
|
duration
|
|
119
|
-
} =
|
|
120
|
-
config = _objectWithoutProperties(
|
|
129
|
+
} = _ref2,
|
|
130
|
+
config = _objectWithoutProperties(_ref2, _excluded);
|
|
121
131
|
ty.showToast(_objectSpread({
|
|
122
132
|
title,
|
|
123
133
|
duration,
|
package/lib/ctx/ctx.js
CHANGED
|
@@ -40,10 +40,13 @@ export const createUseCtx = _ref => {
|
|
|
40
40
|
initBottomRightContent,
|
|
41
41
|
initAbsoluteContent,
|
|
42
42
|
saveToAlbum = SAVE_TO_ALBUM,
|
|
43
|
+
multiLens = false,
|
|
43
44
|
showPtzControlTip = false,
|
|
44
45
|
videoSplitProtocol
|
|
45
46
|
} = _ref2;
|
|
46
47
|
const streamStatus = useRef();
|
|
48
|
+
// The page owns this context; player UI remounts must retain exposure history.
|
|
49
|
+
const trialBadgeViewedRef = useRef(false);
|
|
47
50
|
// 全屏、竖屏
|
|
48
51
|
const [screenType, setScreenType] = useAtom('vertical');
|
|
49
52
|
const IPCPlayerInstance = useRef();
|
|
@@ -59,6 +62,7 @@ export const createUseCtx = _ref => {
|
|
|
59
62
|
|
|
60
63
|
// 录像中
|
|
61
64
|
const [recording] = useAtom(false);
|
|
65
|
+
const recordingMultiLensRef = useRef(false);
|
|
62
66
|
|
|
63
67
|
// 录像是否不可点击
|
|
64
68
|
const [recordingDisabled, setRecordingDisabled] = useAtom(false);
|
|
@@ -311,6 +315,30 @@ export const createUseCtx = _ref => {
|
|
|
311
315
|
});
|
|
312
316
|
});
|
|
313
317
|
};
|
|
318
|
+
const stopRecording = showError => {
|
|
319
|
+
return new Promise((resolve, reject) => {
|
|
320
|
+
IPCPlayerInstance.current.stopRecord({
|
|
321
|
+
saveToAlbum,
|
|
322
|
+
success: res => {
|
|
323
|
+
recordingMultiLensRef.current = false;
|
|
324
|
+
updateAtom(recording, false);
|
|
325
|
+
resolve(res);
|
|
326
|
+
},
|
|
327
|
+
fail: err => {
|
|
328
|
+
recordingMultiLensRef.current = false;
|
|
329
|
+
updateAtom(recording, false);
|
|
330
|
+
reject(err);
|
|
331
|
+
if (showError) {
|
|
332
|
+
const errObj = err.innerError || err || {};
|
|
333
|
+
const errMsg = errObj.errorMsg || Strings.getLang('ipc_player_stop_recording_err');
|
|
334
|
+
toast({
|
|
335
|
+
title: errMsg
|
|
336
|
+
});
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
});
|
|
340
|
+
});
|
|
341
|
+
};
|
|
314
342
|
const multiCameraCtx = useMultiCameraCtx({
|
|
315
343
|
devId,
|
|
316
344
|
IPCPlayerInstance: IPCPlayerInstance.current,
|
|
@@ -318,9 +346,11 @@ export const createUseCtx = _ref => {
|
|
|
318
346
|
});
|
|
319
347
|
return {
|
|
320
348
|
devId,
|
|
349
|
+
trialBadgeViewedRef,
|
|
321
350
|
brandColor,
|
|
322
351
|
verticalMic,
|
|
323
352
|
saveToAlbum,
|
|
353
|
+
multiLens,
|
|
324
354
|
screenType,
|
|
325
355
|
isVerticalFullLayout,
|
|
326
356
|
setIsVerticalFullLayout,
|
|
@@ -465,44 +495,25 @@ export const createUseCtx = _ref => {
|
|
|
465
495
|
eventRef.current.emit(changeIgnoreHideStopPreview, false);
|
|
466
496
|
return false;
|
|
467
497
|
}
|
|
468
|
-
if (target)
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
}
|
|
498
|
+
if (!target) return stopRecording(true);
|
|
499
|
+
const granted = await ensureAlbumPermission();
|
|
500
|
+
eventRef.current.emit(changeIgnoreHideStopPreview, false);
|
|
501
|
+
if (!granted) return false;
|
|
473
502
|
return new Promise((resolve, reject) => {
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
});
|
|
486
|
-
} else {
|
|
487
|
-
IPCPlayerInstance.current.stopRecord({
|
|
488
|
-
saveToAlbum,
|
|
489
|
-
success: res => {
|
|
490
|
-
updateAtom(recording, false);
|
|
491
|
-
resolve(res);
|
|
492
|
-
},
|
|
493
|
-
fail: err => {
|
|
494
|
-
updateAtom(recording, false);
|
|
495
|
-
reject(err);
|
|
496
|
-
const errObj = err.innerError || err || {};
|
|
497
|
-
const errMsg = errObj.errorMsg || Strings.getLang('ipc_player_stop_recording_err');
|
|
498
|
-
toast({
|
|
499
|
-
title: errMsg
|
|
500
|
-
});
|
|
501
|
-
}
|
|
502
|
-
});
|
|
503
|
-
}
|
|
503
|
+
IPCPlayerInstance.current.startRecord({
|
|
504
|
+
saveToAlbum,
|
|
505
|
+
success: () => {
|
|
506
|
+
updateAtom(recording, true);
|
|
507
|
+
resolve(true);
|
|
508
|
+
},
|
|
509
|
+
fail: err => {
|
|
510
|
+
eventRef.current.emit(changeIgnoreHideStopPreview, false);
|
|
511
|
+
reject(err);
|
|
512
|
+
}
|
|
513
|
+
});
|
|
504
514
|
});
|
|
505
515
|
},
|
|
516
|
+
stopRecordingOnUnload: () => stopRecording(false),
|
|
506
517
|
setRecordingDisabled,
|
|
507
518
|
setScreenType,
|
|
508
519
|
topLeftContent,
|
|
@@ -92,6 +92,8 @@ export declare const useMultiCameraCtx: (props: Props) => {
|
|
|
92
92
|
* 设置ptz状态
|
|
93
93
|
*/
|
|
94
94
|
setPtzStatus: (value: boolean | ((prevValue: boolean) => boolean)) => void;
|
|
95
|
+
togglePtz: (this: unknown) => void;
|
|
96
|
+
openDefaultPtz: (this: unknown) => void;
|
|
95
97
|
/**
|
|
96
98
|
* 显示/隐藏镜头名称
|
|
97
99
|
*/
|
|
@@ -6,7 +6,10 @@ import { MultiCameraLayoutStyle, MultiCameraScreenMode } from '../interface';
|
|
|
6
6
|
import { useDpSupport } from '../hooks';
|
|
7
7
|
import { GUN_BALL, MULTI_GUN_BALL, MULTI_PTZ_CONTROL, MULTI_ZOOM_CONTROL, PTZ_CONTROL, ZOOM_CONTROL } from '../utils/content/dpCode';
|
|
8
8
|
import { getLensSupportDirections, isSwipeDirectionSupported } from '../utils';
|
|
9
|
-
import { useAtom } from './store';
|
|
9
|
+
import { getDefaultStore, useAtom } from './store';
|
|
10
|
+
|
|
11
|
+
// Keep the opt-out across player remounts, only for this miniapp runtime.
|
|
12
|
+
let ptzManuallyClosed = false;
|
|
10
13
|
const DEFAULT_VIDEO_SPLIT_PROTOCOL = {
|
|
11
14
|
total_split_num: 1,
|
|
12
15
|
split_info: [],
|
|
@@ -56,6 +59,17 @@ export const useMultiCameraCtx = props => {
|
|
|
56
59
|
const [selectedLenInfoAtom, setSelectedLenInfo] = useAtom(DEFAULT_SELECTED_LEN_INFO);
|
|
57
60
|
const [nextLayoutStyleAtom, setNextLayoutStyle] = useAtom(MultiCameraLayoutStyle.invalid);
|
|
58
61
|
const [ptzStatusAtom, setPtzStatus] = useAtom(false);
|
|
62
|
+
const togglePtz = useMemoizedFn(() => {
|
|
63
|
+
const store = getDefaultStore();
|
|
64
|
+
const nextStatus = !store.get(ptzStatusAtom);
|
|
65
|
+
if (!nextStatus && store.get(screenModeAtom) === MultiCameraScreenMode.full) {
|
|
66
|
+
ptzManuallyClosed = true;
|
|
67
|
+
}
|
|
68
|
+
setPtzStatus(nextStatus);
|
|
69
|
+
});
|
|
70
|
+
const openDefaultPtz = useMemoizedFn(() => {
|
|
71
|
+
if (!ptzManuallyClosed) setPtzStatus(true);
|
|
72
|
+
});
|
|
59
73
|
const selectVideoFiredRef = useRef(false);
|
|
60
74
|
const selectedLenInfoRef = useRef(DEFAULT_SELECTED_LEN_INFO);
|
|
61
75
|
const handleSelectVideoIndex = useMemoizedFn(event => {
|
|
@@ -310,6 +324,8 @@ export const useMultiCameraCtx = props => {
|
|
|
310
324
|
* 设置ptz状态
|
|
311
325
|
*/
|
|
312
326
|
setPtzStatus,
|
|
327
|
+
togglePtz,
|
|
328
|
+
openDefaultPtz,
|
|
313
329
|
/**
|
|
314
330
|
* 显示/隐藏镜头名称
|
|
315
331
|
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { act, renderHook } from '@testing-library/react-hooks';
|
|
2
|
+
jest.mock('@ray-js/ray-ipc-utils', () => ({}));
|
|
3
|
+
jest.mock('@ray-js/ray-ipc-utils/lib/interface', () => ({}));
|
|
4
|
+
jest.mock('../hooks', () => ({
|
|
5
|
+
useDpSupport: () => ({})
|
|
6
|
+
}));
|
|
7
|
+
jest.mock('../utils', () => ({}));
|
|
8
|
+
const {
|
|
9
|
+
useMultiCameraCtx
|
|
10
|
+
} = require('./multiCameraCtx');
|
|
11
|
+
const {
|
|
12
|
+
getDefaultStore,
|
|
13
|
+
updateAtom
|
|
14
|
+
} = require('./store');
|
|
15
|
+
const {
|
|
16
|
+
MultiCameraScreenMode
|
|
17
|
+
} = require('../interface');
|
|
18
|
+
it('keeps the portrait PTZ opt-out across player remounts until the miniapp restarts', () => {
|
|
19
|
+
const props = {
|
|
20
|
+
devId: 'test-device',
|
|
21
|
+
IPCPlayerInstance: {
|
|
22
|
+
switchLayoutStyle: () => undefined
|
|
23
|
+
},
|
|
24
|
+
videoSplitProtocol: {
|
|
25
|
+
total_split_num: 2,
|
|
26
|
+
p_v: 3,
|
|
27
|
+
split_info: []
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
const store = getDefaultStore();
|
|
31
|
+
const player = renderHook(() => useMultiCameraCtx(props));
|
|
32
|
+
const isOpen = () => store.get(player.result.current.ptzStatus);
|
|
33
|
+
act(() => player.result.current.openDefaultPtz());
|
|
34
|
+
expect(isOpen()).toBe(true);
|
|
35
|
+
|
|
36
|
+
// Programmatic collapse must not disable the next automatic expansion.
|
|
37
|
+
act(() => player.result.current.setPtzStatus(false));
|
|
38
|
+
act(() => player.result.current.openDefaultPtz());
|
|
39
|
+
expect(isOpen()).toBe(true);
|
|
40
|
+
|
|
41
|
+
// Landscape interaction must not opt out of the portrait-only policy.
|
|
42
|
+
act(() => updateAtom(player.result.current.screenMode, MultiCameraScreenMode.landscape));
|
|
43
|
+
act(() => player.result.current.togglePtz());
|
|
44
|
+
expect(isOpen()).toBe(false);
|
|
45
|
+
act(() => updateAtom(player.result.current.screenMode, MultiCameraScreenMode.full));
|
|
46
|
+
act(() => player.result.current.openDefaultPtz());
|
|
47
|
+
expect(isOpen()).toBe(true);
|
|
48
|
+
act(() => player.result.current.togglePtz());
|
|
49
|
+
act(() => player.result.current.openDefaultPtz());
|
|
50
|
+
expect(isOpen()).toBe(false);
|
|
51
|
+
|
|
52
|
+
// Explicit reopening remains available without clearing the opt-out.
|
|
53
|
+
act(() => player.result.current.togglePtz());
|
|
54
|
+
expect(isOpen()).toBe(true);
|
|
55
|
+
act(() => player.result.current.setPtzStatus(false));
|
|
56
|
+
act(() => player.result.current.openDefaultPtz());
|
|
57
|
+
expect(isOpen()).toBe(false);
|
|
58
|
+
player.unmount();
|
|
59
|
+
const remounted = renderHook(() => useMultiCameraCtx(props));
|
|
60
|
+
act(() => remounted.result.current.openDefaultPtz());
|
|
61
|
+
expect(store.get(remounted.result.current.ptzStatus)).toBe(false);
|
|
62
|
+
act(() => remounted.result.current.togglePtz());
|
|
63
|
+
expect(store.get(remounted.result.current.ptzStatus)).toBe(true);
|
|
64
|
+
remounted.unmount();
|
|
65
|
+
});
|
package/lib/i18n/index.d.ts
CHANGED
|
@@ -10,8 +10,11 @@ declare const Strings: kit.I18N<{
|
|
|
10
10
|
ipc_player_resolution_AUDIO: string;
|
|
11
11
|
ipc_player_current_resolution_is_equal: string;
|
|
12
12
|
ipc_player_screenshot_success_tip: string;
|
|
13
|
+
ipc_player_screenshot_multi_success_tip: string;
|
|
13
14
|
ipc_player_error_screenshot_error_tip: string;
|
|
14
15
|
ipc_player_record_success_tip: string;
|
|
16
|
+
ipc_player_record_multi_success_tip: string;
|
|
17
|
+
ipc_player_multi_capture_success_count: string;
|
|
15
18
|
ipc_player_shot_success_check: string;
|
|
16
19
|
ipc_player_record_success_check: string;
|
|
17
20
|
ipc_player_recording_now_tip: string;
|
|
@@ -52,8 +55,11 @@ declare const Strings: kit.I18N<{
|
|
|
52
55
|
ipc_player_resolution_AUDIO: string;
|
|
53
56
|
ipc_player_current_resolution_is_equal: string;
|
|
54
57
|
ipc_player_screenshot_success_tip: string;
|
|
58
|
+
ipc_player_screenshot_multi_success_tip: string;
|
|
55
59
|
ipc_player_error_screenshot_error_tip: string;
|
|
56
60
|
ipc_player_record_success_tip: string;
|
|
61
|
+
ipc_player_record_multi_success_tip: string;
|
|
62
|
+
ipc_player_multi_capture_success_count: string;
|
|
57
63
|
ipc_player_shot_success_check: string;
|
|
58
64
|
ipc_player_record_success_check: string;
|
|
59
65
|
ipc_player_recording_now_tip: string;
|
|
@@ -94,8 +100,11 @@ declare const Strings: kit.I18N<{
|
|
|
94
100
|
ipc_player_resolution_AUDIO: string;
|
|
95
101
|
ipc_player_current_resolution_is_equal: string;
|
|
96
102
|
ipc_player_screenshot_success_tip: string;
|
|
103
|
+
ipc_player_screenshot_multi_success_tip: string;
|
|
97
104
|
ipc_player_error_screenshot_error_tip: string;
|
|
98
105
|
ipc_player_record_success_tip: string;
|
|
106
|
+
ipc_player_record_multi_success_tip: string;
|
|
107
|
+
ipc_player_multi_capture_success_count: string;
|
|
99
108
|
ipc_player_shot_success_check: string;
|
|
100
109
|
ipc_player_record_success_check: string;
|
|
101
110
|
ipc_player_recording_now_tip: string;
|
|
@@ -135,8 +144,11 @@ declare const Strings: kit.I18N<{
|
|
|
135
144
|
ipc_player_resolution_AUDIO: string;
|
|
136
145
|
ipc_player_current_resolution_is_equal: string;
|
|
137
146
|
ipc_player_screenshot_success_tip: string;
|
|
147
|
+
ipc_player_screenshot_multi_success_tip: string;
|
|
138
148
|
ipc_player_error_screenshot_error_tip: string;
|
|
139
149
|
ipc_player_record_success_tip: string;
|
|
150
|
+
ipc_player_record_multi_success_tip: string;
|
|
151
|
+
ipc_player_multi_capture_success_count: string;
|
|
140
152
|
ipc_player_shot_success_check: string;
|
|
141
153
|
ipc_player_record_success_check: string;
|
|
142
154
|
ipc_player_recording_now_tip: string;
|
package/lib/i18n/strings.d.ts
CHANGED
|
@@ -9,8 +9,11 @@ declare const _default: {
|
|
|
9
9
|
ipc_player_resolution_AUDIO: string;
|
|
10
10
|
ipc_player_current_resolution_is_equal: string;
|
|
11
11
|
ipc_player_screenshot_success_tip: string;
|
|
12
|
+
ipc_player_screenshot_multi_success_tip: string;
|
|
12
13
|
ipc_player_error_screenshot_error_tip: string;
|
|
13
14
|
ipc_player_record_success_tip: string;
|
|
15
|
+
ipc_player_record_multi_success_tip: string;
|
|
16
|
+
ipc_player_multi_capture_success_count: string;
|
|
14
17
|
ipc_player_shot_success_check: string;
|
|
15
18
|
ipc_player_record_success_check: string;
|
|
16
19
|
ipc_player_recording_now_tip: string;
|
|
@@ -51,8 +54,11 @@ declare const _default: {
|
|
|
51
54
|
ipc_player_resolution_AUDIO: string;
|
|
52
55
|
ipc_player_current_resolution_is_equal: string;
|
|
53
56
|
ipc_player_screenshot_success_tip: string;
|
|
57
|
+
ipc_player_screenshot_multi_success_tip: string;
|
|
54
58
|
ipc_player_error_screenshot_error_tip: string;
|
|
55
59
|
ipc_player_record_success_tip: string;
|
|
60
|
+
ipc_player_record_multi_success_tip: string;
|
|
61
|
+
ipc_player_multi_capture_success_count: string;
|
|
56
62
|
ipc_player_shot_success_check: string;
|
|
57
63
|
ipc_player_record_success_check: string;
|
|
58
64
|
ipc_player_recording_now_tip: string;
|
package/lib/i18n/strings.js
CHANGED
|
@@ -9,8 +9,11 @@ export default {
|
|
|
9
9
|
ipc_player_resolution_AUDIO: 'Audio Mode',
|
|
10
10
|
ipc_player_current_resolution_is_equal: 'Already at current clarity',
|
|
11
11
|
ipc_player_screenshot_success_tip: 'Screenshot saved to album',
|
|
12
|
+
ipc_player_screenshot_multi_success_tip: 'Screenshots saved to album',
|
|
12
13
|
ipc_player_error_screenshot_error_tip: 'Screenshot failed. Please try again later.',
|
|
13
14
|
ipc_player_record_success_tip: 'Recording saved to album',
|
|
15
|
+
ipc_player_record_multi_success_tip: 'Recordings saved to album',
|
|
16
|
+
ipc_player_multi_capture_success_count: '{0} items',
|
|
14
17
|
ipc_player_shot_success_check: 'View',
|
|
15
18
|
ipc_player_record_success_check: 'View',
|
|
16
19
|
ipc_player_recording_now_tip: 'Recording in progress...',
|
|
@@ -51,8 +54,11 @@ export default {
|
|
|
51
54
|
ipc_player_resolution_AUDIO: '音频模式',
|
|
52
55
|
ipc_player_current_resolution_is_equal: '已是当前清晰度',
|
|
53
56
|
ipc_player_screenshot_success_tip: '截图已保存在APP相册',
|
|
57
|
+
ipc_player_screenshot_multi_success_tip: '图片已保存至相册',
|
|
54
58
|
ipc_player_error_screenshot_error_tip: '截图失败了,请稍后再试',
|
|
55
59
|
ipc_player_record_success_tip: '录像已保存在APP相册',
|
|
60
|
+
ipc_player_record_multi_success_tip: '视频已保存至相册',
|
|
61
|
+
ipc_player_multi_capture_success_count: '共{0}个',
|
|
56
62
|
ipc_player_shot_success_check: '查看',
|
|
57
63
|
ipc_player_record_success_check: '查看',
|
|
58
64
|
ipc_player_recording_now_tip: '正在录像中...',
|
package/lib/index.d.ts
CHANGED
|
@@ -5,7 +5,3 @@ import * as Widgets from './widgets';
|
|
|
5
5
|
import * as Features from './features';
|
|
6
6
|
import * as Utils from './utils';
|
|
7
7
|
export { Widgets, Features, Utils };
|
|
8
|
-
export { PlayerRenderModeContext } from './renderer/context';
|
|
9
|
-
export type { PlayerRenderMode } from './renderer/context';
|
|
10
|
-
export type { LynxPlayerAdapters } from './renderer/capabilities';
|
|
11
|
-
export { LynxPlayerAdaptersContext } from './renderer/capabilities';
|
package/lib/index.js
CHANGED
|
@@ -4,6 +4,4 @@ export * from './interface';
|
|
|
4
4
|
import * as Widgets from './widgets';
|
|
5
5
|
import * as Features from './features';
|
|
6
6
|
import * as Utils from './utils';
|
|
7
|
-
export { Widgets, Features, Utils };
|
|
8
|
-
export { PlayerRenderModeContext } from './renderer/context';
|
|
9
|
-
export { LynxPlayerAdaptersContext } from './renderer/capabilities';
|
|
7
|
+
export { Widgets, Features, Utils };
|
package/lib/interface.d.ts
CHANGED
|
@@ -49,13 +49,16 @@ export type UseCtx = (options: {
|
|
|
49
49
|
initBottomRightContent?: ComponentConfig[];
|
|
50
50
|
initAbsoluteContent?: ComponentConfig[];
|
|
51
51
|
saveToAlbum?: 0 | 1;
|
|
52
|
+
multiLens?: boolean;
|
|
52
53
|
showPtzControlTip?: boolean;
|
|
53
54
|
videoSplitProtocol?: VideoSplitProtocol;
|
|
54
55
|
}) => {
|
|
55
56
|
devId: string;
|
|
57
|
+
trialBadgeViewedRef: React.MutableRefObject<boolean>;
|
|
56
58
|
brandColor: RetAtom<string>;
|
|
57
59
|
verticalMic: RetAtom<boolean>;
|
|
58
60
|
saveToAlbum: 0 | 1;
|
|
61
|
+
multiLens: boolean;
|
|
59
62
|
showPtzControlTip: boolean;
|
|
60
63
|
screenType: RetAtom<ScreenType>;
|
|
61
64
|
isVerticalFullLayout: RetAtom<boolean>;
|
|
@@ -91,7 +94,8 @@ export type UseCtx = (options: {
|
|
|
91
94
|
setRecordingDisabled: (type: boolean) => void;
|
|
92
95
|
setResolution: (type: string) => Promise<boolean>;
|
|
93
96
|
setResolutionList: (type: string[]) => void;
|
|
94
|
-
setRecording: (value: boolean, onlyUpdateAtom?: boolean) => Promise<
|
|
97
|
+
setRecording: (value: boolean, onlyUpdateAtom?: boolean) => Promise<CaptureResult>;
|
|
98
|
+
stopRecordingOnUnload: () => Promise<CaptureResult>;
|
|
95
99
|
setIntercom: (value: boolean, onlyUpdateAtom?: boolean) => Promise<boolean>;
|
|
96
100
|
setMute: (value: boolean) => Promise<boolean>;
|
|
97
101
|
changeStreamStatus: (value: PlayerStreamStatus) => void;
|
|
@@ -122,8 +126,12 @@ export type ComponentConfig<T = ReturnType<UseCtx> & Record<string, any>> = {
|
|
|
122
126
|
absoluteContentClassName?: string;
|
|
123
127
|
absoluteContentStyle?: React.CSSProperties;
|
|
124
128
|
absoluteNoCoverView?: boolean;
|
|
129
|
+
renderWhen?: (state: ComponentRenderState) => boolean;
|
|
125
130
|
hidden?: boolean;
|
|
126
131
|
};
|
|
132
|
+
export type ComponentRenderState = {
|
|
133
|
+
playState: PlayState;
|
|
134
|
+
};
|
|
127
135
|
export type ComponentConfigProps = {
|
|
128
136
|
IPCPlayerContext: IpcContext;
|
|
129
137
|
} & ReturnType<UseCtx>;
|
|
@@ -131,11 +139,17 @@ export type PlayStatusData = {
|
|
|
131
139
|
playState: PlayState;
|
|
132
140
|
playCode: number;
|
|
133
141
|
};
|
|
134
|
-
export type
|
|
142
|
+
export type CaptureFileInfo = {
|
|
143
|
+
index?: number;
|
|
135
144
|
tempImagePath: string;
|
|
136
145
|
filePath: string;
|
|
137
|
-
thumbPath
|
|
146
|
+
thumbPath?: string;
|
|
147
|
+
width?: number;
|
|
148
|
+
height?: number;
|
|
149
|
+
data?: string;
|
|
138
150
|
};
|
|
151
|
+
export type CaptureResult = boolean | CaptureFileInfo;
|
|
152
|
+
export type RecordInfoData = CaptureResult;
|
|
139
153
|
/**
|
|
140
154
|
* 多目屏幕模式
|
|
141
155
|
*/
|