@ray-js/ipc-player-integration 0.0.67-beta.1 → 0.0.68-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 -48
- 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 -18
- 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-manifest.json +9 -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/overlay.d.ts +4 -0
- package/lib/renderer/overlay.js +6 -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 +122 -56
- package/lib/ui/bottomRightContent.js +10 -5
- package/lib/ui/scrollHintArrow.d.ts +23 -0
- package/lib/ui/scrollHintArrow.js +83 -0
- package/lib/ui/topLeftContent.js +4 -2
- package/lib/ui/topRightContent.js +4 -2
- package/lib/ui/ui.d.ts +5 -0
- package/lib/ui/ui.js +93 -100
- 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/captureToast/captureToast.d.ts +9 -0
- package/lib/widgets/captureToast/captureToast.js +73 -0
- package/lib/widgets/floodlight/floodlight.js +2 -1
- package/lib/widgets/flowLowTip/flowLowTip.js +2 -1
- package/lib/widgets/fullScreen/fullScreen.js +18 -4
- 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 +16 -5
- package/lib/widgets/moveInteractiveControl/moveInteractiveControlUI.less +24 -4
- package/lib/widgets/multiCamera/index.less +0 -1
- package/lib/widgets/multiCamera/landscapeTip.js +5 -2
- package/lib/widgets/multiCamera/moveablePtzControl.js +9 -7
- package/lib/widgets/multiCamera/multiPtz.js +3 -2
- package/lib/widgets/multiCamera/ptzMoveableTip.js +5 -2
- 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 +5 -2
- 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 +4 -3
- package/lib/widgets/ptzControlTip/ptzControlTip.js +9 -4
- package/lib/widgets/ptzControlTip/ptzControlTip.less +6 -0
- package/lib/widgets/realTimeMagnification/realTimeMagnification.js +2 -1
- package/lib/widgets/recordVideo/recordVideo.js +32 -178
- package/lib/widgets/recordVideo/recordVideo.less +74 -17
- package/lib/widgets/recordVideo/recordVideo.test.js +169 -3
- package/lib/widgets/recordVideo/recordVideoTimer.d.ts +3 -0
- package/lib/widgets/recordVideo/recordVideoTimer.js +26 -0
- package/lib/widgets/resolution/fullResolutionControl.js +29 -19
- package/lib/widgets/resolution/resolution.js +3 -2
- package/lib/widgets/screenshot/screenshot.js +35 -125
- package/lib/widgets/screenshot/screenshot.less +40 -1
- package/lib/widgets/screenshot/screenshot.test.js +108 -113
- 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 +3 -21
- 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 +5 -3
- package/lib/widgets/zoomTurntable/zoomTurntableDock.js +4 -4
- package/lib/widgets/zoomTurntable/zoomTurntableEntry.js +32 -19
- package/lib/widgets/zoomTurntable/zoomTurntableTip.js +24 -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/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,14 +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
|
-
const trialBadgeRtidRef = useRef(new Map());
|
|
51
47
|
// 全屏、竖屏
|
|
52
48
|
const [screenType, setScreenType] = useAtom('vertical');
|
|
53
49
|
const IPCPlayerInstance = useRef();
|
|
@@ -63,7 +59,6 @@ export const createUseCtx = _ref => {
|
|
|
63
59
|
|
|
64
60
|
// 录像中
|
|
65
61
|
const [recording] = useAtom(false);
|
|
66
|
-
const recordingMultiLensRef = useRef(false);
|
|
67
62
|
|
|
68
63
|
// 录像是否不可点击
|
|
69
64
|
const [recordingDisabled, setRecordingDisabled] = useAtom(false);
|
|
@@ -316,30 +311,6 @@ export const createUseCtx = _ref => {
|
|
|
316
311
|
});
|
|
317
312
|
});
|
|
318
313
|
};
|
|
319
|
-
const stopRecording = showError => {
|
|
320
|
-
return new Promise((resolve, reject) => {
|
|
321
|
-
IPCPlayerInstance.current.stopRecord({
|
|
322
|
-
saveToAlbum,
|
|
323
|
-
success: res => {
|
|
324
|
-
recordingMultiLensRef.current = false;
|
|
325
|
-
updateAtom(recording, false);
|
|
326
|
-
resolve(res);
|
|
327
|
-
},
|
|
328
|
-
fail: err => {
|
|
329
|
-
recordingMultiLensRef.current = false;
|
|
330
|
-
updateAtom(recording, false);
|
|
331
|
-
reject(err);
|
|
332
|
-
if (showError) {
|
|
333
|
-
const errObj = err.innerError || err || {};
|
|
334
|
-
const errMsg = errObj.errorMsg || Strings.getLang('ipc_player_stop_recording_err');
|
|
335
|
-
toast({
|
|
336
|
-
title: errMsg
|
|
337
|
-
});
|
|
338
|
-
}
|
|
339
|
-
}
|
|
340
|
-
});
|
|
341
|
-
});
|
|
342
|
-
};
|
|
343
314
|
const multiCameraCtx = useMultiCameraCtx({
|
|
344
315
|
devId,
|
|
345
316
|
IPCPlayerInstance: IPCPlayerInstance.current,
|
|
@@ -347,12 +318,9 @@ export const createUseCtx = _ref => {
|
|
|
347
318
|
});
|
|
348
319
|
return {
|
|
349
320
|
devId,
|
|
350
|
-
trialBadgeViewedRef,
|
|
351
|
-
trialBadgeRtidRef,
|
|
352
321
|
brandColor,
|
|
353
322
|
verticalMic,
|
|
354
323
|
saveToAlbum,
|
|
355
|
-
multiLens,
|
|
356
324
|
screenType,
|
|
357
325
|
isVerticalFullLayout,
|
|
358
326
|
setIsVerticalFullLayout,
|
|
@@ -497,25 +465,44 @@ export const createUseCtx = _ref => {
|
|
|
497
465
|
eventRef.current.emit(changeIgnoreHideStopPreview, false);
|
|
498
466
|
return false;
|
|
499
467
|
}
|
|
500
|
-
if (
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
468
|
+
if (target) {
|
|
469
|
+
const granted = await ensureAlbumPermission();
|
|
470
|
+
eventRef.current.emit(changeIgnoreHideStopPreview, false);
|
|
471
|
+
if (!granted) return false;
|
|
472
|
+
}
|
|
504
473
|
return new Promise((resolve, reject) => {
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
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
|
+
}
|
|
516
504
|
});
|
|
517
505
|
},
|
|
518
|
-
stopRecordingOnUnload: () => stopRecording(false),
|
|
519
506
|
setRecordingDisabled,
|
|
520
507
|
setScreenType,
|
|
521
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,17 +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
|
-
trialBadgeRtidRef: React.MutableRefObject<Map<string, string>>;
|
|
59
56
|
brandColor: RetAtom<string>;
|
|
60
57
|
verticalMic: RetAtom<boolean>;
|
|
61
58
|
saveToAlbum: 0 | 1;
|
|
62
|
-
multiLens: boolean;
|
|
63
59
|
showPtzControlTip: boolean;
|
|
64
60
|
screenType: RetAtom<ScreenType>;
|
|
65
61
|
isVerticalFullLayout: RetAtom<boolean>;
|
|
@@ -95,8 +91,7 @@ export type UseCtx = (options: {
|
|
|
95
91
|
setRecordingDisabled: (type: boolean) => void;
|
|
96
92
|
setResolution: (type: string) => Promise<boolean>;
|
|
97
93
|
setResolutionList: (type: string[]) => void;
|
|
98
|
-
setRecording: (value: boolean, onlyUpdateAtom?: boolean) => Promise<
|
|
99
|
-
stopRecordingOnUnload: () => Promise<CaptureResult>;
|
|
94
|
+
setRecording: (value: boolean, onlyUpdateAtom?: boolean) => Promise<RecordInfoData>;
|
|
100
95
|
setIntercom: (value: boolean, onlyUpdateAtom?: boolean) => Promise<boolean>;
|
|
101
96
|
setMute: (value: boolean) => Promise<boolean>;
|
|
102
97
|
changeStreamStatus: (value: PlayerStreamStatus) => void;
|
|
@@ -127,12 +122,8 @@ export type ComponentConfig<T = ReturnType<UseCtx> & Record<string, any>> = {
|
|
|
127
122
|
absoluteContentClassName?: string;
|
|
128
123
|
absoluteContentStyle?: React.CSSProperties;
|
|
129
124
|
absoluteNoCoverView?: boolean;
|
|
130
|
-
renderWhen?: (state: ComponentRenderState) => boolean;
|
|
131
125
|
hidden?: boolean;
|
|
132
126
|
};
|
|
133
|
-
export type ComponentRenderState = {
|
|
134
|
-
playState: PlayState;
|
|
135
|
-
};
|
|
136
127
|
export type ComponentConfigProps = {
|
|
137
128
|
IPCPlayerContext: IpcContext;
|
|
138
129
|
} & ReturnType<UseCtx>;
|
|
@@ -140,17 +131,11 @@ export type PlayStatusData = {
|
|
|
140
131
|
playState: PlayState;
|
|
141
132
|
playCode: number;
|
|
142
133
|
};
|
|
143
|
-
export type
|
|
144
|
-
index?: number;
|
|
134
|
+
export type RecordInfoData = boolean | {
|
|
145
135
|
tempImagePath: string;
|
|
146
136
|
filePath: string;
|
|
147
|
-
thumbPath
|
|
148
|
-
width?: number;
|
|
149
|
-
height?: number;
|
|
150
|
-
data?: string;
|
|
137
|
+
thumbPath: string;
|
|
151
138
|
};
|
|
152
|
-
export type CaptureResult = boolean | CaptureFileInfo;
|
|
153
|
-
export type RecordInfoData = CaptureResult;
|
|
154
139
|
/**
|
|
155
140
|
* 多目屏幕模式
|
|
156
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);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"family": "ipc-player-lynx-ttf",
|
|
3
|
+
"sourceFile": "iconfont/iconfont.ttf",
|
|
4
|
+
"sourceSha256": "ab94ffc0c528e9145307dfa99f48e2bf388576ca62f934a6c267122fcc30c626",
|
|
5
|
+
"sha256": "343e9482a1055c84139d2f3f489d27dff0b4d37604b06ee68b986d8bec85b149",
|
|
6
|
+
"container": "ttf",
|
|
7
|
+
"glyphAlignment": "centered-v1",
|
|
8
|
+
"glyphs": 246
|
|
9
|
+
}
|