@ray-js/ipc-player-integration 0.0.65-beta.3 → 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 +53 -53
- 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 -66
- 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 -14
- package/lib/utils/captureResult.js +0 -70
- package/lib/utils/captureResult.test.d.ts +0 -1
- package/lib/utils/captureResult.test.js +0 -117
- 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 -80
- 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 -120
package/README.md
CHANGED
|
@@ -359,3 +359,9 @@ 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.
|
|
@@ -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 =
|
|
115
|
+
const toast = _ref => {
|
|
126
116
|
let {
|
|
127
117
|
title,
|
|
128
118
|
duration
|
|
129
|
-
} =
|
|
130
|
-
config = _objectWithoutProperties(
|
|
119
|
+
} = _ref,
|
|
120
|
+
config = _objectWithoutProperties(_ref, _excluded);
|
|
131
121
|
ty.showToast(_objectSpread({
|
|
132
122
|
title,
|
|
133
123
|
duration,
|
package/lib/ctx/ctx.js
CHANGED
|
@@ -40,13 +40,10 @@ export const createUseCtx = _ref => {
|
|
|
40
40
|
initBottomRightContent,
|
|
41
41
|
initAbsoluteContent,
|
|
42
42
|
saveToAlbum = SAVE_TO_ALBUM,
|
|
43
|
-
multiLens = false,
|
|
44
43
|
showPtzControlTip = false,
|
|
45
44
|
videoSplitProtocol
|
|
46
45
|
} = _ref2;
|
|
47
46
|
const streamStatus = useRef();
|
|
48
|
-
// The page owns this context; player UI remounts must retain exposure history.
|
|
49
|
-
const trialBadgeViewedRef = useRef(false);
|
|
50
47
|
// 全屏、竖屏
|
|
51
48
|
const [screenType, setScreenType] = useAtom('vertical');
|
|
52
49
|
const IPCPlayerInstance = useRef();
|
|
@@ -62,7 +59,6 @@ export const createUseCtx = _ref => {
|
|
|
62
59
|
|
|
63
60
|
// 录像中
|
|
64
61
|
const [recording] = useAtom(false);
|
|
65
|
-
const recordingMultiLensRef = useRef(false);
|
|
66
62
|
|
|
67
63
|
// 录像是否不可点击
|
|
68
64
|
const [recordingDisabled, setRecordingDisabled] = useAtom(false);
|
|
@@ -315,30 +311,6 @@ export const createUseCtx = _ref => {
|
|
|
315
311
|
});
|
|
316
312
|
});
|
|
317
313
|
};
|
|
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
|
-
};
|
|
342
314
|
const multiCameraCtx = useMultiCameraCtx({
|
|
343
315
|
devId,
|
|
344
316
|
IPCPlayerInstance: IPCPlayerInstance.current,
|
|
@@ -346,11 +318,9 @@ export const createUseCtx = _ref => {
|
|
|
346
318
|
});
|
|
347
319
|
return {
|
|
348
320
|
devId,
|
|
349
|
-
trialBadgeViewedRef,
|
|
350
321
|
brandColor,
|
|
351
322
|
verticalMic,
|
|
352
323
|
saveToAlbum,
|
|
353
|
-
multiLens,
|
|
354
324
|
screenType,
|
|
355
325
|
isVerticalFullLayout,
|
|
356
326
|
setIsVerticalFullLayout,
|
|
@@ -495,25 +465,44 @@ export const createUseCtx = _ref => {
|
|
|
495
465
|
eventRef.current.emit(changeIgnoreHideStopPreview, false);
|
|
496
466
|
return false;
|
|
497
467
|
}
|
|
498
|
-
if (
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
468
|
+
if (target) {
|
|
469
|
+
const granted = await ensureAlbumPermission();
|
|
470
|
+
eventRef.current.emit(changeIgnoreHideStopPreview, false);
|
|
471
|
+
if (!granted) return false;
|
|
472
|
+
}
|
|
502
473
|
return new Promise((resolve, reject) => {
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
474
|
+
if (target) {
|
|
475
|
+
IPCPlayerInstance.current.startRecord({
|
|
476
|
+
saveToAlbum,
|
|
477
|
+
success: () => {
|
|
478
|
+
updateAtom(recording, true);
|
|
479
|
+
resolve(true);
|
|
480
|
+
},
|
|
481
|
+
fail: err => {
|
|
482
|
+
eventRef.current.emit(changeIgnoreHideStopPreview, false);
|
|
483
|
+
reject(err);
|
|
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
|
+
}
|
|
514
504
|
});
|
|
515
505
|
},
|
|
516
|
-
stopRecordingOnUnload: () => stopRecording(false),
|
|
517
506
|
setRecordingDisabled,
|
|
518
507
|
setScreenType,
|
|
519
508
|
topLeftContent,
|
|
@@ -92,8 +92,6 @@ 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;
|
|
97
95
|
/**
|
|
98
96
|
* 显示/隐藏镜头名称
|
|
99
97
|
*/
|
|
@@ -6,10 +6,7 @@ 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 {
|
|
10
|
-
|
|
11
|
-
// Keep the opt-out across player remounts, only for this miniapp runtime.
|
|
12
|
-
let ptzManuallyClosed = false;
|
|
9
|
+
import { useAtom } from './store';
|
|
13
10
|
const DEFAULT_VIDEO_SPLIT_PROTOCOL = {
|
|
14
11
|
total_split_num: 1,
|
|
15
12
|
split_info: [],
|
|
@@ -59,17 +56,6 @@ export const useMultiCameraCtx = props => {
|
|
|
59
56
|
const [selectedLenInfoAtom, setSelectedLenInfo] = useAtom(DEFAULT_SELECTED_LEN_INFO);
|
|
60
57
|
const [nextLayoutStyleAtom, setNextLayoutStyle] = useAtom(MultiCameraLayoutStyle.invalid);
|
|
61
58
|
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
|
-
});
|
|
73
59
|
const selectVideoFiredRef = useRef(false);
|
|
74
60
|
const selectedLenInfoRef = useRef(DEFAULT_SELECTED_LEN_INFO);
|
|
75
61
|
const handleSelectVideoIndex = useMemoizedFn(event => {
|
|
@@ -324,8 +310,6 @@ export const useMultiCameraCtx = props => {
|
|
|
324
310
|
* 设置ptz状态
|
|
325
311
|
*/
|
|
326
312
|
setPtzStatus,
|
|
327
|
-
togglePtz,
|
|
328
|
-
openDefaultPtz,
|
|
329
313
|
/**
|
|
330
314
|
* 显示/隐藏镜头名称
|
|
331
315
|
*/
|
package/lib/i18n/index.d.ts
CHANGED
|
@@ -10,11 +10,8 @@ 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;
|
|
14
13
|
ipc_player_error_screenshot_error_tip: string;
|
|
15
14
|
ipc_player_record_success_tip: string;
|
|
16
|
-
ipc_player_record_multi_success_tip: string;
|
|
17
|
-
ipc_player_multi_capture_success_count: string;
|
|
18
15
|
ipc_player_shot_success_check: string;
|
|
19
16
|
ipc_player_record_success_check: string;
|
|
20
17
|
ipc_player_recording_now_tip: string;
|
|
@@ -55,11 +52,8 @@ declare const Strings: kit.I18N<{
|
|
|
55
52
|
ipc_player_resolution_AUDIO: string;
|
|
56
53
|
ipc_player_current_resolution_is_equal: string;
|
|
57
54
|
ipc_player_screenshot_success_tip: string;
|
|
58
|
-
ipc_player_screenshot_multi_success_tip: string;
|
|
59
55
|
ipc_player_error_screenshot_error_tip: string;
|
|
60
56
|
ipc_player_record_success_tip: string;
|
|
61
|
-
ipc_player_record_multi_success_tip: string;
|
|
62
|
-
ipc_player_multi_capture_success_count: string;
|
|
63
57
|
ipc_player_shot_success_check: string;
|
|
64
58
|
ipc_player_record_success_check: string;
|
|
65
59
|
ipc_player_recording_now_tip: string;
|
|
@@ -100,11 +94,8 @@ declare const Strings: kit.I18N<{
|
|
|
100
94
|
ipc_player_resolution_AUDIO: string;
|
|
101
95
|
ipc_player_current_resolution_is_equal: string;
|
|
102
96
|
ipc_player_screenshot_success_tip: string;
|
|
103
|
-
ipc_player_screenshot_multi_success_tip: string;
|
|
104
97
|
ipc_player_error_screenshot_error_tip: string;
|
|
105
98
|
ipc_player_record_success_tip: string;
|
|
106
|
-
ipc_player_record_multi_success_tip: string;
|
|
107
|
-
ipc_player_multi_capture_success_count: string;
|
|
108
99
|
ipc_player_shot_success_check: string;
|
|
109
100
|
ipc_player_record_success_check: string;
|
|
110
101
|
ipc_player_recording_now_tip: string;
|
|
@@ -144,11 +135,8 @@ declare const Strings: kit.I18N<{
|
|
|
144
135
|
ipc_player_resolution_AUDIO: string;
|
|
145
136
|
ipc_player_current_resolution_is_equal: string;
|
|
146
137
|
ipc_player_screenshot_success_tip: string;
|
|
147
|
-
ipc_player_screenshot_multi_success_tip: string;
|
|
148
138
|
ipc_player_error_screenshot_error_tip: string;
|
|
149
139
|
ipc_player_record_success_tip: string;
|
|
150
|
-
ipc_player_record_multi_success_tip: string;
|
|
151
|
-
ipc_player_multi_capture_success_count: string;
|
|
152
140
|
ipc_player_shot_success_check: string;
|
|
153
141
|
ipc_player_record_success_check: string;
|
|
154
142
|
ipc_player_recording_now_tip: string;
|
package/lib/i18n/strings.d.ts
CHANGED
|
@@ -9,11 +9,8 @@ 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;
|
|
13
12
|
ipc_player_error_screenshot_error_tip: string;
|
|
14
13
|
ipc_player_record_success_tip: string;
|
|
15
|
-
ipc_player_record_multi_success_tip: string;
|
|
16
|
-
ipc_player_multi_capture_success_count: string;
|
|
17
14
|
ipc_player_shot_success_check: string;
|
|
18
15
|
ipc_player_record_success_check: string;
|
|
19
16
|
ipc_player_recording_now_tip: string;
|
|
@@ -54,11 +51,8 @@ declare const _default: {
|
|
|
54
51
|
ipc_player_resolution_AUDIO: string;
|
|
55
52
|
ipc_player_current_resolution_is_equal: string;
|
|
56
53
|
ipc_player_screenshot_success_tip: string;
|
|
57
|
-
ipc_player_screenshot_multi_success_tip: string;
|
|
58
54
|
ipc_player_error_screenshot_error_tip: string;
|
|
59
55
|
ipc_player_record_success_tip: string;
|
|
60
|
-
ipc_player_record_multi_success_tip: string;
|
|
61
|
-
ipc_player_multi_capture_success_count: string;
|
|
62
56
|
ipc_player_shot_success_check: string;
|
|
63
57
|
ipc_player_record_success_check: string;
|
|
64
58
|
ipc_player_recording_now_tip: string;
|
package/lib/i18n/strings.js
CHANGED
|
@@ -9,11 +9,8 @@ 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',
|
|
13
12
|
ipc_player_error_screenshot_error_tip: 'Screenshot failed. Please try again later.',
|
|
14
13
|
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
14
|
ipc_player_shot_success_check: 'View',
|
|
18
15
|
ipc_player_record_success_check: 'View',
|
|
19
16
|
ipc_player_recording_now_tip: 'Recording in progress...',
|
|
@@ -54,11 +51,8 @@ export default {
|
|
|
54
51
|
ipc_player_resolution_AUDIO: '音频模式',
|
|
55
52
|
ipc_player_current_resolution_is_equal: '已是当前清晰度',
|
|
56
53
|
ipc_player_screenshot_success_tip: '截图已保存在APP相册',
|
|
57
|
-
ipc_player_screenshot_multi_success_tip: '图片已保存至相册',
|
|
58
54
|
ipc_player_error_screenshot_error_tip: '截图失败了,请稍后再试',
|
|
59
55
|
ipc_player_record_success_tip: '录像已保存在APP相册',
|
|
60
|
-
ipc_player_record_multi_success_tip: '视频已保存至相册',
|
|
61
|
-
ipc_player_multi_capture_success_count: '共{0}个',
|
|
62
56
|
ipc_player_shot_success_check: '查看',
|
|
63
57
|
ipc_player_record_success_check: '查看',
|
|
64
58
|
ipc_player_recording_now_tip: '正在录像中...',
|
package/lib/index.d.ts
CHANGED
|
@@ -5,3 +5,7 @@ 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,4 +4,6 @@ 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 };
|
|
7
|
+
export { Widgets, Features, Utils };
|
|
8
|
+
export { PlayerRenderModeContext } from './renderer/context';
|
|
9
|
+
export { LynxPlayerAdaptersContext } from './renderer/capabilities';
|
package/lib/interface.d.ts
CHANGED
|
@@ -49,16 +49,13 @@ export type UseCtx = (options: {
|
|
|
49
49
|
initBottomRightContent?: ComponentConfig[];
|
|
50
50
|
initAbsoluteContent?: ComponentConfig[];
|
|
51
51
|
saveToAlbum?: 0 | 1;
|
|
52
|
-
multiLens?: boolean;
|
|
53
52
|
showPtzControlTip?: boolean;
|
|
54
53
|
videoSplitProtocol?: VideoSplitProtocol;
|
|
55
54
|
}) => {
|
|
56
55
|
devId: string;
|
|
57
|
-
trialBadgeViewedRef: React.MutableRefObject<boolean>;
|
|
58
56
|
brandColor: RetAtom<string>;
|
|
59
57
|
verticalMic: RetAtom<boolean>;
|
|
60
58
|
saveToAlbum: 0 | 1;
|
|
61
|
-
multiLens: boolean;
|
|
62
59
|
showPtzControlTip: boolean;
|
|
63
60
|
screenType: RetAtom<ScreenType>;
|
|
64
61
|
isVerticalFullLayout: RetAtom<boolean>;
|
|
@@ -94,8 +91,7 @@ export type UseCtx = (options: {
|
|
|
94
91
|
setRecordingDisabled: (type: boolean) => void;
|
|
95
92
|
setResolution: (type: string) => Promise<boolean>;
|
|
96
93
|
setResolutionList: (type: string[]) => void;
|
|
97
|
-
setRecording: (value: boolean, onlyUpdateAtom?: boolean) => Promise<
|
|
98
|
-
stopRecordingOnUnload: () => Promise<CaptureResult>;
|
|
94
|
+
setRecording: (value: boolean, onlyUpdateAtom?: boolean) => Promise<RecordInfoData>;
|
|
99
95
|
setIntercom: (value: boolean, onlyUpdateAtom?: boolean) => Promise<boolean>;
|
|
100
96
|
setMute: (value: boolean) => Promise<boolean>;
|
|
101
97
|
changeStreamStatus: (value: PlayerStreamStatus) => void;
|
|
@@ -126,12 +122,8 @@ export type ComponentConfig<T = ReturnType<UseCtx> & Record<string, any>> = {
|
|
|
126
122
|
absoluteContentClassName?: string;
|
|
127
123
|
absoluteContentStyle?: React.CSSProperties;
|
|
128
124
|
absoluteNoCoverView?: boolean;
|
|
129
|
-
renderWhen?: (state: ComponentRenderState) => boolean;
|
|
130
125
|
hidden?: boolean;
|
|
131
126
|
};
|
|
132
|
-
export type ComponentRenderState = {
|
|
133
|
-
playState: PlayState;
|
|
134
|
-
};
|
|
135
127
|
export type ComponentConfigProps = {
|
|
136
128
|
IPCPlayerContext: IpcContext;
|
|
137
129
|
} & ReturnType<UseCtx>;
|
|
@@ -139,17 +131,11 @@ export type PlayStatusData = {
|
|
|
139
131
|
playState: PlayState;
|
|
140
132
|
playCode: number;
|
|
141
133
|
};
|
|
142
|
-
export type
|
|
143
|
-
index?: number;
|
|
134
|
+
export type RecordInfoData = boolean | {
|
|
144
135
|
tempImagePath: string;
|
|
145
136
|
filePath: string;
|
|
146
|
-
thumbPath
|
|
147
|
-
width?: number;
|
|
148
|
-
height?: number;
|
|
149
|
-
data?: string;
|
|
137
|
+
thumbPath: string;
|
|
150
138
|
};
|
|
151
|
-
export type CaptureResult = boolean | CaptureFileInfo;
|
|
152
|
-
export type RecordInfoData = CaptureResult;
|
|
153
139
|
/**
|
|
154
140
|
* 多目屏幕模式
|
|
155
141
|
*/
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export type LynxPlayerAdapters = Partial<Record<'zoomTurntable' | 'ptzZoom' | 'directionControl', React.ComponentType<any>>>;
|
|
3
|
+
export declare const LynxPlayerAdaptersContext: React.Context<Partial<Record<"zoomTurntable" | "ptzZoom" | "directionControl", React.ComponentType<any>>>>;
|
|
4
|
+
/** Never mount a WebView-only RJS renderer in the Lynx tree. */
|
|
5
|
+
export declare function withPlayerRenderer<P>(capability: keyof LynxPlayerAdapters, WebViewComponent: React.ComponentType<P>, LynxComponent?: React.ComponentType<P>): {
|
|
6
|
+
(props: P): React.JSX.Element;
|
|
7
|
+
displayName: string;
|
|
8
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React, { createContext, useContext } from 'react';
|
|
2
|
+
import { usePlayerRenderMode } from './context';
|
|
3
|
+
export const LynxPlayerAdaptersContext = /*#__PURE__*/createContext({});
|
|
4
|
+
|
|
5
|
+
/** Never mount a WebView-only RJS renderer in the Lynx tree. */
|
|
6
|
+
export function withPlayerRenderer(capability, WebViewComponent, LynxComponent) {
|
|
7
|
+
const RendererComponent = props => {
|
|
8
|
+
const mode = usePlayerRenderMode();
|
|
9
|
+
const adapters = useContext(LynxPlayerAdaptersContext);
|
|
10
|
+
if (mode !== 'lynx') return /*#__PURE__*/React.createElement(WebViewComponent, props);
|
|
11
|
+
const Adapter = adapters[capability] || LynxComponent;
|
|
12
|
+
if (!Adapter) {
|
|
13
|
+
throw new Error(`IPC_LYNX_CAPABILITY_MISSING:${capability}. Supply a supported Native/WebView adapter before enabling this widget.`);
|
|
14
|
+
}
|
|
15
|
+
return /*#__PURE__*/React.createElement(Adapter, props);
|
|
16
|
+
};
|
|
17
|
+
RendererComponent.displayName = `PlayerRenderer(${String(capability)})`;
|
|
18
|
+
return RendererComponent;
|
|
19
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const PlayerControlVisibilityContext: import("react").Context<boolean | undefined>;
|
|
3
|
+
export type PlayerRenderMode = 'webview' | 'lynx';
|
|
4
|
+
export declare const PlayerRenderModeContext: import("react").Context<PlayerRenderMode>;
|
|
5
|
+
export declare const usePlayerRenderMode: () => PlayerRenderMode;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { createContext, useContext } from 'react';
|
|
2
|
+
|
|
3
|
+
// Scoped to the control bars, not absolute widgets or the standalone intercom.
|
|
4
|
+
export const PlayerControlVisibilityContext = /*#__PURE__*/createContext(undefined);
|
|
5
|
+
export const PlayerRenderModeContext = /*#__PURE__*/createContext('webview');
|
|
6
|
+
export const usePlayerRenderMode = () => useContext(PlayerRenderModeContext);
|