@ray-js/ipc-player-integration 0.0.1-beta-5 → 0.0.1-beta-6

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/store.d.ts +1 -1
  2. package/lib/ctx/store.js +1 -0
  3. package/lib/hooks/useVideoBitKbps/index.js +3 -27
  4. package/lib/iconfont/iconfont.css +0 -1
  5. package/lib/interface.d.ts +2 -0
  6. package/lib/plugins/battery/battery.less +18 -19
  7. package/lib/plugins/fullScreen/fullScreen.js +15 -8
  8. package/lib/plugins/fullScreen/fullScreen.less +13 -5
  9. package/lib/plugins/fullScreen/verticalScreen.less +4 -2
  10. package/lib/plugins/fullScreen/voiceIntercom.d.ts +5 -0
  11. package/lib/plugins/fullScreen/voiceIntercom.js +32 -0
  12. package/lib/plugins/muted/muted.js +2 -2
  13. package/lib/plugins/muted/muted.less +3 -4
  14. package/lib/plugins/recordVideo/recordVideo.less +11 -11
  15. package/lib/plugins/screenshot/screenshot.less +18 -14
  16. package/lib/plugins/tempHumidity/tempHumidity.js +5 -7
  17. package/lib/plugins/tempHumidity/tempHumidity.less +10 -7
  18. package/lib/plugins/videoBitKbps/videoBitKbps.js +93 -3
  19. package/lib/plugins/videoBitKbps/videoBitKbps.less +5 -4
  20. package/lib/plugins/voiceIntercom/voiceIntercom.d.ts +4 -1
  21. package/lib/plugins/voiceIntercom/voiceIntercom.js +7 -3
  22. package/lib/plugins/voiceIntercom/voiceIntercom.less +5 -4
  23. package/lib/ui/bottomContent.d.ts +8 -0
  24. package/lib/ui/bottomContent.js +30 -0
  25. package/lib/ui/constant.d.ts +5 -0
  26. package/lib/ui/constant.js +5 -0
  27. package/lib/ui/context.d.ts +6 -0
  28. package/lib/ui/context.js +8 -0
  29. package/lib/ui/event.d.ts +8 -0
  30. package/lib/ui/event.js +26 -0
  31. package/lib/ui/hooks.d.ts +1 -0
  32. package/lib/ui/hooks.js +25 -0
  33. package/lib/ui/index.d.ts +2 -0
  34. package/lib/ui/index.js +3 -1
  35. package/lib/ui/topContent.d.ts +8 -0
  36. package/lib/ui/topContent.js +30 -0
  37. package/lib/ui/ui.d.ts +2 -1
  38. package/lib/ui/ui.js +128 -48
  39. package/lib/ui/ui.less +28 -22
  40. package/lib/utils/ipcApi/index.d.ts +78 -0
  41. package/lib/utils/ipcApi/index.js +251 -0
  42. package/package.json +2 -2
