@ray-js/ray-ipc-player 2.0.4-beta-1 → 2.0.5-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/README-zh_CN.md +102 -17
- package/README.md +21 -38
- package/package.json +2 -2
package/README-zh_CN.md
CHANGED
|
@@ -6,30 +6,114 @@
|
|
|
6
6
|
|
|
7
7
|
```ts
|
|
8
8
|
export type IProps = {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
9
|
+
/**
|
|
10
|
+
* @description.en devId
|
|
11
|
+
* @description.zh 设备id
|
|
12
|
+
* @default ""
|
|
13
|
+
*/
|
|
14
|
+
devId: string;
|
|
15
|
+
/**
|
|
16
|
+
* @description.en onlineStatus
|
|
17
|
+
* @description.zh 设备是否在线
|
|
18
|
+
* @default true
|
|
19
|
+
*/
|
|
20
|
+
onlineStatus: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* @description.en privateState
|
|
23
|
+
* @description.zh 隐私模式
|
|
24
|
+
* @default false
|
|
25
|
+
*/
|
|
26
|
+
privateState?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* @description.en defaultMute
|
|
29
|
+
* @description.zh 默认静音
|
|
30
|
+
* @default true
|
|
31
|
+
*/
|
|
32
|
+
defaultMute?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* @description.en clarity
|
|
35
|
+
* @description.zh 清晰度 normal:标清,hd:高清
|
|
36
|
+
* @default "normal"
|
|
37
|
+
*/
|
|
38
|
+
clarity?: 'normal' | 'hd';
|
|
39
|
+
/**
|
|
40
|
+
* @description.en updateLayout
|
|
41
|
+
* @description.zh 外层父节点样式变化,播放器监听不到,需要主动触发播放器视图更新,每次需要设置不同的字符串值
|
|
42
|
+
* @default ""
|
|
43
|
+
*/
|
|
44
|
+
updateLayout?: any;
|
|
45
|
+
/**
|
|
46
|
+
* @description.en onChangeStreamStatus
|
|
47
|
+
* @description.zh 通知视频流状态发生变化
|
|
48
|
+
* @default (data) => void
|
|
49
|
+
*/
|
|
50
|
+
onChangeStreamStatus?: (data) => void;
|
|
51
|
+
/**
|
|
52
|
+
* @description.en onCtx
|
|
53
|
+
* @description.zh 获取ipcPlayer实例ctx以及重试方法retry
|
|
54
|
+
* @default (playerRef) => void
|
|
55
|
+
*/
|
|
56
|
+
onCtx?: (playerRef) => void;
|
|
57
|
+
/**
|
|
58
|
+
* @description.en onInitPreview
|
|
59
|
+
* @description.zh 初始化预览成功通知
|
|
60
|
+
* @default (devId) => void
|
|
61
|
+
*/
|
|
62
|
+
onInitPreview?: (data) => void;
|
|
63
|
+
/**
|
|
64
|
+
* @description.en onPlayerTap
|
|
65
|
+
* @description.zh 播放器区域点击事件
|
|
66
|
+
* @default (devId) => void
|
|
67
|
+
*/
|
|
68
|
+
onPlayerTap?: (data) => void;
|
|
69
|
+
/**
|
|
70
|
+
* @description.en scalable
|
|
71
|
+
* @description.zh 是否可缩放
|
|
72
|
+
* @default true
|
|
73
|
+
*/
|
|
74
|
+
scalable?: boolean;
|
|
75
|
+
/**
|
|
76
|
+
* @description.en scaleMultiple
|
|
77
|
+
* @description.zh 缩放比例
|
|
78
|
+
* @default 0
|
|
79
|
+
*/
|
|
80
|
+
scaleMultiple?: number;
|
|
81
|
+
/**
|
|
82
|
+
* @description.en rotateZ
|
|
83
|
+
* @description.zh 摄像头旋转角度
|
|
84
|
+
* @default 0
|
|
85
|
+
*/
|
|
86
|
+
rotateZ?: number;
|
|
87
|
+
/**
|
|
88
|
+
* @description.en ptzControllable
|
|
89
|
+
* @description.zh 是否开启视频区云平台控制
|
|
90
|
+
* @default true
|
|
91
|
+
*/
|
|
92
|
+
ptzControllable?: boolean;
|
|
93
|
+
/**
|
|
94
|
+
* @description.en playerStyle
|
|
95
|
+
* @description.zh 播放器样式
|
|
96
|
+
* @default {}
|
|
97
|
+
*/
|
|
23
98
|
playerStyle?: {
|
|
24
|
-
// 播放器样式
|
|
25
99
|
bgColor?: string; // 背景底色
|
|
26
100
|
borderRadius?: number | string; // 边框圆角
|
|
27
101
|
borderStyle?: 'solid' | 'dashed'; // 边框样式
|
|
28
102
|
borderColor?: string; // 边框颜色
|
|
29
103
|
borderWidth?: string | number; // 边框宽度
|
|
30
104
|
};
|
|
31
|
-
|
|
32
|
-
|
|
105
|
+
/**
|
|
106
|
+
* @description.en loadText
|
|
107
|
+
* @description.zh 加载过程中的文案,可结合onChangeStreamStatus事件做文案配置
|
|
108
|
+
* @default "正在获取视频流..."
|
|
109
|
+
*/
|
|
110
|
+
loadText?: string;
|
|
111
|
+
/**
|
|
112
|
+
* @description.en extend
|
|
113
|
+
* @description.zh 扩展属性
|
|
114
|
+
* @default {}
|
|
115
|
+
*/
|
|
116
|
+
extend?: Record<string, any>;
|
|
33
117
|
};
|
|
34
118
|
```
|
|
35
119
|
|
|
@@ -99,6 +183,7 @@ const PlayerDemo = () => {
|
|
|
99
183
|
<View style={{ width: playerWidth }}>
|
|
100
184
|
<Player
|
|
101
185
|
devId={devId}
|
|
186
|
+
onlineStatus={true}
|
|
102
187
|
onCtx={onCtx}
|
|
103
188
|
updateLayout={updateLayout}
|
|
104
189
|
extend={{
|
package/README.md
CHANGED
|
@@ -8,109 +8,92 @@ Encapsulates basic ipc-player capabilities, including loading, device exception,
|
|
|
8
8
|
export type IProps = {
|
|
9
9
|
/**
|
|
10
10
|
* @description.en devId
|
|
11
|
-
* @description.zh 设备id
|
|
12
11
|
* @default ""
|
|
13
12
|
*/
|
|
14
13
|
devId: string;
|
|
15
14
|
/**
|
|
16
|
-
* @description.en
|
|
17
|
-
* @description.zh 设备是否在线
|
|
15
|
+
* @description.en Whether the device is online
|
|
18
16
|
* @default true
|
|
19
17
|
*/
|
|
20
18
|
onlineStatus: boolean;
|
|
21
19
|
/**
|
|
22
|
-
* @description.en
|
|
23
|
-
* @description.zh 隐私模式
|
|
20
|
+
* @description.en Privacy mode
|
|
24
21
|
* @default false
|
|
25
22
|
*/
|
|
26
23
|
privateState?: boolean;
|
|
27
24
|
/**
|
|
28
25
|
* @description.en defaultMute
|
|
29
|
-
* @description.zh 默认静音
|
|
30
26
|
* @default true
|
|
31
27
|
*/
|
|
32
28
|
defaultMute?: boolean;
|
|
33
29
|
/**
|
|
34
30
|
* @description.en clarity
|
|
35
|
-
* @description.zh 清晰度 normal:标清,hd:高清
|
|
36
31
|
* @default "normal"
|
|
37
32
|
*/
|
|
38
33
|
clarity?: 'normal' | 'hd';
|
|
39
34
|
/**
|
|
40
|
-
* @description.en
|
|
41
|
-
* @description.zh 外层父节点样式变化,播放器监听不到,需要主动触发播放器视图更新,每次需要设置不同的字符串值
|
|
35
|
+
* @description.en Notifying the view of updates, each time you need to set a different value
|
|
42
36
|
* @default ""
|
|
43
37
|
*/
|
|
44
38
|
updateLayout?: any;
|
|
45
39
|
/**
|
|
46
|
-
* @description.en
|
|
47
|
-
* @description.zh 通知视频流状态发生变化
|
|
40
|
+
* @description.en Notifies the video stream that the state has changed
|
|
48
41
|
* @default (data) => void
|
|
49
42
|
*/
|
|
50
43
|
onChangeStreamStatus?: (data) => void;
|
|
51
44
|
/**
|
|
52
|
-
* @description.en
|
|
53
|
-
* @description.zh 获取ipcPlayer实例ctx以及重试方法retry
|
|
45
|
+
* @description.en Obtain ipcPlayer instance ctx and retry method Retry
|
|
54
46
|
* @default (playerRef) => void
|
|
55
47
|
*/
|
|
56
48
|
onCtx?: (playerRef) => void;
|
|
57
49
|
/**
|
|
58
|
-
* @description.en
|
|
59
|
-
* @description.zh 初始化预览成功通知
|
|
50
|
+
* @description.en The initialization preview is successful
|
|
60
51
|
* @default (devId) => void
|
|
61
52
|
*/
|
|
62
53
|
onInitPreview?: (data) => void;
|
|
63
54
|
/**
|
|
64
|
-
* @description.en
|
|
65
|
-
* @description.zh 播放器区域点击事件
|
|
55
|
+
* @description.en Click events in the player area
|
|
66
56
|
* @default (devId) => void
|
|
67
57
|
*/
|
|
68
58
|
onPlayerTap?: (data) => void;
|
|
69
59
|
/**
|
|
70
|
-
* @description.en
|
|
71
|
-
* @description.zh 是否可缩放
|
|
60
|
+
* @description.en Scalable or not
|
|
72
61
|
* @default true
|
|
73
62
|
*/
|
|
74
63
|
scalable?: boolean;
|
|
75
64
|
/**
|
|
76
|
-
* @description.en
|
|
77
|
-
* @description.zh 缩放比例
|
|
65
|
+
* @description.en Scale of scale
|
|
78
66
|
* @default 0
|
|
79
67
|
*/
|
|
80
68
|
scaleMultiple?: number;
|
|
81
69
|
/**
|
|
82
|
-
* @description.en
|
|
83
|
-
* @description.zh 摄像头旋转角度
|
|
70
|
+
* @description.en Camera rotation Angle
|
|
84
71
|
* @default 0
|
|
85
72
|
*/
|
|
86
73
|
rotateZ?: number;
|
|
87
74
|
/**
|
|
88
|
-
* @description.en
|
|
89
|
-
* @description.zh 是否开启视频区云平台控制
|
|
75
|
+
* @description.en Whether to enable the video area cradle head control
|
|
90
76
|
* @default true
|
|
91
77
|
*/
|
|
92
78
|
ptzControllable?: boolean;
|
|
93
79
|
/**
|
|
94
80
|
* @description.en playerStyle
|
|
95
|
-
* @description.zh 播放器样式
|
|
96
81
|
* @default {}
|
|
97
82
|
*/
|
|
98
83
|
playerStyle?: {
|
|
99
|
-
bgColor?: string;
|
|
100
|
-
borderRadius?: number | string;
|
|
101
|
-
borderStyle?: 'solid' | 'dashed';
|
|
102
|
-
borderColor?: string;
|
|
103
|
-
borderWidth?: string | number;
|
|
84
|
+
bgColor?: string;
|
|
85
|
+
borderRadius?: number | string;
|
|
86
|
+
borderStyle?: 'solid' | 'dashed';
|
|
87
|
+
borderColor?: string;
|
|
88
|
+
borderWidth?: string | number;
|
|
104
89
|
};
|
|
105
90
|
/**
|
|
106
|
-
* @description.en
|
|
107
|
-
* @
|
|
108
|
-
* @default "正在获取视频流..."
|
|
91
|
+
* @description.en Loading copy
|
|
92
|
+
* @default "Getting a video stream..."
|
|
109
93
|
*/
|
|
110
94
|
loadText?: string;
|
|
111
95
|
/**
|
|
112
|
-
* @description.en
|
|
113
|
-
* @description.zh 扩展属性
|
|
96
|
+
* @description.en Extended Attributes
|
|
114
97
|
* @default {}
|
|
115
98
|
*/
|
|
116
99
|
extend?: Record<string, any>;
|
|
@@ -148,8 +131,8 @@ import { Button, View } from '@ray-js/components';
|
|
|
148
131
|
|
|
149
132
|
const PlayerDemo = () => {
|
|
150
133
|
const [updateLayout, setUpdateLayout] = useState('');
|
|
151
|
-
const [state, setState] = useState({});
|
|
152
|
-
const [playerWidth, setPlayerWidth] = useState('200px');
|
|
134
|
+
const [state, setState] = useState({});
|
|
135
|
+
const [playerWidth, setPlayerWidth] = useState('200px');
|
|
153
136
|
/** onCtx usage
|
|
154
137
|
* playerCtx.ctx: The instance of ipc-player,includes preview, definition, mute, video, screenshot and other methods
|
|
155
138
|
* playerCtx.retry: retry
|