@ray-js/ipc-player-integration 0.0.61-beta.1 → 0.0.63

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.
Files changed (49) hide show
  1. package/lib/ctx/ctx.composition.js +4 -19
  2. package/lib/ctx/ctx.js +55 -103
  3. package/lib/ctx/ports.output.d.ts +0 -1
  4. package/lib/ctx/resolution.d.ts +1 -1
  5. package/lib/ctx/resolution.js +1 -3
  6. package/lib/i18n/index.d.ts +0 -12
  7. package/lib/i18n/strings.d.ts +0 -6
  8. package/lib/i18n/strings.js +0 -6
  9. package/lib/interface.d.ts +3 -19
  10. package/lib/ui/bottomLeftContent.js +1 -3
  11. package/lib/ui/ui.d.ts +0 -2
  12. package/lib/ui/ui.js +26 -30
  13. package/lib/utils/navigation.d.ts +1 -2
  14. package/lib/utils/navigation.js +3 -13
  15. package/lib/utils/ttt.js +8 -2
  16. package/lib/widgets/index.d.ts +0 -1
  17. package/lib/widgets/index.js +1 -2
  18. package/lib/widgets/recordVideo/recordVideo.js +52 -53
  19. package/lib/widgets/recordVideo/recordVideo.less +74 -17
  20. package/lib/widgets/recordVideo/recordVideo.test.js +0 -1
  21. package/lib/widgets/screenshot/screenshot.js +44 -66
  22. package/lib/widgets/screenshot/screenshot.less +40 -1
  23. package/lib/widgets/trialBadge/index.d.ts +1 -2
  24. package/lib/widgets/trialBadge/index.js +9 -17
  25. package/lib/widgets/trialBadge/useTrialBadge.d.ts +2 -3
  26. package/lib/widgets/trialBadge/useTrialBadge.js +2 -13
  27. package/lib/widgets/tryExperience/tryExperience.js +1 -0
  28. package/package.json +2 -3
  29. package/lib/ctx/ctx.album.test.d.ts +0 -1
  30. package/lib/ctx/ctx.album.test.js +0 -197
  31. package/lib/ui/absoluteContent.d.ts +0 -2
  32. package/lib/ui/absoluteContent.js +0 -3
  33. package/lib/utils/captureResult.d.ts +0 -14
  34. package/lib/utils/captureResult.js +0 -70
  35. package/lib/utils/captureResult.test.d.ts +0 -1
  36. package/lib/utils/captureResult.test.js +0 -117
  37. package/lib/utils/fullLinkTracking.d.ts +0 -5
  38. package/lib/utils/fullLinkTracking.js +0 -71
  39. package/lib/widgets/captureResult/captureResult.d.ts +0 -16
  40. package/lib/widgets/captureResult/captureResult.js +0 -85
  41. package/lib/widgets/captureResult/captureResult.less +0 -144
  42. package/lib/widgets/captureResult/captureResult.test.d.ts +0 -1
  43. package/lib/widgets/captureResult/captureResult.test.js +0 -80
  44. package/lib/widgets/captureResult/index.d.ts +0 -2
  45. package/lib/widgets/captureResult/index.js +0 -2
  46. package/lib/widgets/recordVideo/recordVideo.lifecycle.test.d.ts +0 -1
  47. package/lib/widgets/recordVideo/recordVideo.lifecycle.test.js +0 -106
  48. package/lib/widgets/screenshot/screenshot.test.d.ts +0 -1
  49. package/lib/widgets/screenshot/screenshot.test.js +0 -120
package/lib/ui/ui.js CHANGED
@@ -28,9 +28,7 @@ import { Storage } from '../utils/storage';
28
28
  import './ui.less';
29
29
  import { updatePlayerWidgetProps } from '../features';
30
30
  import { getNgRawData, getSmartImageQualityState, isLowPhone } from '../utils/ttt';
31
- import { getCaptureResultSummary } from '../utils/captureResult';
32
31
  import { lensCount } from '../widgets/zoomTurntable/lensSkill';
33
- import { shouldRenderContent } from './absoluteContent';
34
32
  const AutoClarityOnly = _ref => {
35
33
  let {
36
34
  instance
@@ -61,12 +59,11 @@ const StandaloneAutoClarity = _ref2 => {
61
59
  instance: instance
62
60
  }));
63
61
  };
