@ray-js/ipc-player-integration 0.0.53-beta.9 → 0.0.55-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.
Files changed (42) hide show
  1. package/lib/ctx/ctx.composition.js +3 -13
  2. package/lib/ctx/ctx.js +32 -160
  3. package/lib/i18n/index.d.ts +0 -32
  4. package/lib/i18n/strings.d.ts +0 -16
  5. package/lib/i18n/strings.js +0 -16
  6. package/lib/interface.d.ts +4 -19
  7. package/lib/ui/ui.js +25 -75
  8. package/lib/utils/authorize/album.d.ts +1 -0
  9. package/lib/utils/authorize/album.js +39 -0
  10. package/lib/utils/authorize/album.test.js +82 -0
  11. package/lib/utils/ttt.d.ts +0 -26
  12. package/lib/utils/ttt.js +2 -109
  13. package/lib/widgets/index.d.ts +0 -1
  14. package/lib/widgets/index.js +1 -2
  15. package/lib/widgets/recordVideo/recordVideo.js +40 -50
  16. package/lib/widgets/recordVideo/recordVideo.less +74 -17
  17. package/lib/widgets/recordVideo/recordVideo.test.js +58 -0
  18. package/lib/widgets/resolution/resolution.js +1 -0
  19. package/lib/widgets/screenshot/screenshot.js +44 -97
  20. package/lib/widgets/screenshot/screenshot.less +40 -1
  21. package/lib/widgets/videoBitKBP/videoBitKBP.js +9 -38
  22. package/lib/widgets/videoBitKBP/videoBitKBP.less +0 -6
  23. package/package.json +2 -2
  24. package/lib/ctx/ctx.autoClarity.test.js +0 -150
  25. package/lib/ui/absoluteContent.d.ts +0 -2
  26. package/lib/ui/absoluteContent.js +0 -3
  27. package/lib/utils/captureResult.d.ts +0 -14
  28. package/lib/utils/captureResult.js +0 -70
  29. package/lib/utils/captureResult.test.js +0 -117
  30. package/lib/utils/ttt.autoClarity.test.d.ts +0 -1
  31. package/lib/utils/ttt.autoClarity.test.js +0 -75
  32. package/lib/widgets/captureResult/captureResult.d.ts +0 -16
  33. package/lib/widgets/captureResult/captureResult.js +0 -85
  34. package/lib/widgets/captureResult/captureResult.less +0 -144
  35. package/lib/widgets/captureResult/captureResult.test.d.ts +0 -1
  36. package/lib/widgets/captureResult/captureResult.test.js +0 -80
  37. package/lib/widgets/captureResult/index.d.ts +0 -2
  38. package/lib/widgets/captureResult/index.js +0 -2
  39. package/lib/widgets/videoBitKBP/videoBitKBP.test.d.ts +0 -1
  40. package/lib/widgets/videoBitKBP/videoBitKBP.test.js +0 -81
  41. /package/lib/{ctx/ctx.autoClarity.test.d.ts → utils/authorize/album.test.d.ts} +0 -0
  42. /package/lib/{utils/captureResult.test.d.ts → widgets/recordVideo/recordVideo.test.d.ts} +0 -0
@@ -6,7 +6,6 @@ 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';
10
9
  import { landscapeTipId, moveablePtzControlId, multiPtzId, ptzMoveableTipId, tileActionsId, tileTipId } from '../ui/constant';
11
10
  import { multiPrefix } from '../widgets/multiCamera/constants';
12
11
  const createPlayContext = ty.createIpcPlayerContext;
@@ -88,29 +87,20 @@ export const defaultBottomRightContent = [{
88
87
  content: FullScreen
89
88
  }];
90
89
  const absoluteContent = [];