@@ -0,0 +1,251 @@
1
+ /**
2
+ * 获取信号强度
3
+ * @param devId
4
+ * @param dps 扩展参数
5
+ * @returns
6
+ */
7
+ export const requestWifiSignal = function (devId) {
8
+ let dps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
9
+ return new Promise((resolve, reject) => {
10
+ ty.device.requestWifiSignal({
11
+ deviceId: devId,
12
+ dps: dps,
13
+ success: res => {
14
+ console.log('res===ttt requestWifiSignal success', res);
15
+ resolve(res);
16
+ },
17
+ fail: error => reject(error)
18
+ });
19
+ }).catch(error => {
20
+ console.log('res===ttt requestWifiSignal error', error);
21
+ throw error;
22
+ });
23
+ };
24
+
25
+ /**
26
+ * 获取视频码率
27
+ * @param devId
28
+ * @param extendParam 扩展参数
29
+ * @returns
30
+ */
31
+ export const getVideoBitrateKbps = function (devId) {
32
+ let extendParam = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
33
+ return new Promise((resolve, reject) => {
34
+ ty.ipc.getVideoBitrateKbps({
35
+ devId,
36
+ extendParam: extendParam,
37
+ success: res => {
38
+ console.log('res===ttt getVideoBitrateKbps success', res);
39
+ resolve(res);
40
+ },
41
+ fail: error => reject(error)
42
+ });
43
+ }).catch(error => {
44
+ console.log('res===ttt getVideoBitrateKbps error', error);
45
+ throw error;
46
+ });
47
+ };
48
+
49
+ // addCameraDeviceObserver
50
+ export const addCameraDeviceObserver = function (devId) {
51
+ let extendParam = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
52
+ return new Promise((resolve, reject) => {
53
+ ty.ipc.addCameraDeviceObserver({
54
+ devId,
55
+ extendParam: extendParam,
56
+ success: res => {
57
+ console.log('res===ttt addCameraDeviceObserver success', res);
58
+ resolve(res);
59
+ },
60
+ fail: error => reject(error)
61
+ });
62
+ }).catch(error => {
63
+ console.log('res===ttt addCameraDeviceObserver error', error);
64
+ throw error;
65
+ });
66
+ };
67
+ // networkStatusDidChangedEvent,
68
+ // 事件:监听网络状态事件
69
+ // 通用
70
+ // ty.onNetworkStatusChange
71
+ export const networkStatusDidChangedEvent = callback => {
72
+ ty.onNetworkStatusChange(callback);
73
+ };
74
+
75
+ // cameraNotifyWeakNetworkEvent
76
+ // 事件:画面网速监听状态值事件
77
+ // TUNIIPCCameraManager
78
+
79
+ // sessionDidDisconnectedEvent
80
+
81
+ // cameraPreviewFailureEvent
82
+
83
+ /**
84
+ * IPC-低功耗唤醒:低功耗唤醒,唤醒门铃设备
85
+ * 需引入DeviceKit,且在>=3.1.0-ipcwake.1版本才可使用
86
+ * @param devId
87
+ * @returns
88
+ */
89
+ export const wakeUpDevice = function (devId) {
90
+ let dps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
91
+ return new Promise((resolve, reject) => {
92
+ ty.device.wakeUpDevice({
93
+ deviceId: devId,
94
+ dps: dps,
95
+ success: res => {
96
+ console.log('res===ttt wakeUpDevice success', res);
97
+ resolve(res);
98
+ },
99
+ fail: error => reject(error)
100
+ });
101
+ }).catch(error => {
102
+ console.log('res===ttt wakeUpDevice error', error);
103
+ throw error;
104
+ });
105
+ };
106
+
107
+ /**
108
+ * 画中画:是否支持画中画:只有安卓在用
109
+ * 需引入IPCKit,且在>=1.0.0-TTT432.1版本才可使用
110
+ * @param devId
111
+ * @param extendParam 扩展参数
112
+ * @returns
113
+ */
114
+ export const getMobileOrientation = () => {
115
+ return new Promise((resolve, reject) => {
116
+ ty.getSystemInfo({
117
+ success: res => {
118
+ console.log('res===ttt getMobileOrientation success', res);
119
+ resolve(res);
120
+ },
121
+ fail: error => reject(error)
122
+ });
123
+ }).catch(error => {
124
+ console.log('res===ttt getMobileOrientation error', error);
125
+ throw error;
126
+ });
127
+ };
128
+
129
+ /**
130
+ * 屏幕旋转设置,auto(暂不支持) / portrait / landscape。pad 模式下不支持屏幕旋转
131
+ * 需引入MiniKit,且在>=2.4.1版本才可使用
132
+ * @param pageOrientation
133
+ * @returns
134
+ */
135
+ export const setScreenOrientation = pageOrientation => {
136
+ return new Promise((resolve, reject) => {
137
+ ty.setPageOrientation({
138
+ pageOrientation: pageOrientation,
139
+ success: res => {
140
+ console.log('res===ttt setScreenOrientation success', res);
141
+ resolve(res);
142
+ },
143
+ fail: error => reject(error)
144
+ });
145
+ }).catch(error => {
146
+ console.log('res===ttt setScreenOrientation error', error);
147
+ throw error;
148
+ });
149
+ };
150
+
151
+ /**
152
+ * 画中画:是否支持画中画:只有安卓在用
153
+ * 需引入IPCKit,且在>=1.0.0-TTT432.1版本才可使用
154
+ * @param devId
155
+ * @param extendParam 扩展参数
156
+ * @returns
157
+ */
158
+ export const isSupportFloatWindow = function (devId) {
159
+ let extendParam = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
160
+ return new Promise((resolve, reject) => {
161
+ ty.ipc.isSupportFloatWindow({
162
+ deviceId: devId,
163
+ extendParam: extendParam,
164
+ success: res => {
165
+ console.log('res===ttt isSupportFloatWindow success', res);
166
+ resolve(res);
167
+ },
168
+ fail: error => reject(error)
169
+ });
170
+ }).catch(error => {
171
+ console.log('res===ttt isSupportFloatWindow error', error);
172
+ throw error;
173
+ });
174
+ };
175
+
176
+ /**
177
+ * 画中画:开启画中画
178
+ * 需引入IPCKit,且在>=1.0.0-TTT432.1版本才可使用
179
+ * @param devId
180
+ * @param extendParam 扩展参数
181
+ * @returns
182
+ */
183
+ export const openFloatWindow = function (devId) {
184
+ let extendParam = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
185
+ return new Promise((resolve, reject) => {
186
+ ty.ipc.openFloatWindow({
187
+ deviceId: devId,
188
+ extendParam: extendParam,
189
+ success: res => {
190
+ console.log('res===ttt openFloatWindow success');
191
+ resolve(res);
192
+ },
193
+ fail: error => reject(error)
194
+ });
195
+ }).catch(error => {
196
+ console.log('res===ttt openFloatWindow error', error);
197
+ throw error;
198
+ });
199
+ };
200
+
201
+ /**
202
+ * IPC-APP 缓存支持的对讲方式:是否支持对讲
203
+ * 需引入IPCKit,且在>=1.0.0-TTT432.1版本才可使用
204
+ * @param devId
205
+ * @param extendParam 扩展参数
206
+ * @returns
207
+ */
208
+ export const isSupportedTalk = function (devId) {
209
+ let extendParam = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
210
+ return new Promise((resolve, reject) => {
211
+ ty.ipc.isSupportedTalk({
212
+ deviceId: devId,
213
+ extendParam: extendParam,
214
+ success: res => {
215
+ console.log('res===ttt isSupportedTalk success', res);
216
+ resolve(res);
217
+ },
218
+ fail: error => reject(error)
219
+ });
220
+ }).catch(error => {
221
+ console.log('res===ttt isSupportedTalk error', error);
222
+ throw error;
223
+ });
224
+ };
225
+
226
+ /**
227
+ * 设备支持的对讲模式
228
+ * 需引入IPCKit,且在>=1.0.0-TTT432.1版本才可使用
229
+ * @param devId
230
+ * @param extendParam 扩展参数
231
+ * @returns 设备支持的对讲模式。回掉方法的参数为数值型,0 未知;1:单向对讲;2:双向对讲。
232
+ */
233
+ export const getCurrentSupportedTalkMode = function (devId) {
234
+ let extendParam = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
235
+ return new Promise((resolve, reject) => {
236
+ ty.ipc.getCurrentSupportedTalkMode({
237
+ deviceId: devId,
238
+ extendParam: extendParam,
239
+ success: res => {
240
+ console.log('res===ttt getCurrentSupportedTalkMode success', res);
241
+ resolve(res);
242
+ },
243
+ fail: error => reject(error)
244
+ });
245
+ }).catch(error => {
246
+ console.log('res===ttt getCurrentSupportedTalkMode error', error);
247
+ throw error;
248
+ });
249
+ };
250
+
251
+ // 挂在了page生命周期的onResize下面
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ray-js/ipc-player-integration",
3
- "version": "0.0.1-beta-5",
3
+ "version": "0.0.1-beta-6",
4
4
  "description": "IPC 播放器功能集成",
5
5
  "main": "lib/index",
6
6
  "files": [
@@ -37,7 +37,7 @@
37
37
  "dependencies": {
38
38
  "@ray-js/ray-ipc-player": "2.0.17-beta-beta-1",
39
39
  "clsx": "^1.2.1",
40
- "jotai": "^2.10.1"
40
+ "jotai": "^2.10.2"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@commitlint/cli": "^7.2.1",