@ray-js/ray-ipc-player 2.0.26-beta-1 → 2.0.26-beta-2
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/index.d.ts +1 -0
- package/lib/index.js +21 -17
- package/lib/{index.module.less → index.less} +49 -46
- package/package.json +1 -1
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
|
@@ -10,12 +10,16 @@ import { useMount, useUnmount, useMemoizedFn } from 'ahooks';
|
|
|
10
10
|
import { setPageOrientation, usePageEvent, getNetworkType, offNetworkStatusChange, onNetworkStatusChange, publishDps, showToast, getSystemInfoSync, onMqttMessageReceived, registerMQTTProtocolListener, offMqttMessageReceived, unregisterMQTTProtocolListener, registerDeviceListListener, onDpDataChange, onDeviceOnlineStatusUpdate, performanceEvent } from '@ray-js/ray';
|
|
11
11
|
import clsx from 'clsx';
|
|
12
12
|
import Strings from './i18n';
|
|
13
|
-
import Styles from './index.module.less';
|
|
14
13
|
import { IpcFailCode } from './constant';
|
|
15
14
|
import { useWakeUpDevice } from './hooks';
|
|
16
15
|
import { getIsConnected, getIsOnPreview, openTargetMinByShortLink, getLanguage, getHomeInfo, getDeviceInfo, getDpIdByDpCode, ipcTTTOperatorLog } from './utils';
|
|
17
16
|
import { getErrCodeDetailDataByCode, codeCoverToInt } from './config/errCodeConfig';
|
|
18
17
|
import { deviceFreezeReasonStore, miniIdLabs } from './config';
|
|
18
|
+
import './index.less';
|
|
19
|
+
const CSS_PREFIX = 'ray-ipc-player';
|
|
20
|
+
|
|
21
|
+
// 生成带前缀的类名
|
|
22
|
+
const getClassName = className => "".concat(CSS_PREFIX, "-").concat(className);
|
|
19
23
|
const Player = props => {
|
|
20
24
|
const {
|
|
21
25
|
updateLayout = '',
|
|
@@ -924,12 +928,12 @@ const Player = props => {
|
|
|
924
928
|
*/
|
|
925
929
|
|
|
926
930
|
return /*#__PURE__*/React.createElement(View, {
|
|
927
|
-
className:
|
|
931
|
+
className: getClassName('ipc-player'),
|
|
928
932
|
onClick: () => {
|
|
929
933
|
onPlayerContainerTap && onPlayerContainerTap(devId);
|
|
930
934
|
}
|
|
931
935
|
}, /*#__PURE__*/React.createElement(IpcPlayer, _extends({
|
|
932
|
-
className: "".concat(
|
|
936
|
+
className: "".concat(getClassName('player'), " ").concat(playState.updateLy),
|
|
933
937
|
objectFit: objectFit,
|
|
934
938
|
onVideoTap: handleVideoTap,
|
|
935
939
|
onZoomChange: onZoomChange,
|
|
@@ -963,51 +967,51 @@ const Player = props => {
|
|
|
963
967
|
style: {
|
|
964
968
|
borderRadius: "".concat(borderRadius)
|
|
965
969
|
},
|
|
966
|
-
className: clsx(
|
|
970
|
+
className: clsx(getClassName('load-box'), getClassName('bg-center'), !playState.loadingState && getClassName('hide')),
|
|
967
971
|
onClick: () => {
|
|
968
972
|
return false;
|
|
969
973
|
}
|
|
970
974
|
}, /*#__PURE__*/React.createElement(View, {
|
|
971
|
-
className:
|
|
975
|
+
className: getClassName('load-icon')
|
|
972
976
|
}), /*#__PURE__*/React.createElement(View, {
|
|
973
|
-
className:
|
|
977
|
+
className: getClassName('load-des')
|
|
974
978
|
}, loadText || playState.loadingText || Strings.getLang('ipc_player_get_video_stream'))), /*#__PURE__*/React.createElement(CoverView, {
|
|
975
979
|
style: {
|
|
976
980
|
borderRadius: "".concat(borderRadius)
|
|
977
981
|
},
|
|
978
|
-
className: clsx(
|
|
982
|
+
className: clsx(getClassName('bg-center'), getClassName('error-container'), !playState.errorState && getClassName('hide')),
|
|
979
983
|
onClick: () => {
|
|
980
984
|
return false;
|
|
981
985
|
}
|
|
982
986
|
}, /*#__PURE__*/React.createElement(View, {
|
|
983
|
-
className: clsx(
|
|
987
|
+
className: clsx(getClassName('err-icon-container'))
|
|
984
988
|
}, renderErrIcon ? renderErrIcon() : /*#__PURE__*/React.createElement(View, {
|
|
985
|
-
className: clsx(
|
|
989
|
+
className: clsx(getClassName('err-icon'))
|
|
986
990
|
})), /*#__PURE__*/React.createElement(View, {
|
|
987
|
-
className: clsx(
|
|
991
|
+
className: clsx(getClassName('err-text-container'))
|
|
988
992
|
}, /*#__PURE__*/React.createElement(View, {
|
|
989
|
-
className: clsx(
|
|
993
|
+
className: clsx(getClassName('err-content'))
|
|
990
994
|
}, getErrorContent()), getErrorContentByType(videoErrCode, 'suggestedFlag') && /*#__PURE__*/React.createElement(View, {
|
|
991
|
-
className: clsx(
|
|
995
|
+
className: clsx(getClassName('err-desc'))
|
|
992
996
|
}, getErrorContentByType(videoErrCode, 'suggestedText'))), /*#__PURE__*/React.createElement(View, {
|
|
993
|
-
className: clsx(
|
|
997
|
+
className: clsx(getClassName('err-operator-container'))
|
|
994
998
|
}, getErrorContentByType(videoErrCode, 'retry') && /*#__PURE__*/React.createElement(View, {
|
|
995
|
-
className: clsx(
|
|
999
|
+
className: clsx(getClassName('operator-btn'), getClassName('operator-retry')),
|
|
996
1000
|
style: {
|
|
997
1001
|
backgroundColor: "".concat(brandColor)
|
|
998
1002
|
},
|
|
999
1003
|
onClick: retry
|
|
1000
1004
|
}, getErrorContentByType(videoErrCode, 'retryText')), getErrorContentByType(videoErrCode, 'help') && /*#__PURE__*/React.createElement(View, {
|
|
1001
|
-
className: clsx(
|
|
1005
|
+
className: clsx(getClassName('operator-btn'), getClassName('operator-help')),
|
|
1002
1006
|
onClick: handleGotoHelpMini
|
|
1003
1007
|
}, Strings.getLang('ipc_player_help')), getErrorContentByType(videoErrCode, 'feedBack') && /*#__PURE__*/React.createElement(View, {
|
|
1004
|
-
className: clsx(
|
|
1008
|
+
className: clsx(getClassName('operator-btn'), getClassName('operator-feedback')),
|
|
1005
1009
|
onClick: () => {
|
|
1006
1010
|
const url = "godzilla://".concat(miniIdLabs.helpMini, "/pages/v2/problemSubmit/index");
|
|
1007
1011
|
openTargetMinByShortLink(url);
|
|
1008
1012
|
}
|
|
1009
1013
|
}, Strings.getLang('ipc_player_feedback')))), screenType === 'landscape' && (playState.loadingState || playState.errorState) && /*#__PURE__*/React.createElement(CoverView, {
|
|
1010
|
-
className: clsx(
|
|
1014
|
+
className: clsx(getClassName('load-full-back-container')),
|
|
1011
1015
|
onClick: () => {
|
|
1012
1016
|
setScreenType('portrait');
|
|
1013
1017
|
setPageOrientation({
|
|
@@ -1,21 +1,23 @@
|
|
|
1
|
-
|
|
1
|
+
@prefix: ray-ipc-player;
|
|
2
|
+
|
|
3
|
+
.@{prefix}-player {
|
|
2
4
|
width: 100%;
|
|
3
5
|
height: 100%;
|
|
4
6
|
}
|
|
5
7
|
|
|
6
|
-
|
|
8
|
+
.@{prefix}-ipc-player {
|
|
7
9
|
width: 100%;
|
|
8
10
|
height: 100%;
|
|
9
11
|
position: relative;
|
|
10
12
|
}
|
|
11
13
|
|
|
12
|
-
|
|
14
|
+
.@{prefix}-load-box {
|
|
13
15
|
color: #ffffff;
|
|
14
|
-
font-size:
|
|
16
|
+
font-size: 24px;
|
|
15
17
|
z-index: 350;
|
|
16
18
|
}
|
|
17
19
|
|
|
18
|
-
|
|
20
|
+
.@{prefix}-bg-center {
|
|
19
21
|
position: absolute;
|
|
20
22
|
top: 0;
|
|
21
23
|
width: 100%;
|
|
@@ -36,10 +38,10 @@
|
|
|
36
38
|
--video-bg: #0d0d0d;
|
|
37
39
|
}
|
|
38
40
|
|
|
39
|
-
|
|
41
|
+
.@{prefix}-load-icon {
|
|
40
42
|
display: block;
|
|
41
|
-
height:
|
|
42
|
-
width:
|
|
43
|
+
height: 20px;
|
|
44
|
+
width: 20px;
|
|
43
45
|
vertical-align: middle;
|
|
44
46
|
animation: spin 1s linear 0s infinite;
|
|
45
47
|
background: #ffffff;
|
|
@@ -48,8 +50,9 @@
|
|
|
48
50
|
-webkit-mask-repeat: no-repeat;
|
|
49
51
|
}
|
|
50
52
|
|
|
51
|
-
|
|
52
|
-
margin-top:
|
|
53
|
+
.@{prefix}-load-des {
|
|
54
|
+
margin-top: 16px;
|
|
55
|
+
font-size: 14px;
|
|
53
56
|
}
|
|
54
57
|
|
|
55
58
|
@keyframes spin {
|
|
@@ -61,7 +64,7 @@
|
|
|
61
64
|
}
|
|
62
65
|
}
|
|
63
66
|
|
|
64
|
-
|
|
67
|
+
.@{prefix}-hide {
|
|
65
68
|
display: none !important;
|
|
66
69
|
}
|
|
67
70
|
|
|
@@ -76,11 +79,11 @@
|
|
|
76
79
|
|
|
77
80
|
.iconfont {
|
|
78
81
|
font-family: 'iconfont' !important;
|
|
79
|
-
font-size:
|
|
82
|
+
font-size: 30px;
|
|
80
83
|
font-style: normal;
|
|
81
84
|
-webkit-font-smoothing: antialiased;
|
|
82
85
|
-moz-osx-font-smoothing: grayscale;
|
|
83
|
-
margin-bottom:
|
|
86
|
+
margin-bottom: 10px;
|
|
84
87
|
}
|
|
85
88
|
|
|
86
89
|
.icon_tishi:before {
|
|
@@ -88,56 +91,56 @@
|
|
|
88
91
|
color: #fff;
|
|
89
92
|
}
|
|
90
93
|
|
|
91
|
-
|
|
94
|
+
.@{prefix}-msg {
|
|
92
95
|
width: 100%;
|
|
93
96
|
}
|
|
94
97
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
font-size:
|
|
98
|
+
.@{prefix}-msg,
|
|
99
|
+
.@{prefix}-retry,
|
|
100
|
+
.@{prefix}-device-sleep,
|
|
101
|
+
.@{prefix}-re-wake-camera {
|
|
102
|
+
font-size: 12px;
|
|
100
103
|
display: inline-block;
|
|
101
104
|
color: #fff;
|
|
102
105
|
}
|
|
103
106
|
|
|
104
|
-
|
|
105
|
-
|
|
107
|
+
.@{prefix}-retry,
|
|
108
|
+
.@{prefix}-re-wake-camera {
|
|
106
109
|
color: #5583f5;
|
|
107
110
|
}
|
|
108
111
|
|
|
109
|
-
|
|
112
|
+
.@{prefix}-retry {
|
|
110
113
|
display: block;
|
|
111
114
|
}
|
|
112
115
|
|
|
113
|
-
|
|
116
|
+
.@{prefix}-err-container {
|
|
114
117
|
width: 100%;
|
|
115
118
|
text-align: center;
|
|
116
119
|
padding: 0 30px;
|
|
117
120
|
}
|
|
118
121
|
|
|
119
|
-
|
|
120
|
-
|
|
122
|
+
.@{prefix}-device-sleep,
|
|
123
|
+
.@{prefix}-re-wake-camera {
|
|
121
124
|
width: 100%;
|
|
122
125
|
}
|
|
123
126
|
|
|
124
|
-
|
|
125
|
-
margin-top:
|
|
127
|
+
.@{prefix}-re-wake-camera {
|
|
128
|
+
margin-top: 2px;
|
|
126
129
|
text-decoration: underline;
|
|
127
130
|
}
|
|
128
131
|
|
|
129
|
-
|
|
132
|
+
.@{prefix}-ellipsis {
|
|
130
133
|
white-space: nowrap;
|
|
131
134
|
overflow: hidden;
|
|
132
135
|
text-overflow: ellipsis;
|
|
133
136
|
}
|
|
134
137
|
|
|
135
|
-
|
|
138
|
+
.@{prefix}-err-msg {
|
|
136
139
|
text-align: center;
|
|
137
140
|
width: 100%;
|
|
138
141
|
}
|
|
139
142
|
|
|
140
|
-
|
|
143
|
+
.@{prefix}-load-full-back-container {
|
|
141
144
|
position: absolute;
|
|
142
145
|
left: 25px;
|
|
143
146
|
top: 16px;
|
|
@@ -150,13 +153,13 @@
|
|
|
150
153
|
-webkit-mask-repeat: no-repeat;
|
|
151
154
|
}
|
|
152
155
|
|
|
153
|
-
|
|
156
|
+
.@{prefix}-error-container {
|
|
154
157
|
text-align: center;
|
|
155
158
|
font-size: 12px;
|
|
156
159
|
padding: 0 16px;
|
|
157
160
|
|
|
158
|
-
|
|
159
|
-
|
|
161
|
+
.@{prefix}-err-icon-container {
|
|
162
|
+
.@{prefix}-err-icon {
|
|
160
163
|
background-image: url('./svg/errIcon.svg');
|
|
161
164
|
width: 38px;
|
|
162
165
|
height: 38px;
|
|
@@ -173,13 +176,13 @@
|
|
|
173
176
|
}
|
|
174
177
|
}
|
|
175
178
|
|
|
176
|
-
|
|
177
|
-
|
|
179
|
+
.@{prefix}-err-text-container {
|
|
180
|
+
.@{prefix}-err-content {
|
|
178
181
|
color: #ffffff;
|
|
179
182
|
font-size: 12px;
|
|
180
183
|
font-weight: 400;
|
|
181
184
|
}
|
|
182
|
-
|
|
185
|
+
.@{prefix}-err-desc {
|
|
183
186
|
margin-top: 5px;
|
|
184
187
|
color: rgba(255, 255, 255, 0.7);
|
|
185
188
|
font-size: 12px;
|
|
@@ -187,12 +190,12 @@
|
|
|
187
190
|
}
|
|
188
191
|
}
|
|
189
192
|
|
|
190
|
-
|
|
193
|
+
.@{prefix}-err-operator-container {
|
|
191
194
|
display: flex;
|
|
192
195
|
flex-direction: row;
|
|
193
196
|
flex-wrap: wrap;
|
|
194
197
|
margin-top: 15px;
|
|
195
|
-
|
|
198
|
+
.@{prefix}-operator-btn {
|
|
196
199
|
font-size: 14px;
|
|
197
200
|
font-weight: 400;
|
|
198
201
|
min-height: 36px;
|
|
@@ -209,30 +212,30 @@
|
|
|
209
212
|
text-overflow: ellipsis;
|
|
210
213
|
padding: 8px 16px;
|
|
211
214
|
}
|
|
212
|
-
|
|
215
|
+
.@{prefix}-operator-btn:hover {
|
|
213
216
|
opacity: 0.9;
|
|
214
217
|
}
|
|
215
|
-
|
|
218
|
+
.@{prefix}-operator-btn:active {
|
|
216
219
|
opacity: 1;
|
|
217
220
|
}
|
|
218
|
-
|
|
221
|
+
.@{prefix}-operator-btn:first-of-type {
|
|
219
222
|
margin-right: 4px;
|
|
220
223
|
margin-left: 0;
|
|
221
224
|
}
|
|
222
|
-
|
|
225
|
+
.@{prefix}-operator-btn:last-of-type {
|
|
223
226
|
margin-left: 4px;
|
|
224
227
|
margin-right: 0;
|
|
225
228
|
}
|
|
226
|
-
|
|
229
|
+
.@{prefix}-operator-btn:only-of-type {
|
|
227
230
|
margin: 0;
|
|
228
231
|
}
|
|
229
|
-
|
|
232
|
+
.@{prefix}-operator-retry {
|
|
230
233
|
background-color: #ff592a;
|
|
231
234
|
}
|
|
232
|
-
|
|
235
|
+
.@{prefix}-operator-help {
|
|
233
236
|
background-color: #252525;
|
|
234
237
|
}
|
|
235
|
-
|
|
238
|
+
.@{prefix}-operator-feedback {
|
|
236
239
|
background-color: #252525;
|
|
237
240
|
}
|
|
238
241
|
}
|