@ray-js/ray-ipc-player 2.0.20-beta-2 → 2.0.20-beta-4
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/config/errCodeConfig.d.ts +43 -0
- package/lib/config/errCodeConfig.js +136 -0
- package/lib/config/index.d.ts +14 -0
- package/lib/config/index.js +19 -0
- package/lib/constant.d.ts +1 -1
- package/lib/constant.js +1 -1
- package/lib/i18n/index.d.ts +404 -4
- package/lib/i18n/strings.d.ts +202 -2
- package/lib/i18n/strings.js +230 -6
- package/lib/index.js +350 -94
- package/lib/index.module.less +92 -6
- package/lib/svg/errIcon.svg +7 -0
- package/lib/svg/index.d.ts +2 -0
- package/lib/svg/index.js +1 -0
- package/lib/utils.d.ts +30 -1
- package/lib/utils.js +112 -18
- package/package.json +1 -1
package/lib/index.module.less
CHANGED
|
@@ -28,11 +28,7 @@
|
|
|
28
28
|
z-index: 350;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
|
|
32
|
-
text-align: center;
|
|
33
|
-
font-size: 0.28rem;
|
|
34
|
-
color: rgba(255, 255, 255, 0.5);
|
|
35
|
-
}
|
|
31
|
+
|
|
36
32
|
|
|
37
33
|
:root {
|
|
38
34
|
--video-bg: #0D0D0D;
|
|
@@ -148,4 +144,94 @@
|
|
|
148
144
|
-webkit-mask-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAAAAXNSR0IArs4c6QAACDxJREFUeF7tnQlyG0cMRccni3wyWyezc7KEI5MSaS7TC7YGHqtcqaS6ge7//zOGpFT5tvFCARR4qsA3tEEBFHiuAICQDhR4oQCAEA8UAJDwGXg7n/Dyz/1ff5//hD985gMyQXzd/blt2z8nEK7B+PtE76f/sK/j5aAAgDiIfgbiV2drQOkUTGI5gEio2FdjnwY/+rZ8rgaSQeFGtwHIqHJj+2bguHQEkjHth3YByJBsQ5sk4Lg0/s4b+CEPujcBSLdkQxsk4dg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12zZHQAyZp0nJN+3bfs9dmx29SoAIL2Kfa33hATfxn3r2onQXXLdLfaChJ8AnvOteTeANEv1dKEXJHg3791hBUQ+lKhpgQckvBdpsmZuEYDM6Xe92xqS/Y36DgkvRQUARFZcS0gARNa7h9UARF5kK0gARN67u4oAoiOyBSQAouPdTVUA0RNZGxIA0fPuszKA6IqsCQnfheh691EdQPRF1oIE7/S9AxADjfcW0pAwPYyM428hI6GFIcE3I98Q2kjocxuJScL0MPQMQAzFFoAEOIz9AhBjwScg4WevHLwCEAfRr1oePXLt33X8e37/4nvSot0BJIbxb6ffEtz/XF6X3xjkNwed/QEQZwNoH1sBAIntD6dzVgBAnA2gfWwFACS2P5zOWYH/AQJFetiiI4WtAAAAAElFTkSuQmCC');
|
|
149
145
|
-webkit-mask-size: cover;
|
|
150
146
|
-webkit-mask-repeat: no-repeat;
|
|
151
|
-
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.errorContainer {
|
|
150
|
+
text-align: center;
|
|
151
|
+
font-size: 12px;
|
|
152
|
+
padding: 0 16px;
|
|
153
|
+
word-break: break-all;
|
|
154
|
+
|
|
155
|
+
.errIconContainer {
|
|
156
|
+
.errIcon {
|
|
157
|
+
background-image: url('./svg/errIcon.svg');
|
|
158
|
+
width: 38px;
|
|
159
|
+
height: 38px;
|
|
160
|
+
background-size: contain;
|
|
161
|
+
background-repeat: no-repeat;
|
|
162
|
+
-webkit-mask-image: url('./svg/errIcon.svg');
|
|
163
|
+
-webkit-mask-repeat: no-repeat;
|
|
164
|
+
-webkit-mask-size: contain;
|
|
165
|
+
mask-image: url('./svg/errIcon.svg');
|
|
166
|
+
mask-repeat: no-repeat;
|
|
167
|
+
mask-size: contain;
|
|
168
|
+
background-color: #ffffff; /* 指定颜色 */
|
|
169
|
+
margin-bottom: 15px;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.errTextContainer {
|
|
174
|
+
.errContent {
|
|
175
|
+
color: #ffffff;
|
|
176
|
+
font-size: 24rpx;
|
|
177
|
+
font-weight: 400;
|
|
178
|
+
}
|
|
179
|
+
.errDesc {
|
|
180
|
+
margin-top: 10rpx;
|
|
181
|
+
color: rgba(255,255,255,0.7);
|
|
182
|
+
font-size: 24rpx;
|
|
183
|
+
font-weight: 400;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
.errOperatorContainer {
|
|
188
|
+
display: flex;
|
|
189
|
+
flex-direction: row;
|
|
190
|
+
flex-wrap: wrap;
|
|
191
|
+
margin-top: 15px;
|
|
192
|
+
.operatorBtn {
|
|
193
|
+
font-size: 14px;
|
|
194
|
+
font-weight: 400;
|
|
195
|
+
min-height: 36px;
|
|
196
|
+
box-sizing: border-box;
|
|
197
|
+
border-radius: 30px;
|
|
198
|
+
overflow: hidden;
|
|
199
|
+
min-width: 104px;
|
|
200
|
+
max-width: 200px;
|
|
201
|
+
display: flex;
|
|
202
|
+
justify-content: center;
|
|
203
|
+
align-items: center;
|
|
204
|
+
color: #ffffff;
|
|
205
|
+
margin: 0 4px;
|
|
206
|
+
text-overflow: ellipsis;
|
|
207
|
+
padding: 8px 16px;
|
|
208
|
+
}
|
|
209
|
+
.operatorBtn:hover {
|
|
210
|
+
opacity: 0.9;
|
|
211
|
+
}
|
|
212
|
+
.operatorBtn:active {
|
|
213
|
+
opacity: 1;
|
|
214
|
+
}
|
|
215
|
+
.operatorBtn:first-of-type {
|
|
216
|
+
margin-right: 4px;
|
|
217
|
+
margin-left: 0;
|
|
218
|
+
}
|
|
219
|
+
.operatorBtn:last-of-type {
|
|
220
|
+
margin-left: 4px;
|
|
221
|
+
margin-right: 0;;
|
|
222
|
+
}
|
|
223
|
+
.operatorBtn:only-of-type{
|
|
224
|
+
margin: 0
|
|
225
|
+
}
|
|
226
|
+
.operatorRetry {
|
|
227
|
+
background-color: red;
|
|
228
|
+
}
|
|
229
|
+
.operatorHelp {
|
|
230
|
+
background-color: #252525;
|
|
231
|
+
}
|
|
232
|
+
.operatorFeedBack {
|
|
233
|
+
background-color: #252525;
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<svg width="38px" height="38px" viewBox="0 0 38 38" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
2
|
+
<g id="errIcon" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
|
3
|
+
<g id="errIcon" transform="translate(3.000000, 3.000000)" fill="#FFFFFF">
|
|
4
|
+
<path d="M11.9536398,14.4064773 L12.0797001,14.5236 L12.8944001,15.3383 L12.0797001,16.1529 L11.2651001,15.3383 C10.8473358,14.9205357 10.1884879,14.8906954 9.7363151,15.2487791 L9.63584013,15.3383 L1.48950013,23.4846 C1.07172655,23.9023643 1.04188558,24.5612122 1.39997722,25.0134171 L1.48950013,25.1139 L7.19194013,30.8163 C7.60970441,31.2340643 8.26850926,31.2639046 8.72071592,30.9058209 L8.82120013,30.8163 L16.9675001,22.67 C17.3853573,22.2522357 17.4152042,21.5933878 17.0570409,21.1411829 L16.9675001,21.0407 L16.1529001,20.2261 L16.9675001,19.4114 L17.7822001,20.2261 C18.6411001,21.085 18.680141,22.4533279 17.8993229,23.3585395 L17.7822001,23.4846 L9.63584013,31.6309 C8.77692103,32.4898955 7.40859227,32.5289407 6.50336321,31.7480357 L6.37730013,31.6309 L0.674864125,25.9285 C-0.184054966,25.0696 -0.22309492,23.7012721 0.557739913,22.7960605 L0.674865125,22.67 L8.82121013,14.5236 C9.63718326,13.707645 10.912874,13.6316128 11.8145068,14.2955035 L11.9536398,14.4064773 Z M20.6334001,20.0573 C20.9515001,20.0573 21.2094001,20.3152 21.2094001,20.6334 L21.2094001,23.8919 C21.2094001,24.21 20.9515001,24.4679 20.6334001,24.4679 C20.3152001,24.4679 20.0573001,24.21 20.0573001,23.8919 L20.0573001,20.6334 C20.0573001,20.3152 20.3152001,20.0573 20.6334001,20.0573 Z M25.1139001,18.8354 C25.4320001,18.8354 25.6899001,19.0933 25.6899001,19.4114 C25.6899001,19.7296 25.4320001,19.9875 25.1139001,19.9875 L21.8553001,19.9875 C21.5372001,19.9875 21.2793001,19.7296 21.2793001,19.4114 C21.2793001,19.0933 21.5372001,18.8354 21.8553001,18.8354 L25.1139001,18.8354 Z M15.7456001,16.5602 C15.9456001,16.7602 15.9678223,17.0705802 15.8122668,17.295039 L15.7456001,17.3748 L14.1163001,19.0041 C13.8914001,19.2291 13.5267001,19.2291 13.3017001,19.0041 C13.101789,18.8041889 13.0794977,18.4937395 13.2350368,18.2692643 L13.3017001,18.1895 L14.9310001,16.5602 C15.1559001,16.3353 15.5207001,16.3353 15.7456001,16.5602 Z M25.9285001,0.674864 L31.6310001,6.3773 C32.5308001,7.27712 32.5308001,8.73602 31.6310001,9.63584 L23.4846001,17.7822 C22.5848001,18.682 21.1259001,18.682 20.2261001,17.7822 L19.4115001,16.9676 L20.2261001,16.1529 L21.0407001,16.9675 C21.4907001,17.4175 22.2201001,17.4175 22.6700001,16.9675 L30.8163001,8.8212 C31.2663001,8.37129 31.2663001,7.64184 30.8163001,7.19193 L25.1139001,1.4895 C24.6640001,1.03959 23.9346001,1.03959 23.4846001,1.4895 L15.3383001,9.63584 C14.8884001,10.0857 14.8884001,10.8152 15.3383001,11.2651 L16.1529001,12.0797 L15.3383001,12.8944 L14.5237001,12.0797 C13.6238001,11.1799 13.6238001,9.72103 14.5237001,8.82121 L22.6700001,0.674866 C23.5698001,-0.224954 25.0287001,-0.224956 25.9285001,0.674864 Z M19.0042001,13.3017 C19.2291001,13.5266 19.2291001,13.8913 19.0042001,14.1163 L17.3749001,15.7456 C17.1499001,15.9705 16.7852001,15.9705 16.5603001,15.7456 C16.3353001,15.5206 16.3353001,15.1559 16.5603001,14.9309 L18.1895001,13.3017 C18.4145001,13.0767 18.7792001,13.0767 19.0042001,13.3017 Z M11.0352001,12.1192 C11.3533001,12.1147 11.6148001,12.369 11.6193001,12.6871 C11.6232601,12.97339 11.4177541,13.213834 11.1447184,13.2623404 L11.0514001,13.2712 L7.79318013,13.3171 C7.47508013,13.3216 7.21357013,13.0673 7.20909013,12.7492 C7.20505813,12.46291 7.41058123,12.222466 7.68362836,12.1739596 L7.77695013,12.1651 L11.0352001,12.1192 Z M12.1938001,7.62194 C12.4800901,7.617899 12.7205341,7.8234293 12.7690405,8.09647796 L12.7779001,8.1898 L12.8238001,11.448 C12.8283001,11.7661 12.5741001,12.0276 12.2560001,12.0321 C11.9697101,12.03615 11.7292661,11.830572 11.6807597,11.557521 L11.6719001,11.4642 L11.6260001,8.20603 C11.6215001,7.88793 11.8757001,7.62642 12.1938001,7.62194 Z" id="形状"></path>
|
|
5
|
+
</g>
|
|
6
|
+
</g>
|
|
7
|
+
</svg>
|
package/lib/svg/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default {};
|
package/lib/utils.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export declare const putDpData: (dpIds: Record<number, boolean>, deviceId?: string) => Promise<unknown>;
|
|
2
1
|
/**
|
|
3
2
|
* 获取当前是否Connected (p2p连接状态)
|
|
4
3
|
* @param ipcCtx
|
|
@@ -11,3 +10,33 @@ export declare const getIsConnected: (ipcCtx: any) => Promise<unknown>;
|
|
|
11
10
|
* @returns
|
|
12
11
|
*/
|
|
13
12
|
export declare const getIsOnPreview: (ipcCtx: any) => Promise<unknown>;
|
|
13
|
+
/**
|
|
14
|
+
* RN跳转小程序通过shortLink
|
|
15
|
+
*/
|
|
16
|
+
export declare const openTargetMinByShortLink: (url: string, position?: string) => boolean;
|
|
17
|
+
/**
|
|
18
|
+
* 针对多语言code进行分割
|
|
19
|
+
*/
|
|
20
|
+
export declare const splitLanguage: (s: string) => string;
|
|
21
|
+
/**
|
|
22
|
+
* 获取当前语言类型
|
|
23
|
+
*/
|
|
24
|
+
export declare const getLanguage: () => Promise<string>;
|
|
25
|
+
/**
|
|
26
|
+
* 获取设备信息
|
|
27
|
+
*/
|
|
28
|
+
export declare const getDeviceInfo: (devId: string) => Promise<any>;
|
|
29
|
+
/**
|
|
30
|
+
* 获取家庭信息
|
|
31
|
+
*/
|
|
32
|
+
export declare const getHomeInfo: () => Promise<{
|
|
33
|
+
[key: string]: any;
|
|
34
|
+
}>;
|
|
35
|
+
/**
|
|
36
|
+
* 根据dpCode获取DpId
|
|
37
|
+
*/
|
|
38
|
+
export declare const getDpIdByDpCode: (devId: string, code: string) => Promise<number>;
|
|
39
|
+
/**
|
|
40
|
+
* TTT能力写入App日志
|
|
41
|
+
*/
|
|
42
|
+
export declare const ipcTTTOperatorLog: (ipcLogString: string) => void;
|
package/lib/utils.js
CHANGED
|
@@ -1,21 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
deviceId: deviceId,
|
|
5
|
-
mode: 2,
|
|
6
|
-
pipelines: [],
|
|
7
|
-
options: {},
|
|
8
|
-
dps: dpIds,
|
|
9
|
-
success: res => resolve(res),
|
|
10
|
-
fail: e => reject(e)
|
|
11
|
-
});
|
|
12
|
-
});
|
|
13
|
-
};
|
|
14
|
-
|
|
1
|
+
import "core-js/modules/esnext.iterator.constructor.js";
|
|
2
|
+
import "core-js/modules/esnext.iterator.find.js";
|
|
3
|
+
import { getLangKey, device, home, navigateToMiniProgram, getDpsInfos } from '@ray-js/ray';
|
|
15
4
|
/**
|
|
16
5
|
* 获取当前是否Connected (p2p连接状态)
|
|
17
|
-
* @param ipcCtx
|
|
18
|
-
* @returns
|
|
6
|
+
* @param ipcCtx
|
|
7
|
+
* @returns
|
|
19
8
|
*/
|
|
20
9
|
export const getIsConnected = ipcCtx => {
|
|
21
10
|
return new Promise(resolve => {
|
|
@@ -38,8 +27,8 @@ export const getIsConnected = ipcCtx => {
|
|
|
38
27
|
|
|
39
28
|
/**
|
|
40
29
|
* 获取当前是否已经在拉流状态
|
|
41
|
-
* @param ipcCtx
|
|
42
|
-
* @returns
|
|
30
|
+
* @param ipcCtx
|
|
31
|
+
* @returns
|
|
43
32
|
*/
|
|
44
33
|
export const getIsOnPreview = ipcCtx => {
|
|
45
34
|
return new Promise(resolve => {
|
|
@@ -58,4 +47,109 @@ export const getIsOnPreview = ipcCtx => {
|
|
|
58
47
|
resolve(false);
|
|
59
48
|
}
|
|
60
49
|
});
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* RN跳转小程序通过shortLink
|
|
54
|
+
*/
|
|
55
|
+
export const openTargetMinByShortLink = function (url) {
|
|
56
|
+
let position = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'bottom';
|
|
57
|
+
navigateToMiniProgram({
|
|
58
|
+
shortLink: url,
|
|
59
|
+
position
|
|
60
|
+
});
|
|
61
|
+
return false;
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* 针对多语言code进行分割
|
|
66
|
+
*/
|
|
67
|
+
export const splitLanguage = s => {
|
|
68
|
+
if (s.includes('-')) {
|
|
69
|
+
return s.split('-')[0];
|
|
70
|
+
}
|
|
71
|
+
if (s.includes('_')) {
|
|
72
|
+
return s.split('_')[0];
|
|
73
|
+
}
|
|
74
|
+
return s;
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* 获取当前语言类型
|
|
79
|
+
*/
|
|
80
|
+
export const getLanguage = () => {
|
|
81
|
+
return new Promise(resolve => {
|
|
82
|
+
getLangKey({
|
|
83
|
+
success: res => {
|
|
84
|
+
if (res) resolve(splitLanguage(res.langKey));else resolve('en');
|
|
85
|
+
},
|
|
86
|
+
fail: () => {
|
|
87
|
+
resolve('en');
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
});
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* 获取设备信息
|
|
95
|
+
*/
|
|
96
|
+
export const getDeviceInfo = devId => {
|
|
97
|
+
const {
|
|
98
|
+
getDeviceInfo
|
|
99
|
+
} = device;
|
|
100
|
+
return new Promise(resolve => {
|
|
101
|
+
getDeviceInfo({
|
|
102
|
+
deviceId: devId,
|
|
103
|
+
success: res => {
|
|
104
|
+
resolve(res);
|
|
105
|
+
},
|
|
106
|
+
fail: () => {
|
|
107
|
+
resolve({});
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
});
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* 获取家庭信息
|
|
115
|
+
*/
|
|
116
|
+
export const getHomeInfo = () => {
|
|
117
|
+
const {
|
|
118
|
+
getCurrentHomeInfo
|
|
119
|
+
} = home;
|
|
120
|
+
return new Promise(resolve => {
|
|
121
|
+
getCurrentHomeInfo({
|
|
122
|
+
success: res => {
|
|
123
|
+
resolve(res);
|
|
124
|
+
},
|
|
125
|
+
fail: () => {
|
|
126
|
+
resolve({});
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
});
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* 根据dpCode获取DpId
|
|
134
|
+
*/
|
|
135
|
+
export const getDpIdByDpCode = async (devId, code) => {
|
|
136
|
+
var _dpInfo$find;
|
|
137
|
+
const dpInfo = await getDpsInfos({
|
|
138
|
+
devId,
|
|
139
|
+
gwId: devId
|
|
140
|
+
});
|
|
141
|
+
return ((_dpInfo$find = dpInfo.find(item => item.code === code)) === null || _dpInfo$find === void 0 ? void 0 : _dpInfo$find.dpId) || -1;
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* TTT能力写入App日志
|
|
146
|
+
*/
|
|
147
|
+
export const ipcTTTOperatorLog = ipcLogString => {
|
|
148
|
+
try {
|
|
149
|
+
ty.ipc.ipcTTTOperatorLog({
|
|
150
|
+
ipcLogString
|
|
151
|
+
});
|
|
152
|
+
} catch (err) {
|
|
153
|
+
console.log('ipcTTTOperatorLog error', err);
|
|
154
|
+
}
|
|
61
155
|
};
|