@ray-js/ipc-player-integration 0.0.65-beta.4 → 0.0.66-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 -46
- 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 -17
- 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.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/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 +119 -55
- package/lib/ui/bottomRightContent.js +6 -3
- package/lib/ui/scrollHintArrow.d.ts +23 -0
- package/lib/ui/scrollHintArrow.js +82 -0
- package/lib/ui/ui.d.ts +5 -0
- package/lib/ui/ui.js +89 -98
- 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/floodlight/floodlight.js +2 -1
- package/lib/widgets/flowLowTip/flowLowTip.js +2 -1
- package/lib/widgets/fullScreen/fullScreen.js +2 -1
- 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 +12 -3
- package/lib/widgets/moveInteractiveControl/moveInteractiveControlUI.less +24 -4
- package/lib/widgets/multiCamera/index.less +0 -1
- package/lib/widgets/multiCamera/landscapeTip.js +2 -1
- package/lib/widgets/multiCamera/moveablePtzControl.js +5 -5
- package/lib/widgets/multiCamera/multiPtz.js +3 -2
- package/lib/widgets/multiCamera/ptzMoveableTip.js +2 -1
- 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 +2 -1
- 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 +1 -1
- package/lib/widgets/ptzControlTip/ptzControlTip.js +6 -3
- package/lib/widgets/ptzControlTip/ptzControlTip.less +6 -0
- package/lib/widgets/realTimeMagnification/realTimeMagnification.js +2 -1
- package/lib/widgets/recordVideo/recordVideo.js +54 -58
- package/lib/widgets/recordVideo/recordVideo.less +74 -17
- package/lib/widgets/recordVideo/recordVideo.test.js +0 -1
- package/lib/widgets/resolution/fullResolutionControl.js +29 -19
- package/lib/widgets/resolution/resolution.js +3 -2
- package/lib/widgets/screenshot/screenshot.js +45 -67
- package/lib/widgets/screenshot/screenshot.less +40 -1
- 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 +2 -13
- 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 +2 -0
- package/lib/widgets/zoomTurntable/zoomTurntableDock.js +1 -1
- package/lib/widgets/zoomTurntable/zoomTurntableEntry.js +31 -18
- package/lib/widgets/zoomTurntable/zoomTurntableTip.js +23 -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
- package/lib/widgets/screenshot/screenshot.test.d.ts +0 -1
- package/lib/widgets/screenshot/screenshot.test.js +0 -135
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
import "core-js/modules/esnext.iterator.constructor.js";
|
|
2
|
-
import "core-js/modules/esnext.iterator.map.js";
|
|
3
1
|
import React, { useState, useEffect, useRef, useContext } from 'react';
|
|
4
|
-
import { View,
|
|
2
|
+
import { View, Image, getSystemInfoSync } from '@ray-js/ray';
|
|
5
3
|
import { useSetState, useUpdateEffect } from 'ahooks';
|
|
6
4
|
import clsx from 'clsx';
|
|
7
5
|
import { goToIpcPageNativeRoute } from '@ray-js/ray-ipc-utils';
|
|
6
|
+
import { PlayerText as Text } from '../../renderer/text';
|
|
8
7
|
import Strings from '../../i18n';
|
|
9
8
|
import { PlayState } from '../../interface';
|
|
10
|
-
import { getCaptureResultSummary } from '../../utils/captureResult';
|
|
11
|
-
import { CaptureResultToast } from '../captureResult/captureResult';
|
|
12
9
|
import { UIEventContext } from '../../ui/context';
|
|
13
10
|
import { pauseTimeToHideAllComponent, changeIgnoreHideStopPreview, widgetLabs, widgetClick } from '../../ui/constant';
|
|
14
11
|
import { useStore, getDefaultStore } from '../../ctx/store';
|
|
@@ -104,45 +101,22 @@ export function RecordVideo(props) {
|
|
|
104
101
|
playState: props.playState
|
|
105
102
|
});
|
|
106
103
|
const [state, setState] = useSetState({
|
|
104
|
+
showTimer: false,
|
|
107
105
|
showShot: false,
|
|
108
|
-
shotUrl: ''
|
|
109
|
-
shotCount: 0
|
|
106
|
+
shotUrl: ''
|
|
110
107
|
});
|
|
111
|
-
const recordResultRequestIdRef = useRef(0);
|
|
112
|
-
useEffect(() => {
|
|
113
|
-
return () => {
|
|
114
|
-
recordResultRequestIdRef.current += 1;
|
|
115
|
-
};
|
|
116
|
-
}, []);
|
|
117
|
-
const showRecordResult = async recordInfo => {
|
|
118
|
-
var _props$multiCameraCtx;
|
|
119
|
-
const requestId = ++recordResultRequestIdRef.current;
|
|
120
|
-
const lensIndices = (_props$multiCameraCtx = props.multiCameraCtx) === null || _props$multiCameraCtx === void 0 || (_props$multiCameraCtx = _props$multiCameraCtx.protocol) === null || _props$multiCameraCtx === void 0 || (_props$multiCameraCtx = _props$multiCameraCtx.split_info) === null || _props$multiCameraCtx === void 0 ? void 0 : _props$multiCameraCtx.map(lens => lens.index);
|
|
121
|
-
const summary = await getCaptureResultSummary(recordInfo, {
|
|
122
|
-
multiLens: props.multiLens,
|
|
123
|
-
lensIndices,
|
|
124
|
-
devId
|
|
125
|
-
});
|
|
126
|
-
if (requestId !== recordResultRequestIdRef.current) return;
|
|
127
|
-
if (!summary) return;
|
|
128
|
-
setState({
|
|
129
|
-
showShot: true,
|
|
130
|
-
shotUrl: summary.thumbnailPath,
|
|
131
|
-
shotCount: summary.isMultiLens ? summary.count : 0
|
|
132
|
-
});
|
|
133
|
-
};
|
|
134
108
|
|
|
135
109
|
/**
|
|
136
110
|
* 针对 playState为非连接中状态时,如果处于录制中, 结束录制
|
|
137
111
|
*/
|
|
138
112
|
useEffect(() => {
|
|
139
113
|
(async () => {
|
|
140
|
-
if (playState !== PlayState.PLAYING
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
114
|
+
if (playState !== PlayState.PLAYING) {
|
|
115
|
+
if (recording) {
|
|
116
|
+
setState({
|
|
117
|
+
showTimer: false
|
|
118
|
+
});
|
|
119
|
+
await setRecording(false);
|
|
146
120
|
}
|
|
147
121
|
}
|
|
148
122
|
})();
|
|
@@ -156,8 +130,7 @@ export function RecordVideo(props) {
|
|
|
156
130
|
timer.current = setTimeout(() => {
|
|
157
131
|
setState({
|
|
158
132
|
showShot: false,
|
|
159
|
-
shotUrl: ''
|
|
160
|
-
shotCount: 0
|
|
133
|
+
shotUrl: ''
|
|
161
134
|
});
|
|
162
135
|
deleteContent('absolute', RECORD_VIDEO_SUCCESS_TOAST_ID);
|
|
163
136
|
}, CLOSE_TIME);
|
|
@@ -177,20 +150,22 @@ export function RecordVideo(props) {
|
|
|
177
150
|
showRecordToast();
|
|
178
151
|
}
|
|
179
152
|
}, [state.showShot, screenType]);
|
|
153
|
+
|
|
154
|
+
/** 根据showTimer的显示定时器 */
|
|
180
155
|
useUpdateEffect(() => {
|
|
181
|
-
if (
|
|
156
|
+
if (state.showTimer) {
|
|
182
157
|
showRecordTimer();
|
|
183
158
|
} else {
|
|
184
159
|
deleteContent('absolute', RECORD_VIDEO_TIMER_ID);
|
|
160
|
+
// 清除定时器,元素移除
|
|
185
161
|
}
|
|
186
|
-
}, [
|
|
162
|
+
}, [state.showTimer]);
|
|
187
163
|
|
|
188
164
|
/** 跳转相册 */
|
|
189
165
|
const handCheck = () => {
|
|
190
166
|
setState({
|
|
191
167
|
showShot: false,
|
|
192
|
-
shotUrl: ''
|
|
193
|
-
shotCount: 0
|
|
168
|
+
shotUrl: ''
|
|
194
169
|
});
|
|
195
170
|
deleteContent('absolute', RECORD_VIDEO_SUCCESS_TOAST_ID);
|
|
196
171
|
clearInterval(timer.current);
|
|
@@ -212,13 +187,27 @@ export function RecordVideo(props) {
|
|
|
212
187
|
marginLeft: screenType === 'vertical' ? '0' : '-200px'
|
|
213
188
|
},
|
|
214
189
|
content: () => {
|
|
215
|
-
return /*#__PURE__*/React.createElement(
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
190
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
191
|
+
className: "ipc-player-plugin-record-success-toast"
|
|
192
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
193
|
+
className: "ipc-player-plugin-record-success-toast-image-box"
|
|
194
|
+
}, /*#__PURE__*/React.createElement(Image, {
|
|
195
|
+
className: "ipc-player-plugin-record-success-toast-image",
|
|
196
|
+
src: state.shotUrl
|
|
197
|
+
}), /*#__PURE__*/React.createElement(View, {
|
|
198
|
+
className: "ipc-player-plugin-record-success-play-icon-box"
|
|
199
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
200
|
+
className: clsx('icon-panel', 'icon-panel-record-play', 'ipc-player-plugin-record-success-play-icon')
|
|
201
|
+
}))), /*#__PURE__*/React.createElement(View, {
|
|
202
|
+
className: "ipc-player-plugin-record-success-toast-title"
|
|
203
|
+
}, Strings.getLang('ipc_player_record_success_tip')), /*#__PURE__*/React.createElement(View, {
|
|
204
|
+
onClick: handCheck,
|
|
205
|
+
className: "ipc-player-plugin-record-success-toast-bottom",
|
|
206
|
+
style: {
|
|
207
|
+
color: brandColor,
|
|
208
|
+
borderColor: brandColor
|
|
209
|
+
}
|
|
210
|
+
}, Strings.getLang('ipc_player_record_success_check')));
|
|
222
211
|
}
|
|
223
212
|
});
|
|
224
213
|
timeToCloseRecordToast();
|
|
@@ -230,8 +219,8 @@ export function RecordVideo(props) {
|
|
|
230
219
|
absoluteContentClassName: 'ipc-player-plugin-record-video-toast-wrap',
|
|
231
220
|
content: () => /*#__PURE__*/React.createElement(View, {
|
|
232
221
|
className: clsx('ipc-player-plugin-record-video-toast', {
|
|
233
|
-
'ipc-player-plugin-record-video-toast-show':
|
|
234
|
-
'ipc-player-plugin-record-video-toast-hide': !
|
|
222
|
+
'ipc-player-plugin-record-video-toast-show': state.showTimer,
|
|
223
|
+
'ipc-player-plugin-record-video-toast-hide': !state.showTimer
|
|
235
224
|
})
|
|
236
225
|
}, /*#__PURE__*/React.createElement(View, {
|
|
237
226
|
className: "ipc-player-plugin-record-video-toast-point",
|
|
@@ -242,9 +231,9 @@ export function RecordVideo(props) {
|
|
|
242
231
|
});
|
|
243
232
|
};
|
|
244
233
|
const handRecordVideo = async () => {
|
|
245
|
-
var _props$event;
|
|
234
|
+
var _props$event, _props$event2;
|
|
246
235
|
const ev = (_props$event = props.event) !== null && _props$event !== void 0 ? _props$event : event;
|
|
247
|
-
|
|
236
|
+
((_props$event2 = props.event) !== null && _props$event2 !== void 0 ? _props$event2 : event).emit(widgetClick, {
|
|
248
237
|
widgetId: widgetLabs.RECORD_VIDEO
|
|
249
238
|
});
|
|
250
239
|
event.emit(pauseTimeToHideAllComponent);
|
|
@@ -254,13 +243,10 @@ export function RecordVideo(props) {
|
|
|
254
243
|
if (recordingDisabled) {
|
|
255
244
|
return false;
|
|
256
245
|
}
|
|
257
|
-
|
|
258
|
-
if (state.showShot) {
|
|
246
|
+
if (state.showShot && _recording) {
|
|
259
247
|
setState({
|
|
260
248
|
showShot: false
|
|
261
249
|
});
|
|
262
|
-
deleteContent('absolute', RECORD_VIDEO_SUCCESS_TOAST_ID);
|
|
263
|
-
clearTimeout(timer.current);
|
|
264
250
|
}
|
|
265
251
|
// 发送忽略进入后台停止预览的标记
|
|
266
252
|
const {
|
|
@@ -277,11 +263,18 @@ export function RecordVideo(props) {
|
|
|
277
263
|
}
|
|
278
264
|
if (target) {
|
|
279
265
|
setRecordingDisabled(true);
|
|
266
|
+
setState({
|
|
267
|
+
showTimer: true
|
|
268
|
+
});
|
|
280
269
|
/** 录制开始后3秒后才可结束 */
|
|
281
270
|
timeToResetRecordDisabled();
|
|
282
271
|
} else {
|
|
283
272
|
props.event ? props.event.emit(changeIgnoreHideStopPreview, false) : event.emit(changeIgnoreHideStopPreview, false);
|
|
284
|
-
|
|
273
|
+
setState({
|
|
274
|
+
showTimer: false,
|
|
275
|
+
showShot: true,
|
|
276
|
+
shotUrl: recordInfo.tempImagePath
|
|
277
|
+
});
|
|
285
278
|
}
|
|
286
279
|
} catch (err) {
|
|
287
280
|
props.event ? props.event.emit(changeIgnoreHideStopPreview, false) : event.emit(changeIgnoreHideStopPreview, false);
|
|
@@ -291,6 +284,9 @@ export function RecordVideo(props) {
|
|
|
291
284
|
toast({
|
|
292
285
|
title: errMsg
|
|
293
286
|
});
|
|
287
|
+
setState({
|
|
288
|
+
showTimer: false
|
|
289
|
+
});
|
|
294
290
|
}
|
|
295
291
|
return true;
|
|
296
292
|
};
|
|
@@ -1,59 +1,116 @@
|
|
|
1
1
|
.ipc-player-plugin-record-video-icon {
|
|
2
|
-
color: var(--iconColor);
|
|
3
2
|
font-size: calc(var(--iconPlayerSize) * var(--ipc-player-size-scale, 1)) !important;
|
|
3
|
+
color: var(--iconColor);
|
|
4
4
|
}
|
|
5
|
-
|
|
6
5
|
.ipc-player-plugin-record-video-toast-wrap {
|
|
6
|
+
z-index: 400;
|
|
7
7
|
position: absolute;
|
|
8
8
|
top: calc(7px * var(--ipc-player-size-scale, 1));
|
|
9
9
|
left: 50%;
|
|
10
|
-
z-index: 400;
|
|
11
10
|
transform: translateX(-50%);
|
|
12
11
|
}
|
|
13
12
|
|
|
13
|
+
// 计时器显示
|
|
14
14
|
.ipc-player-plugin-record-video-toast-show {
|
|
15
15
|
transform: translate(0, 0) !important;
|
|
16
16
|
transition: transform ease-in 3s;
|
|
17
17
|
}
|
|
18
|
-
|
|
18
|
+
// 计时器隐藏
|
|
19
19
|
.ipc-player-plugin-record-video-toast-hide {
|
|
20
20
|
transform: translate(0, -110%) !important;
|
|
21
21
|
transition: transform 0.3s ease-in-out;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
.ipc-player-plugin-record-video-toast {
|
|
25
|
+
transform: translate(0, -110%);
|
|
25
26
|
display: flex;
|
|
26
|
-
align-items: center;
|
|
27
27
|
padding: calc(12px * var(--ipc-player-size-scale, 1));
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
align-items: center;
|
|
29
|
+
background-color: var(--shot-card-bg-color);
|
|
30
30
|
border-radius: calc(8px * var(--ipc-player-size-scale, 1));
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
// background-color: #fff;
|
|
32
|
+
background: linear-gradient(0deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.15)), #000000;
|
|
33
33
|
.ipc-player-plugin-record-video-toast-point {
|
|
34
34
|
width: calc(6px * var(--ipc-player-size-scale, 1));
|
|
35
35
|
height: calc(6px * var(--ipc-player-size-scale, 1));
|
|
36
36
|
border-radius: calc(6px * var(--ipc-player-size-scale, 1));
|
|
37
37
|
}
|
|
38
|
-
|
|
39
38
|
.ipc-player-plugin-record-video-toast-time {
|
|
39
|
+
font-size: calc(12px * var(--ipc-player-size-scale, 1));;
|
|
40
|
+
font-weight: 700;
|
|
41
|
+
color: var(--fontColor);
|
|
42
|
+
margin-left: calc(8px * var(--ipc-player-size-scale, 1));;
|
|
40
43
|
display: flex;
|
|
41
44
|
align-items: center;
|
|
42
|
-
margin-left: calc(8px * var(--ipc-player-size-scale, 1));
|
|
43
|
-
color: var(--fontColor);
|
|
44
|
-
font-weight: 700;
|
|
45
|
-
font-size: calc(12px * var(--ipc-player-size-scale, 1));
|
|
46
|
-
|
|
47
45
|
.ipc-player-plugin-record-video-toast-time-warp {
|
|
48
46
|
text-align: center;
|
|
49
47
|
}
|
|
50
|
-
|
|
51
48
|
.ipc-player-plugin-record-video-toast-time-delimiter {
|
|
52
|
-
margin: 0 calc(2px * var(--ipc-player-size-scale, 1))
|
|
49
|
+
margin: 0 calc(2px * var(--ipc-player-size-scale, 1));;
|
|
53
50
|
}
|
|
54
51
|
}
|
|
55
52
|
}
|
|
56
53
|
|
|
54
|
+
/** 录制成功弹窗 */
|
|
57
55
|
.ipc-player-plugin-record-success-toast-wrap {
|
|
58
56
|
position: absolute;
|
|
59
57
|
}
|
|
58
|
+
.ipc-player-plugin-record-success-toast {
|
|
59
|
+
flex: 1;
|
|
60
|
+
border-radius: calc(8px * var(--ipc-player-size-scale, 1));;
|
|
61
|
+
background-color: var(--shot-card-bg-color);
|
|
62
|
+
display: flex;
|
|
63
|
+
align-items: center;
|
|
64
|
+
padding: calc(8px * var(--ipc-player-size-scale, 1)) calc(12px * var(--ipc-player-size-scale, 1));
|
|
65
|
+
z-index: 100;
|
|
66
|
+
.ipc-player-plugin-record-success-toast-image-box {
|
|
67
|
+
border-radius: calc(4px * var(--ipc-player-size-scale, 1));
|
|
68
|
+
overflow: hidden;
|
|
69
|
+
width: calc(66px * var(--ipc-player-size-scale, 1));
|
|
70
|
+
height: calc(66px * 0.57 * var(--ipc-player-size-scale, 1));
|
|
71
|
+
position: relative;
|
|
72
|
+
}
|
|
73
|
+
.ipc-player-plugin-record-success-toast-image {
|
|
74
|
+
width: 100%;
|
|
75
|
+
height: 100%;
|
|
76
|
+
object-fit: cover;
|
|
77
|
+
}
|
|
78
|
+
.ipc-player-plugin-record-success-play-icon-box {
|
|
79
|
+
width: 30px;
|
|
80
|
+
height: 30px;
|
|
81
|
+
background-color: rgba(0, 0, 0, 0.2);
|
|
82
|
+
border-radius: 50%;
|
|
83
|
+
overflow: hidden;
|
|
84
|
+
position: absolute;
|
|
85
|
+
top: 50%;
|
|
86
|
+
left: 50%;
|
|
87
|
+
transform: translate(-50%, -50%);
|
|
88
|
+
display: flex;
|
|
89
|
+
align-items: center;
|
|
90
|
+
justify-content: center;
|
|
91
|
+
}
|
|
92
|
+
.ipc-player-plugin-record-success-play-icon {
|
|
93
|
+
font-size: calc(18px * var(--ipc-player-size-scale, 1)) !important;
|
|
94
|
+
color: #ffffff;
|
|
95
|
+
}
|
|
96
|
+
.ipc-player-plugin-record-success-toast-title {
|
|
97
|
+
flex: 1;
|
|
98
|
+
margin-left: calc(12px * var(--ipc-player-size-scale, 1));
|
|
99
|
+
font-size: calc(14px * var(--ipc-player-size-scale, 1));
|
|
100
|
+
color: var(--fontColor);
|
|
101
|
+
margin-right: calc(12px * var(--ipc-player-size-scale, 1));
|
|
102
|
+
word-break: break-word;
|
|
103
|
+
|
|
104
|
+
}
|
|
105
|
+
.ipc-player-plugin-record-success-toast-bottom {
|
|
106
|
+
border: 1px solid #1989FA;
|
|
107
|
+
min-width: calc(52px * var(--ipc-player-size-scale, 1));
|
|
108
|
+
max-width: calc(100px * var(--ipc-player-size-scale, 1));
|
|
109
|
+
border-radius: calc(4px * var(--ipc-player-size-scale, 1));
|
|
110
|
+
padding: calc(5px * var(--ipc-player-size-scale, 1)) calc(11px * var(--ipc-player-size-scale, 1));
|
|
111
|
+
font-size: calc(14px * var(--ipc-player-size-scale, 1));
|
|
112
|
+
white-space: nowrap;
|
|
113
|
+
overflow: hidden;
|
|
114
|
+
text-overflow: ellipsis;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
@@ -22,7 +22,6 @@ jest.mock('../../i18n', () => ({
|
|
|
22
22
|
}
|
|
23
23
|
}));
|
|
24
24
|
jest.mock('./recordVideo.less', () => ({}));
|
|
25
|
-
jest.mock('../captureResult/captureResult.less', () => ({}));
|
|
26
25
|
it('keeps the record control idle when starting is declined', async () => {
|
|
27
26
|
const addContent = jest.fn();
|
|
28
27
|
const setRecordingDisabled = jest.fn();
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import "core-js/modules/esnext.iterator.constructor.js";
|
|
2
2
|
import "core-js/modules/esnext.iterator.map.js";
|
|
3
3
|
import React, { useState, useContext, useEffect } from 'react';
|
|
4
|
-
import {
|
|
4
|
+
import { View, showToast } from '@ray-js/ray';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
|
+
import { PlayerText as Text } from '../../renderer/text';
|
|
6
7
|
import Strings from '../../i18n';
|
|
7
8
|
import { useMemoizedFn } from '../../hooks';
|
|
8
9
|
import { useStore } from '../../ctx/store';
|
|
@@ -33,6 +34,10 @@ export const FullResolutionControl = props => {
|
|
|
33
34
|
const onPlayerTap = useMemoizedFn(() => {
|
|
34
35
|
setHide(true);
|
|
35
36
|
});
|
|
37
|
+
const normalizeResolution = value => {
|
|
38
|
+
const normalized = String(value || '').toUpperCase();
|
|
39
|
+
return normalized === 'HD' ? 'HD' : 'SD';
|
|
40
|
+
};
|
|
36
41
|
useEffect(() => {
|
|
37
42
|
event.on('showFullResolutionControl', onShowFullResolutionControl);
|
|
38
43
|
event.on(playerTap, onPlayerTap);
|
|
@@ -42,13 +47,14 @@ export const FullResolutionControl = props => {
|
|
|
42
47
|
};
|
|
43
48
|
}, []);
|
|
44
49
|
const changeResolution = useMemoizedFn(value => {
|
|
45
|
-
|
|
50
|
+
const targetResolution = normalizeResolution(value);
|
|
51
|
+
if (targetResolution === normalizeResolution(resolution)) {
|
|
46
52
|
showToast({
|
|
47
53
|
icon: 'none',
|
|
48
54
|
title: Strings.getLang('ipc_player_current_resolution_is_equal')
|
|
49
55
|
});
|
|
50
56
|
} else {
|
|
51
|
-
setResolution(
|
|
57
|
+
setResolution(targetResolution).then(() => {
|
|
52
58
|
showToast({
|
|
53
59
|
icon: 'none',
|
|
54
60
|
title: Strings.getLang('ipc_player_change_resolution_success')
|
|
@@ -68,20 +74,24 @@ export const FullResolutionControl = props => {
|
|
|
68
74
|
className: clsx('ipc-player-plugin-full-resolution-control', 'ipc-plugin-absolute-move-in-right', {
|
|
69
75
|
'ipc-plugin-absolute-move-in-right-hide': hide
|
|
70
76
|
})
|
|
71
|
-
}, resolutionList.map(item =>
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
77
|
+
}, resolutionList.map(item => {
|
|
78
|
+
const normalizedItem = normalizeResolution(item);
|
|
79
|
+
const selected = normalizedItem === normalizeResolution(resolution);
|
|
80
|
+
return /*#__PURE__*/React.createElement(Text, {
|
|
81
|
+
key: item,
|
|
82
|
+
onClick: () => {
|
|
83
|
+
event.emit(widgetClick, {
|
|
84
|
+
widgetId: widgetLabs.FULL_RESOLUTION_CONTROL,
|
|
85
|
+
extra: {
|
|
86
|
+
resolution: normalizedItem
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
changeResolution(normalizedItem);
|
|
90
|
+
},
|
|
91
|
+
className: clsx('ipc-player-plugin-full-resolution-control-text'),
|
|
92
|
+
style: selected ? {
|
|
93
|
+
color: brandColor
|
|
94
|
+
} : undefined
|
|
95
|
+
}, Strings.getLang(`ipc_player_resolution_${normalizedItem}`));
|
|
96
|
+
}));
|
|
87
97
|
};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
-
import { View
|
|
2
|
+
import { View } from '@ray-js/ray';
|
|
3
3
|
import clsx from 'clsx';
|
|
4
4
|
import React, { useContext } from 'react';
|
|
5
5
|
import { useMemoizedFn } from 'ahooks';
|
|
6
|
+
import { PlayerText as Text } from '../../renderer/text';
|
|
6
7
|
import Strings from '../../i18n';
|
|
7
8
|
import { FullResolutionControl } from './fullResolutionControl';
|
|
8
9
|
import { fullResolutionId, pauseTimeToHideAllComponent, hideAllComponent, widgetLabs, widgetClick } from '../../ui/constant';
|
|
@@ -52,7 +53,7 @@ export const Resolution = props => {
|
|
|
52
53
|
}
|
|
53
54
|
if (verticalResolutionCustomClick) return false;
|
|
54
55
|
if (screenType === 'vertical') {
|
|
55
|
-
setResolution(resolution === 'HD' ? 'SD' : 'HD');
|
|
56
|
+
setResolution(String(resolution).toUpperCase() === 'HD' ? 'SD' : 'HD');
|
|
56
57
|
}
|
|
57
58
|
event.emit(pauseTimeToHideAllComponent);
|
|
58
59
|
return true;
|
|
@@ -1,17 +1,14 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import React, { useContext, useEffect, useRef } from 'react';
|
|
4
|
-
import { View, Text, getSystemInfoSync } from '@ray-js/ray';
|
|
1
|
+
import React, { useContext, useRef } from 'react';
|
|
2
|
+
import { View, Image, getSystemInfoSync } from '@ray-js/ray';
|
|
5
3
|
import { useSetState, useUpdateEffect, useMemoizedFn } from 'ahooks';
|
|
6
4
|
import clsx from 'clsx';
|
|
7
5
|
import { goToIpcPageNativeRoute } from '@ray-js/ray-ipc-utils';
|
|
6
|
+
import { PlayerText as Text } from '../../renderer/text';
|
|
8
7
|
import Strings from '../../i18n';
|
|
9
8
|
import { useStore } from '../../ctx/store';
|
|
10
9
|
import { UIEventContext } from '../../ui/context';
|
|
11
10
|
import { pauseTimeToHideAllComponent, changeIgnoreHideStopPreview, widgetLabs, widgetClick } from '../../ui/constant';
|
|
12
|
-
import { getCaptureResultSummary } from '../../utils/captureResult';
|
|
13
11
|
import { ensureAlbumPermission } from '../../utils/authorize/album';
|
|
14
|
-
import { CaptureResultToast } from '../captureResult/captureResult';
|
|
15
12
|
import './screenshot.less';
|
|
16
13
|
const CLOSE_TIME = 5000;
|
|
17
14
|
export function Screenshot(props) {
|
|
@@ -39,15 +36,8 @@ export function Screenshot(props) {
|
|
|
39
36
|
/** 记录截屏url */
|
|
40
37
|
const [state, setState] = useSetState({
|
|
41
38
|
showShot: false,
|
|
42
|
-
shotUrl: ''
|
|
43
|
-
shotCount: 0
|
|
39
|
+
shotUrl: ''
|
|
44
40
|
});
|
|
45
|
-
const snapshotRequestIdRef = useRef(0);
|
|
46
|
-
useEffect(() => {
|
|
47
|
-
return () => {
|
|
48
|
-
snapshotRequestIdRef.current += 1;
|
|
49
|
-
};
|
|
50
|
-
}, []);
|
|
51
41
|
useUpdateEffect(() => {
|
|
52
42
|
if (state.showShot && screenType) {
|
|
53
43
|
showShotToast();
|
|
@@ -60,8 +50,7 @@ export function Screenshot(props) {
|
|
|
60
50
|
timer.current = setTimeout(() => {
|
|
61
51
|
setState({
|
|
62
52
|
showShot: false,
|
|
63
|
-
shotUrl: ''
|
|
64
|
-
shotCount: 0
|
|
53
|
+
shotUrl: ''
|
|
65
54
|
});
|
|
66
55
|
deleteContent('absolute', 'plugin-screenshot-toast');
|
|
67
56
|
}, CLOSE_TIME);
|
|
@@ -71,8 +60,7 @@ export function Screenshot(props) {
|
|
|
71
60
|
const handCheck = () => {
|
|
72
61
|
setState({
|
|
73
62
|
showShot: false,
|
|
74
|
-
shotUrl: ''
|
|
75
|
-
shotCount: 0
|
|
63
|
+
shotUrl: ''
|
|
76
64
|
});
|
|
77
65
|
deleteContent('absolute', 'plugin-screenshot-toast');
|
|
78
66
|
clearInterval(timer.current);
|
|
@@ -94,25 +82,34 @@ export function Screenshot(props) {
|
|
|
94
82
|
marginLeft: screenType === 'vertical' ? '0' : '-200px'
|
|
95
83
|
},
|
|
96
84
|
content: () => {
|
|
97
|
-
return /*#__PURE__*/React.createElement(
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
85
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
86
|
+
className: "ipc-player-plugin-screenshot-toast"
|
|
87
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
88
|
+
className: "ipc-player-plugin-screenshot-toast-image-box"
|
|
89
|
+
}, /*#__PURE__*/React.createElement(Image, {
|
|
90
|
+
className: "ipc-player-plugin-screenshot-toast-image",
|
|
91
|
+
src: state.shotUrl
|
|
92
|
+
})), /*#__PURE__*/React.createElement(View, {
|
|
93
|
+
className: "ipc-player-plugin-screenshot-toast-title"
|
|
94
|
+
}, Strings.getLang('ipc_player_screenshot_success_tip')), /*#__PURE__*/React.createElement(View, {
|
|
95
|
+
onClick: handCheck,
|
|
96
|
+
className: "ipc-player-plugin-screenshot-toast-bottom",
|
|
97
|
+
style: {
|
|
98
|
+
color: brandColor,
|
|
99
|
+
borderColor: brandColor
|
|
100
|
+
}
|
|
101
|
+
}, Strings.getLang('ipc_player_shot_success_check')));
|
|
104
102
|
}
|
|
105
103
|
});
|
|
106
104
|
timeToCloseToast();
|
|
107
105
|
};
|
|
108
106
|
const handClick = useMemoizedFn(async () => {
|
|
109
|
-
var _props$event;
|
|
110
|
-
(
|
|
107
|
+
var _props$event, _props$event2;
|
|
108
|
+
const ev = (_props$event = props.event) !== null && _props$event !== void 0 ? _props$event : event;
|
|
109
|
+
((_props$event2 = props.event) !== null && _props$event2 !== void 0 ? _props$event2 : event).emit(widgetClick, {
|
|
111
110
|
widgetId: widgetLabs.SCREENSHOT
|
|
112
111
|
});
|
|
113
112
|
console.log('截屏!!!');
|
|
114
|
-
deleteContent('absolute', 'plugin-screenshot-toast');
|
|
115
|
-
clearTimeout(timer.current);
|
|
116
113
|
setState({
|
|
117
114
|
showShot: false
|
|
118
115
|
});
|
|
@@ -123,46 +120,27 @@ export function Screenshot(props) {
|
|
|
123
120
|
props.event ? props.event.emit(changeIgnoreHideStopPreview, true) : event.emit(changeIgnoreHideStopPreview, true);
|
|
124
121
|
}
|
|
125
122
|
event.emit(pauseTimeToHideAllComponent);
|
|
126
|
-
const setIgnoreHideStopPreview = value => {
|
|
127
|
-
var _props$event2;
|
|
128
|
-
((_props$event2 = props.event) !== null && _props$event2 !== void 0 ? _props$event2 : event).emit(changeIgnoreHideStopPreview, value);
|
|
129
|
-
};
|
|
130
|
-
const handleSnapshotFail = err => {
|
|
131
|
-
setIgnoreHideStopPreview(false);
|
|
132
|
-
console.log(err, 'err');
|
|
133
|
-
const errObj = err.innerError || err || {};
|
|
134
|
-
const errMsg = errObj.errorMsg || Strings.getLang('ipc_player_error_screenshot_error_tip');
|
|
135
|
-
toast({
|
|
136
|
-
title: errMsg
|
|
137
|
-
});
|
|
138
|
-
};
|
|
139
123
|
const granted = await ensureAlbumPermission();
|
|
140
|
-
|
|
124
|
+
ev.emit(changeIgnoreHideStopPreview, false);
|
|
141
125
|
if (!granted) return;
|
|
142
|
-
(
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
shotCount: summary.isMultiLens ? summary.count : 0
|
|
161
|
-
});
|
|
162
|
-
},
|
|
163
|
-
fail: handleSnapshotFail
|
|
164
|
-
});
|
|
165
|
-
})();
|
|
126
|
+
IPCPlayerContext.snapshot({
|
|
127
|
+
saveToAlbum,
|
|
128
|
+
success: res => {
|
|
129
|
+
ev.emit(changeIgnoreHideStopPreview, false);
|
|
130
|
+
setState({
|
|
131
|
+
showShot: true,
|
|
132
|
+
shotUrl: res.tempImagePath
|
|
133
|
+
});
|
|
134
|
+
},
|
|
135
|
+
fail: err => {
|
|
136
|
+
ev.emit(changeIgnoreHideStopPreview, false);
|
|
137
|
+
const errObj = err.innerError || err || {};
|
|
138
|
+
const errMsg = errObj.errorMsg || Strings.getLang('ipc_player_error_screenshot_error_tip');
|
|
139
|
+
toast({
|
|
140
|
+
title: errMsg
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
});
|
|
166
144
|
});
|
|
167
145
|
if (hideScreenShotMenu) return null;
|
|
168
146
|
return /*#__PURE__*/React.createElement(View, {
|
|
@@ -2,7 +2,46 @@
|
|
|
2
2
|
color: var(--iconColor);
|
|
3
3
|
font-size: calc(var(--iconPlayerSize) * var(--ipc-player-size-scale, 1)) !important;
|
|
4
4
|
}
|
|
5
|
-
|
|
6
5
|
.ipc-player-plugin-screenshot-toast-wrap {
|
|
7
6
|
position: absolute;
|
|
8
7
|
}
|
|
8
|
+
.ipc-player-plugin-screenshot-toast {
|
|
9
|
+
flex: 1;
|
|
10
|
+
border-radius: calc(8px * var(--ipc-player-size-scale, 1));;
|
|
11
|
+
background-color: var(--shot-card-bg-color);
|
|
12
|
+
display: flex;
|
|
13
|
+
align-items: center;
|
|
14
|
+
padding: calc(8px * var(--ipc-player-size-scale, 1)) calc(12px * var(--ipc-player-size-scale, 1));
|
|
15
|
+
z-index: 100;
|
|
16
|
+
.ipc-player-plugin-screenshot-toast-image-box {
|
|
17
|
+
border-radius: calc(4px * var(--ipc-player-size-scale, 1));
|
|
18
|
+
overflow: hidden;
|
|
19
|
+
width: calc(66px * var(--ipc-player-size-scale, 1));
|
|
20
|
+
height: calc(66px * 0.57 * var(--ipc-player-size-scale, 1));
|
|
21
|
+
}
|
|
22
|
+
.ipc-player-plugin-screenshot-toast-image {
|
|
23
|
+
width: 100%;
|
|
24
|
+
height: 100%;
|
|
25
|
+
object-fit: cover;
|
|
26
|
+
}
|
|
27
|
+
.ipc-player-plugin-screenshot-toast-title {
|
|
28
|
+
flex: 1;
|
|
29
|
+
margin-left: calc(12px * var(--ipc-player-size-scale, 1));
|
|
30
|
+
font-size: calc(14px * var(--ipc-player-size-scale, 1));
|
|
31
|
+
color: var(--fontColor);
|
|
32
|
+
margin-right: calc(12px * var(--ipc-player-size-scale, 1));
|
|
33
|
+
word-break: break-word;
|
|
34
|
+
|
|
35
|
+
}
|
|
36
|
+
.ipc-player-plugin-screenshot-toast-bottom {
|
|
37
|
+
border: 1px solid #1989FA;
|
|
38
|
+
min-width: calc(52px * var(--ipc-player-size-scale, 1));
|
|
39
|
+
max-width: calc(100px * var(--ipc-player-size-scale, 1));
|
|
40
|
+
border-radius: calc(4px * var(--ipc-player-size-scale, 1));
|
|
41
|
+
padding: calc(5px * var(--ipc-player-size-scale, 1)) calc(11px * var(--ipc-player-size-scale, 1));
|
|
42
|
+
font-size: calc(14px * var(--ipc-player-size-scale, 1));
|
|
43
|
+
white-space: nowrap;
|
|
44
|
+
overflow: hidden;
|
|
45
|
+
text-overflow: ellipsis;
|
|
46
|
+
}
|
|
47
|
+
}
|