64
- function getCtxInstance(instance, devId, autoClarityDisabled) {
62
+ function getCtxInstance(instance, devId) {
65
63
  if (instance) return instance;
66
64
  // eslint-disable-next-line react-hooks/rules-of-hooks
67
65
  return useCtx({
68
- devId,
69
- autoClarityDisabled
66
+ devId
70
67
  });
71
68
  }
72
69
 
@@ -129,7 +126,7 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
129
126
  const {
130
127
  event
131
128
  } = useContext(UIEventContext);
132
- const instance = getCtxInstance(props.instance, devId, props.autoClarityDisabled);
129
+ const instance = getCtxInstance(props.instance, devId);
133
130
  const {
134
131
  setPlayState,
135
132
  setScreenType,
@@ -566,6 +563,7 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
566
563
  // canOpenSettings: true,
567
564
  // };
568
565
  const getNgRes = await getNgRawData();
566
+ console.log('res===getSmartImageQualityState', res);
569
567
  updatePlayerWidgetProps(instance, 'bottomLeft', 'TryExperience', {
570
568
  isPurchase: res.isPurchase,
571
569
  buttonState: res.buttonState,
@@ -688,16 +686,14 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
688
686
  ipcTTTOperatorLog('hide: 调用停止录制方法');
689
687
  setRecording(false, true);
690
688
  setIntercom(false, true);
691
- instance === null || instance === void 0 || instance.stopRecordingOnUnload().then(async result => {
692
- var _instance$multiLens, _instance$multiCamera;
693
- const summary = await getCaptureResultSummary(result, {
694
- multiLens: (_instance$multiLens = instance === null || instance === void 0 ? void 0 : instance.multiLens) !== null && _instance$multiLens !== void 0 ? _instance$multiLens : false,
695
- protocolCount: instance === null || instance === void 0 || (_instance$multiCamera = instance.multiCameraCtx) === null || _instance$multiCamera === void 0 || (_instance$multiCamera = _instance$multiCamera.protocol) === null || _instance$multiCamera === void 0 ? void 0 : _instance$multiCamera.total_split_num,
696
- devId
697
- });
698
- ipcTTTOperatorLog(summary !== null && summary !== void 0 && summary.isMultiLens ? `hide: stop recording succeeded with ${summary.count} files` : 'hide: 调用停止录制方法成功');
699
- }).catch(() => {
700
- ipcTTTOperatorLog('hide: 调用停止录制方法失败');
689
+ instance === null || instance === void 0 || instance.IPCPlayerInstance.stopRecord({
690
+ saveToAlbum: 1,
691
+ success: () => {
692
+ ipcTTTOperatorLog('hide: 调用停止录制方法成功');
693
+ },
694
+ fail: () => {
695
+ ipcTTTOperatorLog('hide: 调用停止录制方法失败');
696
+ }
701
697
  });
702
698
  ipcTTTOperatorLog('hide: 调用停止对讲方法');
703
699
  instance === null || instance === void 0 || instance.IPCPlayerInstance.stopTalk({
@@ -1159,17 +1155,17 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
1159
1155
  // 这一下起,自动隐藏倒计时才开始生效
1160
1156
  hasUserTappedPlayerRef.current = true;
1161
1157
  if (instance.multiCameraCtx.isSupport) {
1162
- var _instance$multiCamera2, _instance$multiCamera3;
1163
- const preTapIndex = (_instance$multiCamera2 = (_instance$multiCamera3 = instance.multiCameraCtx.selectedLenInfoRef.current) === null || _instance$multiCamera3 === void 0 ? void 0 : _instance$multiCamera3.index) !== null && _instance$multiCamera2 !== void 0 ? _instance$multiCamera2 : prevSelectedIndexRef.current;
1158
+ var _instance$multiCamera, _instance$multiCamera2;
1159
+ const preTapIndex = (_instance$multiCamera = (_instance$multiCamera2 = instance.multiCameraCtx.selectedLenInfoRef.current) === null || _instance$multiCamera2 === void 0 ? void 0 : _instance$multiCamera2.index) !== null && _instance$multiCamera !== void 0 ? _instance$multiCamera : prevSelectedIndexRef.current;
1164
1160
  const wasHidden = componentHideState;
1165
1161
  instance.multiCameraCtx.selectVideoFiredRef.current = false;
1166
1162
  if (multiTapTimerRef.current) {
1167
1163
  clearTimeout(multiTapTimerRef.current);
1168
1164
  }
1169
1165
  multiTapTimerRef.current = setTimeout(() => {
1170
- var _instance$multiCamera4, _instance$multiCamera5;
1166
+ var _instance$multiCamera3, _instance$multiCamera4;
1171
1167
  const selectFired = !!instance.multiCameraCtx.selectVideoFiredRef.current;
1172
- const currentIndex = (_instance$multiCamera4 = (_instance$multiCamera5 = instance.multiCameraCtx.selectedLenInfoRef.current) === null || _instance$multiCamera5 === void 0 ? void 0 : _instance$multiCamera5.index) !== null && _instance$multiCamera4 !== void 0 ? _instance$multiCamera4 : preTapIndex;
1168
+ const currentIndex = (_instance$multiCamera3 = (_instance$multiCamera4 = instance.multiCameraCtx.selectedLenInfoRef.current) === null || _instance$multiCamera4 === void 0 ? void 0 : _instance$multiCamera4.index) !== null && _instance$multiCamera3 !== void 0 ? _instance$multiCamera3 : preTapIndex;
1173
1169
  if (selectFired && currentIndex === preTapIndex) {
1174
1170
  if (wasHidden) {
1175
1171
  showComponents();
@@ -1259,16 +1255,13 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
1259
1255
  }, renderBottomRightContent))), (() => {
1260
1256
  if (!absoluteContent || !(absoluteContent !== null && absoluteContent !== void 0 && absoluteContent.length)) return null;
1261
1257
  return absoluteContent.map(item => {
1262
- if (!shouldRenderContent(item, {
1263
- playState
1264
- })) return null;
1265
- const contentProps = _objectSpread(_objectSpread(_objectSpread({
1266
- key: item.id
1267
- }, item.initProps), instance), {}, {
1268
- IPCPlayerContext: instance.IPCPlayerInstance
1269
- });
1258
+ if (item.hidden) return null;
1270
1259
  if (item.absoluteNoCoverView) {
1271
- return /*#__PURE__*/React.createElement(item.content, contentProps);
1260
+ return /*#__PURE__*/React.createElement(item.content, _objectSpread(_objectSpread(_objectSpread({
1261
+ key: item.id
1262
+ }, item.initProps), instance), {}, {
1263
+ IPCPlayerContext: instance.IPCPlayerInstance
1264
+ }));
1272
1265
  }
1273
1266
  return /*#__PURE__*/React.createElement(CoverView, {
1274
1267
  key: item.id,
@@ -1276,7 +1269,10 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
1276
1269
  position: 'absolute'
1277
1270
  }, item.absolutePosition),
1278
1271
  className: item.absoluteContentClassName
1279
- }, /*#__PURE__*/React.createElement(item.content, _objectSpread(_objectSpread({}, contentProps), {}, {
1272
+ }, /*#__PURE__*/React.createElement(item.content, _objectSpread(_objectSpread(_objectSpread({
1273
+ key: item.id
1274
+ }, item.initProps), instance), {}, {
1275
+ IPCPlayerContext: instance.IPCPlayerInstance,
1280
1276
  // 添加通用变量单独组件类名
1281
1277
  className: clsx('absolute-item-container')
1282
1278
  })));
@@ -1,8 +1,7 @@
1
- import { EntryTracking } from './fullLinkTracking';
2
1
  export declare const miniIdLabs: {
3
2
  aiDrawMini: string;
4
3
  securityCloudService: string;
5
4
  };
6
5
  export declare function gotoAIDrawMiniProgram(devId: string, brandColor: string): void;
7
6
  export declare function gotoSecurityCloudService(homeId: string, uuid: string): Promise<void>;
8
- export declare function gotoSecurityCloudService2(devId: string, tracking?: EntryTracking): Promise<import("@ray-js/ray-ipc-utils/lib/interface").IRes<unknown>>;
7
+ export declare function gotoSecurityCloudService2(devId: string): Promise<import("@ray-js/ray-ipc-utils/lib/interface").IRes<unknown>>;
@@ -1,6 +1,5 @@
1
- import { getServiceUrl, goToMiniProgramByShortLink, jumpToWebView } from '@ray-js/ray-ipc-utils';
1
+ import { getServiceUrl, goToMiniProgramByShortLink } from '@ray-js/ray-ipc-utils';
2
2
  import Color from 'color';
3
- import { appendTrackingQuery } from './fullLinkTracking';
4
3
 
5
4
  // 小程序ID集合
6
5
  export const miniIdLabs = {
@@ -19,15 +18,6 @@ export async function gotoSecurityCloudService(homeId, uuid) {
19
18
  const url = `godzilla://${miniIdLabs.securityCloudService}${'/pages/serviceList/index'}?homeId=${homeId}&deviceId=${uuid}&categoryCode=${'security_cloud_service'}`;
20
19
  goToMiniProgramByShortLink(url, 'right');
21
20
  }
22
- export async function gotoSecurityCloudService2(devId, tracking) {
23
- var _result$data;
24
- const serviceType = 'security_cloud_service';
25
- const params = {};
26
- if (!tracking) return getServiceUrl(devId, serviceType, params, true);
27
- const result = await getServiceUrl(devId, serviceType, params, false, tracking.utm_rtid);
28
- if ((result === null || result === void 0 ? void 0 : result.code) !== 0 || !((_result$data = result.data) !== null && _result$data !== void 0 && _result$data.url)) {
29
- throw new Error('Failed to fetch the cloud service URL');
30
- }
31
- const url = appendTrackingQuery(result.data.url, tracking);
32
- return result.data.type === 2 ? goToMiniProgramByShortLink(url) : jumpToWebView(url);
21
+ export async function gotoSecurityCloudService2(devId) {
22
+ return getServiceUrl(devId, 'security_cloud_service', {}, true);
33
23
  }
package/lib/utils/ttt.js CHANGED
@@ -37,9 +37,11 @@ export function getAIFrameFeature(devId) {
37
37
  ty.ipc.getAIFrameFeature({
38
38
  devId,
39
39
  success: data => {
40
+ console.log('res===getAIFrameFeature data', data);
40
41
  resolve(data);
41
42
  },
42
- fail: () => {
43
+ fail: e => {
44
+ console.warn('res===getAIFrameFeature fail', e);
43
45
  resolve(null);
44
46
  }
45
47
  });
@@ -59,9 +61,11 @@ export function setAIFrameFeature(params) {
59
61
  try {
60
62
  ty.ipc.setAIFrameFeature(_objectSpread(_objectSpread({}, params), {}, {
61
63
  success: data => {
64
+ console.log('res===setAIFrameFeature data', data);
62
65
  resolve(data);
63
66
  },
64
- fail: () => {
67
+ fail: e => {
68
+ console.warn('res===setAIFrameFeature fail', e);
65
69
  resolve(null);
66
70
  }
67
71
  }));
@@ -131,6 +135,7 @@ export function notifyOfflineShown(deviceId) {
131
135
  return false;
132
136
  }
133
137
  try {
138
+ console.warn('res===notifyOfflineShown', deviceId);
134
139
  method({
135
140
  deviceId,
136
141
  scene: 'preview_mini'
@@ -241,6 +246,7 @@ export function subscribeClarityChanged(devId, handler) {
241
246
  try {
242
247
  ipc.onClarityChanged(listener);
243
248
  } catch (error) {
249
+ console.warn('res===onClarityChanged fail', error);
244
250
  return () => undefined;
245
251
  }
246
252
  return () => {
@@ -24,4 +24,3 @@ export * from './toggleVerticalFull';
24
24
  export * from './flowLowTip';
25
25
  export * from './realTimeMagnification';
26
26
  export * from './zoomTurntable';
27
- export * from './captureResult';
@@ -23,5 +23,4 @@ export * from './smallIntercom';
23
23
  export * from './toggleVerticalFull';
24
24
  export * from './flowLowTip';
25
25
  export * from './realTimeMagnification';
26
- export * from './zoomTurntable';
27
- export * from './captureResult';
26
+ export * from './zoomTurntable';
@@ -1,12 +1,10 @@
1
1
  import React, { useState, useEffect, useRef, useContext } from 'react';
2
- import { View, Text, getSystemInfoSync } from '@ray-js/ray';
2
+ import { View, Text, Image, getSystemInfoSync } from '@ray-js/ray';
3
3
  import { useSetState, useUpdateEffect } from 'ahooks';
4
4
  import clsx from 'clsx';
5
5
  import { goToIpcPageNativeRoute } from '@ray-js/ray-ipc-utils';
6
6
  import Strings from '../../i18n';
7
7
  import { PlayState } from '../../interface';
8
- import { getCaptureResultSummary } from '../../utils/captureResult';
9
- import { CaptureResultToast } from '../captureResult/captureResult';
10
8
  import { UIEventContext } from '../../ui/context';
11
9
  import { pauseTimeToHideAllComponent, changeIgnoreHideStopPreview, widgetLabs, widgetClick } from '../../ui/constant';
12
10
  import { useStore, getDefaultStore } from '../../ctx/store';
@@ -102,45 +100,22 @@ export function RecordVideo(props) {
102
100
  playState: props.playState
103
101
  });
104
102
  const [state, setState] = useSetState({
103
+ showTimer: false,
105
104
  showShot: false,
106
- shotUrl: '',
107
- shotCount: 0
105
+ shotUrl: ''
108
106
  });
109
- const recordResultRequestIdRef = useRef(0);
110
- useEffect(() => {
111
- return () => {
112
- recordResultRequestIdRef.current += 1;
113
- };
114
- }, []);
115
- const showRecordResult = async recordInfo => {
116
- var _props$multiCameraCtx;
117
- const requestId = ++recordResultRequestIdRef.current;
118
- const splitNum = (_props$multiCameraCtx = props.multiCameraCtx) === null || _props$multiCameraCtx === void 0 || (_props$multiCameraCtx = _props$multiCameraCtx.protocol) === null || _props$multiCameraCtx === void 0 ? void 0 : _props$multiCameraCtx.total_split_num;
119
- const summary = await getCaptureResultSummary(recordInfo, {
120
- multiLens: props.multiLens,
121
- protocolCount: splitNum,
122
- devId
123
- });
124
- if (requestId !== recordResultRequestIdRef.current) return;
125
- if (!summary) return;
126
- setState({
127
- showShot: true,
128
- shotUrl: summary.thumbnailPath,
129
- shotCount: summary.isMultiLens ? summary.count : 0
130
- });
131
- };
132
107
 
133
108
  /**
134
109
  * 针对 playState为非连接中状态时,如果处于录制中, 结束录制
135
110
  */
136
111
  useEffect(() => {
137
112
  (async () => {
138
- if (playState !== PlayState.PLAYING && recording) {
139
- try {
140
- const recordInfo = await setRecording(false);
141
- await showRecordResult(recordInfo);
142
- } catch {
143
- // setRecording reports the native failure through the configured toast.
113
+ if (playState !== PlayState.PLAYING) {
114
+ if (recording) {
115
+ setState({
116
+ showTimer: false
117
+ });
118
+ await setRecording(false);
144
119
  }
145
120
  }
146
121
  })();
@@ -154,8 +129,7 @@ export function RecordVideo(props) {
154
129
  timer.current = setTimeout(() => {
155
130
  setState({
156
131
  showShot: false,
157
- shotUrl: '',
158
- shotCount: 0
132
+ shotUrl: ''
159
133
  });
160
134
  deleteContent('absolute', RECORD_VIDEO_SUCCESS_TOAST_ID);
161
135
  }, CLOSE_TIME);
@@ -175,20 +149,22 @@ export function RecordVideo(props) {
175
149
  showRecordToast();
176
150
  }
177
151
  }, [state.showShot, screenType]);
152
+
153
+ /** 根据showTimer的显示定时器 */
178
154
  useUpdateEffect(() => {
179
- if (recording) {
155
+ if (state.showTimer) {
180
156
  showRecordTimer();
181
157
  } else {
182
158
  deleteContent('absolute', RECORD_VIDEO_TIMER_ID);
159
+ // 清除定时器,元素移除
183
160
  }
184
- }, [recording]);
161
+ }, [state.showTimer]);
185
162
 
186
163
  /** 跳转相册 */
187
164
  const handCheck = () => {
188
165
  setState({
189
166
  showShot: false,
190
- shotUrl: '',
191
- shotCount: 0
167
+ shotUrl: ''
192
168
  });
193
169
  deleteContent('absolute', RECORD_VIDEO_SUCCESS_TOAST_ID);
194
170
  clearInterval(timer.current);
@@ -210,13 +186,27 @@ export function RecordVideo(props) {
210
186
  marginLeft: screenType === 'vertical' ? '0' : '-200px'
211
187
  },
212
188
  content: () => {
213
- return /*#__PURE__*/React.createElement(CaptureResultToast, {
214
- brandColor: brandColor,
215
- count: state.shotCount,
216
- kind: "record",
217
- onCheck: handCheck,
218
- thumbnailPath: state.shotUrl
219
- });
189
+ return /*#__PURE__*/React.createElement(View, {
190
+ className: "ipc-player-plugin-record-success-toast"
191
+ }, /*#__PURE__*/React.createElement(View, {
192
+ className: "ipc-player-plugin-record-success-toast-image-box"
193
+ }, /*#__PURE__*/React.createElement(Image, {
194
+ className: "ipc-player-plugin-record-success-toast-image",
195
+ src: state.shotUrl
196
+ }), /*#__PURE__*/React.createElement(View, {
197
+ className: "ipc-player-plugin-record-success-play-icon-box"
198
+ }, /*#__PURE__*/React.createElement(Text, {
199
+ className: clsx('icon-panel', 'icon-panel-record-play', 'ipc-player-plugin-record-success-play-icon')
200
+ }))), /*#__PURE__*/React.createElement(View, {
201
+ className: "ipc-player-plugin-record-success-toast-title"
202
+ }, Strings.getLang('ipc_player_record_success_tip')), /*#__PURE__*/React.createElement(View, {
203
+ onClick: handCheck,
204
+ className: "ipc-player-plugin-record-success-toast-bottom",
205
+ style: {
206
+ color: brandColor,
207
+ borderColor: brandColor
208
+ }
209
+ }, Strings.getLang('ipc_player_record_success_check')));
220
210
  }
221
211
  });
222
212
  timeToCloseRecordToast();
@@ -228,8 +218,8 @@ export function RecordVideo(props) {
228
218
  absoluteContentClassName: 'ipc-player-plugin-record-video-toast-wrap',
229
219
  content: () => /*#__PURE__*/React.createElement(View, {
230
220
  className: clsx('ipc-player-plugin-record-video-toast', {
231
- 'ipc-player-plugin-record-video-toast-show': recording,
232
- 'ipc-player-plugin-record-video-toast-hide': !recording
221
+ 'ipc-player-plugin-record-video-toast-show': state.showTimer,
222
+ 'ipc-player-plugin-record-video-toast-hide': !state.showTimer
233
223
  })
234
224
  }, /*#__PURE__*/React.createElement(View, {
235
225
  className: "ipc-player-plugin-record-video-toast-point",
@@ -240,9 +230,9 @@ export function RecordVideo(props) {
240
230
  });
241
231
  };
242
232
  const handRecordVideo = async () => {
243
- var _props$event;
233
+ var _props$event, _props$event2;
244
234
  const ev = (_props$event = props.event) !== null && _props$event !== void 0 ? _props$event : event;
245
- ev.emit(widgetClick, {
235
+ ((_props$event2 = props.event) !== null && _props$event2 !== void 0 ? _props$event2 : event).emit(widgetClick, {
246
236
  widgetId: widgetLabs.RECORD_VIDEO
247
237
  });
248
238
  event.emit(pauseTimeToHideAllComponent);
@@ -252,7 +242,6 @@ export function RecordVideo(props) {
252
242
  if (recordingDisabled) {
253
243
  return false;
254
244
  }
255
- recordResultRequestIdRef.current += 1;
256
245
  if (state.showShot && _recording) {
257
246
  setState({
258
247
  showShot: false
@@ -273,11 +262,18 @@ export function RecordVideo(props) {
273
262
  }
274
263
  if (target) {
275
264
  setRecordingDisabled(true);
265
+ setState({
266
+ showTimer: true
267
+ });
276
268
  /** 录制开始后3秒后才可结束 */
277
269
  timeToResetRecordDisabled();
278
270
  } else {
279
271
  props.event ? props.event.emit(changeIgnoreHideStopPreview, false) : event.emit(changeIgnoreHideStopPreview, false);
280
- await showRecordResult(recordInfo);
272
+ setState({
273
+ showTimer: false,
274
+ showShot: true,
275
+ shotUrl: recordInfo.tempImagePath
276
+ });
281
277
  }
282
278
  } catch (err) {
283
279
  props.event ? props.event.emit(changeIgnoreHideStopPreview, false) : event.emit(changeIgnoreHideStopPreview, false);
@@ -287,6 +283,9 @@ export function RecordVideo(props) {
287
283
  toast({
288
284
  title: errMsg
289
285
  });
286
+ setState({
287
+ showTimer: false
288
+ });
290
289
  }
291
290
  return true;
292
291
  };
@@ -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
- background: linear-gradient(0deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.15)),
29
- #000000;
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
- transform: translate(0, -110%);
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();