@ray-js/ipc-player-integration 0.0.31 → 0.0.33-beta.1
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/lib/ctx/ctx.composition.js +7 -1
- package/lib/interface.d.ts +1 -1
- package/lib/ui/constant.d.ts +2 -0
- package/lib/ui/constant.js +2 -0
- package/lib/ui/ui.d.ts +1 -0
- package/lib/ui/ui.js +3 -1
- package/lib/widgets/floodlight/floodlight.d.ts +4 -0
- package/lib/widgets/floodlight/floodlight.js +55 -0
- package/lib/widgets/floodlight/floodlight.less +4 -0
- package/lib/widgets/floodlight/index.d.ts +1 -0
- package/lib/widgets/floodlight/index.js +1 -0
- package/lib/widgets/index.d.ts +2 -0
- package/lib/widgets/index.js +2 -0
- package/lib/widgets/siren/index.d.ts +1 -0
- package/lib/widgets/siren/index.js +1 -0
- package/lib/widgets/siren/siren.d.ts +4 -0
- package/lib/widgets/siren/siren.js +55 -0
- package/lib/widgets/siren/siren.less +4 -0
- package/package.json +3 -3
|
@@ -4,7 +4,7 @@ const _excluded = ["title", "duration"];
|
|
|
4
4
|
import { getCameraConfigInfo } from '@ray-js/ray-ipc-utils';
|
|
5
5
|
import { IntercomMode, MuteMode, ClarityType } from '@ray-js/ray-ipc-utils/lib/interface';
|
|
6
6
|
import { createUseCtx } from './ctx';
|
|
7
|
-
import { FullSmallIntercom, VerticalSmallIntercom, BatteryFull, Battery, Screenshot, TempHumidity, Signal4G, RecordVideo, FullScreen, VideoBitKBP, Muted, Resolution, Ptz, MultiPtz, TileTip, PtzMoveableTip, LandscapeTip, TileActions, MoveablePtzControl, SwitchLayout, ToggleVerticalFull, RealTimeMagnification } from '../widgets';
|
|
7
|
+
import { FullSmallIntercom, VerticalSmallIntercom, BatteryFull, Battery, Screenshot, TempHumidity, Signal4G, RecordVideo, FullScreen, VideoBitKBP, Muted, Floodlight, Siren, Resolution, Ptz, MultiPtz, TileTip, PtzMoveableTip, LandscapeTip, TileActions, MoveablePtzControl, SwitchLayout, ToggleVerticalFull, RealTimeMagnification } from '../widgets';
|
|
8
8
|
import { authorizeStatus } from '../utils/authorize';
|
|
9
9
|
import { landscapeTipId, moveablePtzControlId, multiPtzId, ptzMoveableTipId, tileActionsId, tileTipId } from '../ui/constant';
|
|
10
10
|
import { multiPrefix } from '../widgets/multiCamera/constants';
|
|
@@ -41,6 +41,12 @@ export const defaultBottomLeftContent = [{
|
|
|
41
41
|
}, {
|
|
42
42
|
id: 'Muted',
|
|
43
43
|
content: Muted
|
|
44
|
+
}, {
|
|
45
|
+
id: 'Floodlight',
|
|
46
|
+
content: Floodlight
|
|
47
|
+
}, {
|
|
48
|
+
id: 'Siren',
|
|
49
|
+
content: Siren
|
|
44
50
|
}, {
|
|
45
51
|
id: 'VerticalSmallIntercom',
|
|
46
52
|
content: VerticalSmallIntercom
|
package/lib/interface.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export type IpcContext = {
|
|
|
11
11
|
};
|
|
12
12
|
export type RetAtom<T> = PrimitiveAtom<T> & WithInitialValue<T>;
|
|
13
13
|
export type ScreenType = 'full' | 'vertical';
|
|
14
|
-
export type WidgetId = 'BatteryFull' | 'TempHumidity' | 'VideoBitKBP' | 'FullSmallIntercom' | 'Screenshot' | 'RecordVideo' | 'Muted' | 'VerticalSmallIntercom' | 'Ptz' | 'Resolution' | 'FullScreen' | 'moveablePtzControlId';
|
|
14
|
+
export type WidgetId = 'BatteryFull' | 'TempHumidity' | 'VideoBitKBP' | 'FullSmallIntercom' | 'Screenshot' | 'RecordVideo' | 'Muted' | 'Floodlight' | 'Siren' | 'VerticalSmallIntercom' | 'Ptz' | 'Resolution' | 'FullScreen' | 'moveablePtzControlId';
|
|
15
15
|
export declare const enum PlayerStreamStatus {
|
|
16
16
|
UnknownException = -1000,
|
|
17
17
|
ConnectSuccess = 1001,
|
package/lib/ui/constant.d.ts
CHANGED
|
@@ -28,6 +28,8 @@ export declare const widgetLabs: {
|
|
|
28
28
|
readonly RESOLUTION: "Resolution";
|
|
29
29
|
readonly FULL_RESOLUTION_CONTROL: "FullResolutionControl";
|
|
30
30
|
readonly MUTED: "Muted";
|
|
31
|
+
readonly FLOODLIGHT: "Floodlight";
|
|
32
|
+
readonly SIREN: "Siren";
|
|
31
33
|
readonly PTZ: "Ptz";
|
|
32
34
|
readonly PTZ_CONTROL_TIP: "PtzControlTip";
|
|
33
35
|
readonly MOVE_INTERACTIVE_CONTROL: "MoveInteractiveControl";
|
package/lib/ui/constant.js
CHANGED
|
@@ -29,6 +29,8 @@ export const widgetLabs = {
|
|
|
29
29
|
RESOLUTION: 'Resolution',
|
|
30
30
|
FULL_RESOLUTION_CONTROL: 'FullResolutionControl',
|
|
31
31
|
MUTED: 'Muted',
|
|
32
|
+
FLOODLIGHT: 'Floodlight',
|
|
33
|
+
SIREN: 'Siren',
|
|
32
34
|
PTZ: 'Ptz',
|
|
33
35
|
PTZ_CONTROL_TIP: 'PtzControlTip',
|
|
34
36
|
MOVE_INTERACTIVE_CONTROL: 'MoveInteractiveControl',
|
package/lib/ui/ui.d.ts
CHANGED
package/lib/ui/ui.js
CHANGED
|
@@ -67,7 +67,8 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
|
|
|
67
67
|
limitFlow = false,
|
|
68
68
|
showFlowLowTip = false,
|
|
69
69
|
extend = {},
|
|
70
|
-
refreshElement = false
|
|
70
|
+
refreshElement = false,
|
|
71
|
+
autoWakeUp = false
|
|
71
72
|
} = props;
|
|
72
73
|
const {
|
|
73
74
|
event
|
|
@@ -916,6 +917,7 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
|
|
|
916
917
|
playerRoute: playerRoute,
|
|
917
918
|
defaultAutoPlay: defaultAutoPlay,
|
|
918
919
|
limitFlow: limitFlow,
|
|
920
|
+
autoWakeUp: autoWakeUp,
|
|
919
921
|
extend: _objectSpread(_objectSpread({
|
|
920
922
|
backgroundColor: '#262626'
|
|
921
923
|
}, instance.multiCameraCtx.extendProps), extend)
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { View, Text } from '@ray-js/ray';
|
|
2
|
+
import React, { useContext } from 'react';
|
|
3
|
+
import clsx from 'clsx';
|
|
4
|
+
import { useDpState } from '../../hooks';
|
|
5
|
+
import { useStore } from '../../ctx/store';
|
|
6
|
+
import { UIEventContext } from '../../ui/context';
|
|
7
|
+
import { widgetLabs, widgetClick, pauseTimeToHideAllComponent, startTimeToHideAllComponent } from '../../ui/constant';
|
|
8
|
+
import './floodlight.less';
|
|
9
|
+
const FLOODLIGHT_SWITCH_DP_CODE = 'floodlight_switch';
|
|
10
|
+
export const Floodlight = props => {
|
|
11
|
+
const {
|
|
12
|
+
devId,
|
|
13
|
+
screenType: screenTypeAtom,
|
|
14
|
+
className,
|
|
15
|
+
event: propsEvent
|
|
16
|
+
} = props;
|
|
17
|
+
const {
|
|
18
|
+
event: ctxEvent
|
|
19
|
+
} = useContext(UIEventContext);
|
|
20
|
+
const event = propsEvent !== null && propsEvent !== void 0 ? propsEvent : ctxEvent;
|
|
21
|
+
const {
|
|
22
|
+
screenType,
|
|
23
|
+
brandColor
|
|
24
|
+
} = useStore({
|
|
25
|
+
screenType: screenTypeAtom,
|
|
26
|
+
brandColor: props.brandColor
|
|
27
|
+
});
|
|
28
|
+
const [state, dpSchema, sendDp] = useDpState({
|
|
29
|
+
devId,
|
|
30
|
+
dpCodes: [FLOODLIGHT_SWITCH_DP_CODE]
|
|
31
|
+
});
|
|
32
|
+
const supported = !!(dpSchema !== null && dpSchema !== void 0 && dpSchema[FLOODLIGHT_SWITCH_DP_CODE]);
|
|
33
|
+
const enabled = !!state[FLOODLIGHT_SWITCH_DP_CODE];
|
|
34
|
+
if (screenType !== 'full' || !supported) {
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
38
|
+
className: clsx(className),
|
|
39
|
+
onClick: () => {
|
|
40
|
+
event.emit(widgetClick, {
|
|
41
|
+
widgetId: widgetLabs.FLOODLIGHT
|
|
42
|
+
});
|
|
43
|
+
event.emit(pauseTimeToHideAllComponent);
|
|
44
|
+
sendDp({
|
|
45
|
+
[FLOODLIGHT_SWITCH_DP_CODE]: !enabled
|
|
46
|
+
});
|
|
47
|
+
event.emit(startTimeToHideAllComponent);
|
|
48
|
+
}
|
|
49
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
50
|
+
className: clsx('icon-panel', 'icon-panel-deng', 'ipc-player-plugin-floodlight-text-icon'),
|
|
51
|
+
style: {
|
|
52
|
+
color: enabled ? brandColor : undefined
|
|
53
|
+
}
|
|
54
|
+
}));
|
|
55
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './floodlight';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './floodlight';
|
package/lib/widgets/index.d.ts
CHANGED
|
@@ -8,6 +8,8 @@ export * from './fullScreen';
|
|
|
8
8
|
export * from './videoBitKBP';
|
|
9
9
|
export * from './voiceIntercom';
|
|
10
10
|
export * from './muted';
|
|
11
|
+
export * from './floodlight';
|
|
12
|
+
export * from './siren';
|
|
11
13
|
export * from './ptz';
|
|
12
14
|
export * from './resolution';
|
|
13
15
|
export * from './fullSmallIntercom';
|
package/lib/widgets/index.js
CHANGED
|
@@ -8,6 +8,8 @@ export * from './fullScreen';
|
|
|
8
8
|
export * from './videoBitKBP';
|
|
9
9
|
export * from './voiceIntercom';
|
|
10
10
|
export * from './muted';
|
|
11
|
+
export * from './floodlight';
|
|
12
|
+
export * from './siren';
|
|
11
13
|
export * from './ptz';
|
|
12
14
|
export * from './resolution';
|
|
13
15
|
export * from './fullSmallIntercom';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './siren';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './siren';
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { View, Text } from '@ray-js/ray';
|
|
2
|
+
import React, { useContext } from 'react';
|
|
3
|
+
import clsx from 'clsx';
|
|
4
|
+
import { useDpState } from '../../hooks';
|
|
5
|
+
import { useStore } from '../../ctx/store';
|
|
6
|
+
import { UIEventContext } from '../../ui/context';
|
|
7
|
+
import { widgetLabs, widgetClick, pauseTimeToHideAllComponent, startTimeToHideAllComponent } from '../../ui/constant';
|
|
8
|
+
import './siren.less';
|
|
9
|
+
const SIREN_SWITCH_DP_CODE = 'siren_switch';
|
|
10
|
+
export const Siren = props => {
|
|
11
|
+
const {
|
|
12
|
+
devId,
|
|
13
|
+
screenType: screenTypeAtom,
|
|
14
|
+
className,
|
|
15
|
+
event: propsEvent
|
|
16
|
+
} = props;
|
|
17
|
+
const {
|
|
18
|
+
event: ctxEvent
|
|
19
|
+
} = useContext(UIEventContext);
|
|
20
|
+
const event = propsEvent !== null && propsEvent !== void 0 ? propsEvent : ctxEvent;
|
|
21
|
+
const {
|
|
22
|
+
screenType,
|
|
23
|
+
brandColor
|
|
24
|
+
} = useStore({
|
|
25
|
+
screenType: screenTypeAtom,
|
|
26
|
+
brandColor: props.brandColor
|
|
27
|
+
});
|
|
28
|
+
const [state, dpSchema, sendDp] = useDpState({
|
|
29
|
+
devId,
|
|
30
|
+
dpCodes: [SIREN_SWITCH_DP_CODE]
|
|
31
|
+
});
|
|
32
|
+
const supported = !!(dpSchema !== null && dpSchema !== void 0 && dpSchema[SIREN_SWITCH_DP_CODE]);
|
|
33
|
+
const enabled = !!state[SIREN_SWITCH_DP_CODE];
|
|
34
|
+
if (screenType !== 'full' || !supported) {
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
38
|
+
className: clsx(className),
|
|
39
|
+
onClick: () => {
|
|
40
|
+
event.emit(widgetClick, {
|
|
41
|
+
widgetId: widgetLabs.SIREN
|
|
42
|
+
});
|
|
43
|
+
event.emit(pauseTimeToHideAllComponent);
|
|
44
|
+
sendDp({
|
|
45
|
+
[SIREN_SWITCH_DP_CODE]: !enabled
|
|
46
|
+
});
|
|
47
|
+
event.emit(startTimeToHideAllComponent);
|
|
48
|
+
}
|
|
49
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
50
|
+
className: clsx('icon-panel', 'icon-panel-jingdi', 'ipc-player-plugin-siren-text-icon'),
|
|
51
|
+
style: {
|
|
52
|
+
color: enabled ? brandColor : undefined
|
|
53
|
+
}
|
|
54
|
+
}));
|
|
55
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ray-js/ipc-player-integration",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.33-beta.1",
|
|
4
4
|
"description": "IPC 融合播放器",
|
|
5
5
|
"main": "lib/index",
|
|
6
6
|
"files": [
|
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@ray-js/direction-control": "^0.0.8",
|
|
39
39
|
"@ray-js/ipc-ptz-zoom": "^0.0.3",
|
|
40
|
-
"@ray-js/ray-ipc-player": "
|
|
41
|
-
"@ray-js/ray-ipc-utils": "^1.1.
|
|
40
|
+
"@ray-js/ray-ipc-player": "2.1.1-beta.1",
|
|
41
|
+
"@ray-js/ray-ipc-utils": "^1.1.15",
|
|
42
42
|
"@ray-js/svg": "0.2.0",
|
|
43
43
|
"clsx": "^1.2.1",
|
|
44
44
|
"color": "^5.0.2",
|