91
- const renderWhenPlaying = _ref => {
92
- let {
93
- playState
94
- } = _ref;
95
- return playState === PlayState.PLAYING;
96
- };
97
90
  export const multiCameraAbsoluteContent = [{
98
91
  id: tileTipId,
99
92
  content: TileTip,
100
93
  absoluteContentClassName: `${multiPrefix}-tile-tip-wrap`,
101
- renderWhen: renderWhenPlaying,
102
94
  hidden: true
103
95
  }, {
104
96
  id: ptzMoveableTipId,
105
97
  content: PtzMoveableTip,
106
98
  absoluteContentClassName: `${multiPrefix}-tile-tip-wrap`,
107
- renderWhen: renderWhenPlaying,
108
99
  hidden: true
109
100
  }, {
110
101
  id: landscapeTipId,
111
102
  content: LandscapeTip,
112
103
  absoluteContentClassName: `${multiPrefix}-tile-tip-wrap`,
113
- renderWhen: renderWhenPlaying,
114
104
  hidden: true
115
105
  }, {
116
106
  id: tileActionsId,
@@ -122,12 +112,12 @@ export const multiCameraAbsoluteContent = [{
122
112
  absoluteNoCoverView: true,
123
113
  hidden: true
124
114
  }];
125
- const toast = _ref2 => {
115
+ const toast = _ref => {
126
116
  let {
127
117
  title,
128
118
  duration
129
- } = _ref2,
130
- config = _objectWithoutProperties(_ref2, _excluded);
119
+ } = _ref,
120
+ config = _objectWithoutProperties(_ref, _excluded);
131
121
  ty.showToast(_objectSpread({
132
122
  title,
133
123
  duration,
package/lib/ctx/ctx.js CHANGED
@@ -6,13 +6,13 @@ import "core-js/modules/esnext.iterator.map.js";
6
6
  import { useRef, useCallback, useEffect } from 'react';
7
7
  import { getSystemInfoSync, showModal, openAppSystemSettingPage } from '@ray-js/ray';
8
8
  import Strings from '../i18n';
9
+ import { ensureAlbumPermission } from '../utils/authorize/album';
9
10
  import { useAtom, updateAtom, getDefaultStore, useStore } from './store';
10
11
  import { PlayState, IntercomMode } from '../interface';
11
12
  import { changeIgnoreHideStopPreview } from '../ui/constant';
12
13
  import { ClarityType } from '@ray-js/ray-ipc-utils/lib/interface';
13
14
  import { getEventInstance } from './event';
14
15
  import { isMultiCameraTileSupported, useMultiCameraCtx } from './multiCameraCtx';
15
- import { getCachedAutoClarity, isClarityChangedSupported, setCachedAutoClarity, subscribeClarityChanged } from '../utils/ttt';
16
16
  const SAVE_TO_ALBUM = 1;
17
17
  export const createUseCtx = _ref => {
18
18
  let {
@@ -37,7 +37,6 @@ export const createUseCtx = _ref => {
37
37
  initBottomRightContent,
38
38
  initAbsoluteContent,
39
39
  saveToAlbum = SAVE_TO_ALBUM,
40
- multiLens = false,
41
40
  showPtzControlTip = false,
42
41
  videoSplitProtocol
43
42
  } = _ref2;
@@ -57,7 +56,6 @@ export const createUseCtx = _ref => {
57
56
 
58
57
  // 录像中
59
58
  const [recording] = useAtom(false);
60
- const recordingMultiLensRef = useRef(false);
61
59
 
62
60
  // 录像是否不可点击
63
61
  const [recordingDisabled, setRecordingDisabled] = useAtom(false);
@@ -75,8 +73,6 @@ export const createUseCtx = _ref => {
75
73
  const [resolution] = useAtom('HD');
76
74
  // resolution 清晰度列表
77
75
  const [resolutionList, setResolutionList] = useAtom([]);
78
- // 自动模式下宿主上报的实际清晰度,供横竖屏码率区域共用
79
- const [autoClarity] = useAtom(null);
80
76
 
81
77
  // 单向对讲还是双向对讲
82
78
  const [intercomMode, setIntercomMode] = useAtom(IntercomMode.TwoWay);
@@ -104,67 +100,14 @@ export const createUseCtx = _ref => {
104
100
  const [bottomRightContent] = useAtom(initBottomRightContent || defaultBottomRightContent || []);
105
101
  const [absoluteContent] = useAtom(initAbsoluteContent || defaultAbsoluteContent || []);
106
102
  const {
107
- _playState,
108
- currentResolution
103
+ _playState
109
104
  } = useStore({
110
- _playState: playState,
111
- currentResolution: resolution
105
+ _playState: playState
112
106
  });
113
- const restoredAutoRef = useRef(false);
114
- const refreshedAutoRef = useRef(false);
115
- const freshAutoClarityRef = useRef(false);
116
- const pendingAutoSelectionRef = useRef(false);
117
- const userSelectedResolutionRef = useRef(false);
118
- useEffect(() => {
119
- updateAtom(autoClarity, null);
120
- restoredAutoRef.current = false;
121
- refreshedAutoRef.current = false;
122
- freshAutoClarityRef.current = false;
123
- userSelectedResolutionRef.current = false;
124
- if (!devId) return undefined;
125
- return subscribeClarityChanged(devId, res => {
126
- if (getDefaultStore().get(resolution) !== ClarityType.AUTO && !pendingAutoSelectionRef.current) {
127
- return;
128
- }
129
- freshAutoClarityRef.current = true;
130
- updateAtom(autoClarity, res.clarity);
131
- setCachedAutoClarity(devId, res.clarity);
132
- });
133
- }, [autoClarity, devId, resolution]);
134
107
  const eventRef = useRef();
135
108
  if (!eventRef.current) {
136
109
  eventRef.current = getEventInstance();
137
110
  }
138
-
139
- /**
140
- * 只有宿主支持自动清晰度事件,且接口返回的清晰度档位数量不少于 2 个时,才展示 AUTO:
141
- * 竖屏宿主弹框(由 resolutionList 构建 actionData)与横屏 FullResolutionControl 共用。
142
- */
143
- const canShowAutoClarity = function () {
144
- let list = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
145
- return isClarityChangedSupported() && list.length >= 2;
146
- };
147
- const withAutoClarity = function () {
148
- let list = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
149
- const withoutAuto = list.filter(clarity => clarity !== ClarityType.AUTO);
150
- return canShowAutoClarity(list) ? [...withoutAuto, ClarityType.AUTO] : withoutAuto;
151
- };
152
- const normalizeResolution = (resolution, list) => {
153
- if (resolution !== ClarityType.AUTO || canShowAutoClarity(list)) return resolution;
154
- return list.find(clarity => clarity !== ClarityType.AUTO) || ClarityType.HD;
155
- };
156
- const restoreResolution = (cachedResolution, list) => {
157
- if (userSelectedResolutionRef.current) return;
158
- const target = normalizeResolution(cachedResolution, list);
159
- if (target === ClarityType.AUTO) {
160
- restoredAutoRef.current = true;
161
- const cachedClarity = getCachedAutoClarity(devId);
162
- if (cachedClarity && list.includes(cachedClarity) && !getDefaultStore().get(autoClarity)) {
163
- updateAtom(autoClarity, cachedClarity);
164
- }
165
- }
166
- _setResolution(target, true);
167
- };
168
111
  useEffect(() => {
169
112
  // 初始化获取缓存值
170
113
 
@@ -173,8 +116,8 @@ export const createUseCtx = _ref => {
173
116
  try {
174
117
  var _res$maxZoomSettings;
175
118
  const res = await getMemoryState(devId);
176
- setResolutionList(withAutoClarity(res.resolutionList));
177
- restoreResolution(res.resolution, res.resolutionList);
119
+ setResolutionList(res.resolutionList);
120
+ _setResolution(res.resolution, true);
178
121
  _setMute(res.mute, true);
179
122
  setIntercomMode(res.intercomMode);
180
123
  setIntercomSupported(res.isIntercomSupported);
@@ -189,9 +132,9 @@ export const createUseCtx = _ref => {
189
132
  // 获取缓存的值且同步
190
133
  getMemoryState(devId).then(res => {
191
134
  var _res$maxZoomSettings2;
192
- setResolutionList(withAutoClarity(res.resolutionList));
135
+ setResolutionList(res.resolutionList);
193
136
  // 传true表示值即可,会取播放器的值
194
- restoreResolution(res.resolution, res.resolutionList);
137
+ _setResolution(res.resolution, true);
195
138
  _setMute(res.mute, true);
196
139
  setIntercomMode(res.intercomMode);
197
140
  setIntercomSupported(res.isIntercomSupported);
@@ -199,18 +142,6 @@ export const createUseCtx = _ref => {
199
142
  });
200
143
  }
201
144
  }, [devId, _playState]);
202
- useEffect(() => {
203
- var _IPCPlayerInstance$cu;
204
- if (!devId || _playState !== PlayState.PLAYING || currentResolution !== ClarityType.AUTO || !restoredAutoRef.current || freshAutoClarityRef.current || refreshedAutoRef.current) {
205
- return;
206
- }
207
- refreshedAutoRef.current = true;
208
- // 缓存只保证首屏有上次档位;出流后重申自动,让宿主回报本次实际档位。
209
- (_IPCPlayerInstance$cu = IPCPlayerInstance.current) === null || _IPCPlayerInstance$cu === void 0 || _IPCPlayerInstance$cu.setClarity({
210
- clarity: 'auto',
211
- fail: error => console.warn('res===restore auto clarity fail', error)
212
- });
213
- }, [devId, _playState, currentResolution]);
214
145
  // 获取content数据
215
146
  const getContent = () => {
216
147
  const store = getDefaultStore();
@@ -305,33 +236,15 @@ export const createUseCtx = _ref => {
305
236
  updateAtom(resolution, target);
306
237
  return false;
307
238
  }
308
- userSelectedResolutionRef.current = true;
309
- // 清晰度事件可能在 setClarity 的 success 回调前到达,进入自动前先清掉上次的值。
310
- restoredAutoRef.current = false;
311
- if (target === ClarityType.AUTO) {
312
- pendingAutoSelectionRef.current = true;
313
- updateAtom(autoClarity, null);
314
- }
315
239
  return new Promise((resolve, reject) => {
316
- const clarityMap = {
317
- [ClarityType.SS]: 'ss',
318
- [ClarityType.SD]: 'normal',
319
- [ClarityType.HD]: 'hd',
320
- [ClarityType.UD]: 'ud',
321
- [ClarityType.SSP]: 'ssp',
322
- [ClarityType.AUTO]: 'auto',
323
- [ClarityType.AUDIO]: 'audio'
324
- };
325
240
  IPCPlayerInstance.current.setClarity({
326
- clarity: clarityMap[target] || 'normal',
241
+ clarity: target === ClarityType.HD ? 'hd' : 'normal',
327
242
  success: () => {
328
- pendingAutoSelectionRef.current = false;
329
243
  setResolutionMemoryState(devId, target);
330
244
  updateAtom(resolution, target);
331
245
  resolve(true);
332
246
  },
333
247
  fail: err => {
334
- pendingAutoSelectionRef.current = false;
335
248
  console.log(err, 'setClarity err');
336
249
  // updateAtom(mute, !target);
337
250
  reject(err);
@@ -339,30 +252,6 @@ export const createUseCtx = _ref => {
339
252
  });
340
253
  });
341
254
  };
342
- const stopRecording = showError => {
343
- return new Promise((resolve, reject) => {
344
- IPCPlayerInstance.current.stopRecord({
345
- saveToAlbum,
346
- success: res => {
347
- recordingMultiLensRef.current = false;
348
- updateAtom(recording, false);
349
- resolve(res);
350
- },
351
- fail: err => {
352
- recordingMultiLensRef.current = false;
353
- updateAtom(recording, false);
354
- reject(err);
355
- if (showError) {
356
- const errObj = err.innerError || err || {};
357
- const errMsg = errObj.errorMsg || Strings.getLang('ipc_player_stop_recording_err');
358
- toast({
359
- title: errMsg
360
- });
361
- }
362
- }
363
- });
364
- });
365
- };
366
255
  const multiCameraCtx = useMultiCameraCtx({
367
256
  devId,
368
257
  IPCPlayerInstance: IPCPlayerInstance.current,
@@ -373,7 +262,6 @@ export const createUseCtx = _ref => {
373
262
  brandColor,
374
263
  verticalMic,
375
264
  saveToAlbum,
376
- multiLens,
377
265
  screenType,
378
266
  isVerticalFullLayout,
379
267
  setIsVerticalFullLayout,
@@ -383,7 +271,6 @@ export const createUseCtx = _ref => {
383
271
  mute,
384
272
  resolution,
385
273
  resolutionList,
386
- autoClarity,
387
274
  intercom,
388
275
  intercomMode,
389
276
  intercomSupported,
@@ -518,9 +405,13 @@ export const createUseCtx = _ref => {
518
405
  eventRef.current.emit(changeIgnoreHideStopPreview, false);
519
406
  return false;
520
407
  }
521
- if (!target) return stopRecording(true);
408
+ if (target) {
409
+ const granted = await ensureAlbumPermission();
410
+ eventRef.current.emit(changeIgnoreHideStopPreview, false);
411
+ if (!granted) return false;
412
+ }
522
413
  return new Promise((resolve, reject) => {
523
- const startRecord = () => {
414
+ if (target) {
524
415
  IPCPlayerInstance.current.startRecord({
525
416
  saveToAlbum,
526
417
  success: () => {
@@ -532,45 +423,26 @@ export const createUseCtx = _ref => {
532
423
  reject(err);
533
424
  }
534
425
  });
535
- };
536
- // 写入相册
537
- ty.authorizeStatus({
538
- scope: 'scope.writePhotosAlbum',
539
- success: () => {
540
- eventRef.current.emit(changeIgnoreHideStopPreview, false);
541
- startRecord();
542
- },
543
- fail: () => {
544
- ty.authorize({
545
- scope: 'scope.writePhotosAlbum',
546
- success: () => {
547
- startRecord();
548
- },
549
- fail: () => {
550
- showModal({
551
- title: '',
552
- content: Strings.getLang('ipc_player_no_album_permission'),
553
- cancelText: Strings.getLang('ipc_player_authorize_cancel_text'),
554
- confirmText: Strings.getLang('ipc_player_authorize_confirm_text'),
555
- isShowGlobal: true,
556
- success: res => {
557
- if (res.confirm) {
558
- openAppSystemSettingPage({
559
- scope: 'App-Settings',
560
- success: () => {
561
- console.log('跳转成功');
562
- }
563
- });
564
- }
565
- }
566
- });
567
- }
568
- });
569
- }
570
- });
426
+ } else {
427
+ IPCPlayerInstance.current.stopRecord({
428
+ saveToAlbum,
429
+ success: res => {
430
+ updateAtom(recording, false);
431
+ resolve(res);
432
+ },
433
+ fail: err => {
434
+ updateAtom(recording, false);
435
+ reject(err);
436
+ const errObj = err.innerError || err || {};
437
+ const errMsg = errObj.errorMsg || Strings.getLang('ipc_player_stop_recording_err');
438
+ toast({
439
+ title: errMsg
440
+ });
441
+ }
442
+ });
443
+ }
571
444
  });
572
445
  },
573
- stopRecordingOnUnload: () => stopRecording(false),
574
446
  setRecordingDisabled,
575
447
  setScreenType,
576
448
  topLeftContent,
@@ -1,20 +1,12 @@
1
1
  import { kit } from '@ray-js/panel-sdk';
2
2
  declare const Strings: kit.I18N<{
3
3
  en: {
4
- ipc_player_resolution_SS: string;
5
4
  ipc_player_resolution_HD: string;
6
5
  ipc_player_resolution_SD: string;
7
- ipc_player_resolution_UD: string;
8
- ipc_player_resolution_SSP: string;
9
- ipc_player_resolution_AUTO: string;
10
- ipc_player_resolution_AUDIO: string;
11
6
  ipc_player_current_resolution_is_equal: string;
12
7
  ipc_player_screenshot_success_tip: string;
13
- ipc_player_screenshot_multi_success_tip: string;
14
8
  ipc_player_error_screenshot_error_tip: string;
15
9
  ipc_player_record_success_tip: string;
16
- ipc_player_record_multi_success_tip: string;
17
- ipc_player_multi_capture_success_count: string;
18
10
  ipc_player_shot_success_check: string;
19
11
  ipc_player_record_success_check: string;
20
12
  ipc_player_recording_now_tip: string;
@@ -46,20 +38,12 @@ declare const Strings: kit.I18N<{
46
38
  ipc_player_low_phone_not_support: string;
47
39
  };
48
40
  zh: {
49
- ipc_player_resolution_SS: string;
50
41
  ipc_player_resolution_HD: string;
51
42
  ipc_player_resolution_SD: string;
52
- ipc_player_resolution_UD: string;
53
- ipc_player_resolution_SSP: string;
54
- ipc_player_resolution_AUTO: string;
55
- ipc_player_resolution_AUDIO: string;
56
43
  ipc_player_current_resolution_is_equal: string;
57
44
  ipc_player_screenshot_success_tip: string;
58
- ipc_player_screenshot_multi_success_tip: string;
59
45
  ipc_player_error_screenshot_error_tip: string;
60
46
  ipc_player_record_success_tip: string;
61
- ipc_player_record_multi_success_tip: string;
62
- ipc_player_multi_capture_success_count: string;
63
47
  ipc_player_shot_success_check: string;
64
48
  ipc_player_record_success_check: string;
65
49
  ipc_player_recording_now_tip: string;
@@ -91,20 +75,12 @@ declare const Strings: kit.I18N<{
91
75
  ipc_player_low_phone_not_support: string;
92
76
  };
93
77
  }, {
94
- ipc_player_resolution_SS: string;
95
78
  ipc_player_resolution_HD: string;
96
79
  ipc_player_resolution_SD: string;
97
- ipc_player_resolution_UD: string;
98
- ipc_player_resolution_SSP: string;
99
- ipc_player_resolution_AUTO: string;
100
- ipc_player_resolution_AUDIO: string;
101
80
  ipc_player_current_resolution_is_equal: string;
102
81
  ipc_player_screenshot_success_tip: string;
103
- ipc_player_screenshot_multi_success_tip: string;
104
82
  ipc_player_error_screenshot_error_tip: string;
105
83
  ipc_player_record_success_tip: string;
106
- ipc_player_record_multi_success_tip: string;
107
- ipc_player_multi_capture_success_count: string;
108
84
  ipc_player_shot_success_check: string;
109
85
  ipc_player_record_success_check: string;
110
86
  ipc_player_recording_now_tip: string;
@@ -135,20 +111,12 @@ declare const Strings: kit.I18N<{
135
111
  ipc_player_fetch_error: string;
136
112
  ipc_player_low_phone_not_support: string;
137
113
  } | {
138
- ipc_player_resolution_SS: string;
139
114
  ipc_player_resolution_HD: string;
140
115
  ipc_player_resolution_SD: string;
141
- ipc_player_resolution_UD: string;
142
- ipc_player_resolution_SSP: string;
143
- ipc_player_resolution_AUTO: string;
144
- ipc_player_resolution_AUDIO: string;
145
116
  ipc_player_current_resolution_is_equal: string;
146
117
  ipc_player_screenshot_success_tip: string;
147
- ipc_player_screenshot_multi_success_tip: string;
148
118
  ipc_player_error_screenshot_error_tip: string;
149
119
  ipc_player_record_success_tip: string;
150
- ipc_player_record_multi_success_tip: string;
151
- ipc_player_multi_capture_success_count: string;
152
120
  ipc_player_shot_success_check: string;
153
121
  ipc_player_record_success_check: string;
154
122
  ipc_player_recording_now_tip: string;
@@ -1,19 +1,11 @@
1
1
  declare const _default: {
2
2
  en: {
3
- ipc_player_resolution_SS: string;
4
3
  ipc_player_resolution_HD: string;
5
4
  ipc_player_resolution_SD: string;
6
- ipc_player_resolution_UD: string;
7
- ipc_player_resolution_SSP: string;
8
- ipc_player_resolution_AUTO: string;
9
- ipc_player_resolution_AUDIO: string;
10
5
  ipc_player_current_resolution_is_equal: string;
11
6
  ipc_player_screenshot_success_tip: string;
12
- ipc_player_screenshot_multi_success_tip: string;
13
7
  ipc_player_error_screenshot_error_tip: string;
14
8
  ipc_player_record_success_tip: string;
15
- ipc_player_record_multi_success_tip: string;
16
- ipc_player_multi_capture_success_count: string;
17
9
  ipc_player_shot_success_check: string;
18
10
  ipc_player_record_success_check: string;
19
11
  ipc_player_recording_now_tip: string;
@@ -45,20 +37,12 @@ declare const _default: {
45
37
  ipc_player_low_phone_not_support: string;
46
38
  };
47
39
  zh: {
48
- ipc_player_resolution_SS: string;
49
40
  ipc_player_resolution_HD: string;
50
41
  ipc_player_resolution_SD: string;
51
- ipc_player_resolution_UD: string;
52
- ipc_player_resolution_SSP: string;
53
- ipc_player_resolution_AUTO: string;
54
- ipc_player_resolution_AUDIO: string;
55
42
  ipc_player_current_resolution_is_equal: string;
56
43
  ipc_player_screenshot_success_tip: string;
57
- ipc_player_screenshot_multi_success_tip: string;
58
44
  ipc_player_error_screenshot_error_tip: string;
59
45
  ipc_player_record_success_tip: string;
60
- ipc_player_record_multi_success_tip: string;
61
- ipc_player_multi_capture_success_count: string;
62
46
  ipc_player_shot_success_check: string;
63
47
  ipc_player_record_success_check: string;
64
48
  ipc_player_recording_now_tip: string;
@@ -1,19 +1,11 @@
1
1
  export default {
2
2
  en: {
3
- ipc_player_resolution_SS: 'Data Saver',
4
3
  ipc_player_resolution_HD: 'HD',
5
4
  ipc_player_resolution_SD: 'SD',
6
- ipc_player_resolution_UD: 'Ultra HD',
7
- ipc_player_resolution_SSP: 'Super Ultra HD',
8
- ipc_player_resolution_AUTO: 'Auto',
9
- ipc_player_resolution_AUDIO: 'Audio Mode',
10
5
  ipc_player_current_resolution_is_equal: 'Already at current clarity',
11
6
  ipc_player_screenshot_success_tip: 'Screenshot saved to album',
12
- ipc_player_screenshot_multi_success_tip: 'Screenshots saved to album',
13
7
  ipc_player_error_screenshot_error_tip: 'Screenshot failed. Please try again later.',
14
8
  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',
17
9
  ipc_player_shot_success_check: 'View',
18
10
  ipc_player_record_success_check: 'View',
19
11
  ipc_player_recording_now_tip: 'Recording in progress...',
@@ -45,20 +37,12 @@ export default {
45
37
  ipc_player_low_phone_not_support: 'This feature is not supported on this device'
46
38
  },
47
39
  zh: {
48
- ipc_player_resolution_SS: '省流量',
49
40
  ipc_player_resolution_HD: '高清',
50
41
  ipc_player_resolution_SD: '标清',
51
- ipc_player_resolution_UD: '超清',
52
- ipc_player_resolution_SSP: '超超清',
53
- ipc_player_resolution_AUTO: '自动',
54
- ipc_player_resolution_AUDIO: '音频模式',
55
42
  ipc_player_current_resolution_is_equal: '已是当前清晰度',
56
43
  ipc_player_screenshot_success_tip: '截图已保存在APP相册',
57
- ipc_player_screenshot_multi_success_tip: '图片已保存至相册',
58
44
  ipc_player_error_screenshot_error_tip: '截图失败了,请稍后再试',
59
45
  ipc_player_record_success_tip: '录像已保存在APP相册',
60
- ipc_player_record_multi_success_tip: '视频已保存至相册',
61
- ipc_player_multi_capture_success_count: '共{0}个',
62
46
  ipc_player_shot_success_check: '查看',
63
47
  ipc_player_record_success_check: '查看',
64
48
  ipc_player_recording_now_tip: '正在录像中...',
@@ -1,6 +1,5 @@
1
1
  import React from 'react';
2
2
  import { PrimitiveAtom } from 'jotai';
3
- import type { ClarityType } from '@ray-js/ray-ipc-utils/lib/interface';
4
3
  import type { Toast, IntercomMode } from './ports.output';
5
4
  import { useMultiCameraCtx } from './ctx/multiCameraCtx';
6
5
  import type { ZoomSkill } from './widgets/zoomTurntable/lensSkill';
@@ -47,7 +46,6 @@ export type UseCtx = (options: {
47
46
  initBottomRightContent?: ComponentConfig[];
48
47
  initAbsoluteContent?: ComponentConfig[];
49
48
  saveToAlbum?: 0 | 1;
50
- multiLens?: boolean;
51
49
  showPtzControlTip?: boolean;
52
50
  videoSplitProtocol?: VideoSplitProtocol;
53
51
  }) => {
@@ -55,7 +53,6 @@ export type UseCtx = (options: {
55
53
  brandColor: RetAtom<string>;
56
54
  verticalMic: RetAtom<boolean>;
57
55
  saveToAlbum: 0 | 1;
58
- multiLens: boolean;
59
56
  showPtzControlTip: boolean;
60
57
  screenType: RetAtom<ScreenType>;
61
58
  isVerticalFullLayout: RetAtom<boolean>;
@@ -75,7 +72,6 @@ export type UseCtx = (options: {
75
72
  setZoomLensIndex: (value: number) => void;
76
73
  resolution: RetAtom<string>;
77
74
  resolutionList: RetAtom<string[]>;
78
- autoClarity: RetAtom<ClarityType | null>;
79
75
  playState: RetAtom<PlayState>;
80
76
  IPCPlayerInstance: IpcContext;
81
77
  topLeftContent: RetAtom<ComponentConfig[]>;
@@ -89,10 +85,9 @@ export type UseCtx = (options: {
89
85
  setVerticalMic: (value: boolean) => void;
90
86
  setScreenType: (type: ScreenType) => void;
91
87
  setRecordingDisabled: (type: boolean) => void;
92
- setResolution: (type: string) => Promise<boolean>;
88
+ setResolution: (type: string) => void;
93
89
  setResolutionList: (type: string[]) => void;
94
- setRecording: (value: boolean, onlyUpdateAtom?: boolean) => Promise<CaptureResult>;
95
- stopRecordingOnUnload: () => Promise<CaptureResult>;
90
+ setRecording: (value: boolean, onlyUpdateAtom?: boolean) => Promise<RecordInfoData>;
96
91
  setIntercom: (value: boolean, onlyUpdateAtom?: boolean) => Promise<boolean>;
97
92
  setMute: (value: boolean) => Promise<boolean>;
98
93
  changeStreamStatus: (value: PlayerStreamStatus) => void;
@@ -123,12 +118,8 @@ export type ComponentConfig<T = ReturnType<UseCtx> & Record<string, any>> = {
123
118
  absoluteContentClassName?: string;
124
119
  absoluteContentStyle?: React.CSSProperties;
125
120
  absoluteNoCoverView?: boolean;
126
- renderWhen?: (state: ComponentRenderState) => boolean;
127
121
  hidden?: boolean;
128
122
  };
129
- export type ComponentRenderState = {
130
- playState: PlayState;
131
- };
132
123
  export type ComponentConfigProps = {
133
124
  IPCPlayerContext: IpcContext;
134
125
  } & ReturnType<UseCtx>;
@@ -136,17 +127,11 @@ export type PlayStatusData = {
136
127
  playState: PlayState;
137
128
  playCode: number;
138
129
  };
139
- export type CaptureFileInfo = {
140
- index?: number;
130
+ export type RecordInfoData = boolean | {
141
131
  tempImagePath: string;
142
132
  filePath: string;
143
- thumbPath?: string;
144
- width?: number;
145
- height?: number;
146
- data?: string;
133
+ thumbPath: string;
147
134
  };
148
- export type CaptureResult = boolean | CaptureFileInfo;
149
- export type RecordInfoData = CaptureResult;
150
135
  /**
151
136
  * 多目屏幕模式
152
137
  */