@ray-js/ray-ipc-player 2.0.27 → 2.0.29-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/config/errCodeConfig.js +1 -1
- package/lib/index.js +21 -2
- package/lib/typings/index.d.ts +18 -0
- package/package.json +1 -1
|
@@ -24,7 +24,7 @@ export const errCodeLabs = [{
|
|
|
24
24
|
type: 'feedBackDirectly',
|
|
25
25
|
try: true,
|
|
26
26
|
help: false,
|
|
27
|
-
feedBack:
|
|
27
|
+
feedBack: true,
|
|
28
28
|
suggestedText: Strings.getLang('ipc_player_suggest_feed_back_err_factory_text'),
|
|
29
29
|
helpFeedBack: false,
|
|
30
30
|
codes: ['-1021', '-10008', '-41001', '-39', '-30082', '-30083', '-40301', '-40302', '-40303', '-41000', '-40206']
|
package/lib/index.js
CHANGED
|
@@ -57,7 +57,10 @@ const Player = props => {
|
|
|
57
57
|
reConnect = false,
|
|
58
58
|
awakeStatus = undefined,
|
|
59
59
|
ignoreHideStopPreview = false,
|
|
60
|
-
onChangeIgnoreHideStopPreview
|
|
60
|
+
onChangeIgnoreHideStopPreview,
|
|
61
|
+
hideSuggestedText = false,
|
|
62
|
+
hideHelpButton = false,
|
|
63
|
+
hideFeedBackButton = false
|
|
61
64
|
} = props;
|
|
62
65
|
const {
|
|
63
66
|
borderRadius,
|
|
@@ -193,6 +196,12 @@ const Player = props => {
|
|
|
193
196
|
stopPreview();
|
|
194
197
|
// await getCurMute();
|
|
195
198
|
}));
|
|
199
|
+
usePageEvent('onPause', useMemoizedFn(async () => {
|
|
200
|
+
console.log('onResume, 重新拉流');
|
|
201
|
+
ipcTTTOperatorLog('VID: onResume stopPreview');
|
|
202
|
+
stopPreview();
|
|
203
|
+
disconnect();
|
|
204
|
+
}));
|
|
196
205
|
useMount(() => {
|
|
197
206
|
onNetworkStatusChange(res => {
|
|
198
207
|
setPhoneNetworkConnect(res.isConnected);
|
|
@@ -805,7 +814,6 @@ const Player = props => {
|
|
|
805
814
|
return Strings.getLang('ipc_player_no_line');
|
|
806
815
|
}
|
|
807
816
|
if (videoErrCode !== '') {
|
|
808
|
-
console.log(Strings["ipc_player_error_".concat(codeCoverToInt(videoErrCode))], '多语言');
|
|
809
817
|
if (Strings["ipc_player_error_".concat(codeCoverToInt(videoErrCode))]) {
|
|
810
818
|
return "".concat(Strings.getLang("ipc_player_error_".concat(codeCoverToInt(videoErrCode))), "(").concat(videoErrCode, ")");
|
|
811
819
|
}
|
|
@@ -817,16 +825,21 @@ const Player = props => {
|
|
|
817
825
|
/**
|
|
818
826
|
* 根据自定义类型获取错误码展示内容
|
|
819
827
|
*/
|
|
828
|
+
|
|
820
829
|
const getErrorContentByType = useMemoizedFn((errCode, type) => {
|
|
821
830
|
const errContent = getErrCodeDetailDataByCode(String(errCode));
|
|
822
831
|
const contentEmpty = _isEmpty(errContent);
|
|
823
832
|
switch (type) {
|
|
824
833
|
// 是否展示建议文案
|
|
825
834
|
case 'suggestedFlag':
|
|
835
|
+
if (hideSuggestedText) {
|
|
836
|
+
return false;
|
|
837
|
+
}
|
|
826
838
|
if (contentEmpty) {
|
|
827
839
|
return false;
|
|
828
840
|
}
|
|
829
841
|
return errContent.suggestedText !== '';
|
|
842
|
+
|
|
830
843
|
// 建议文案
|
|
831
844
|
case 'suggestedText':
|
|
832
845
|
if (contentEmpty || privateState) {
|
|
@@ -866,6 +879,9 @@ const Player = props => {
|
|
|
866
879
|
}
|
|
867
880
|
return Strings.getLang('ipc_player_retry');
|
|
868
881
|
case 'help':
|
|
882
|
+
if (hideHelpButton) {
|
|
883
|
+
return false;
|
|
884
|
+
}
|
|
869
885
|
if (!phoneNetworkConnect || privateState) {
|
|
870
886
|
return false;
|
|
871
887
|
}
|
|
@@ -891,6 +907,9 @@ const Player = props => {
|
|
|
891
907
|
}
|
|
892
908
|
return errContent.helpNum;
|
|
893
909
|
case 'feedBack':
|
|
910
|
+
if (hideFeedBackButton) {
|
|
911
|
+
return false;
|
|
912
|
+
}
|
|
894
913
|
if (!phoneNetworkConnect) {
|
|
895
914
|
return true;
|
|
896
915
|
}
|
package/lib/typings/index.d.ts
CHANGED
|
@@ -192,4 +192,22 @@ export type IProps = {
|
|
|
192
192
|
* @default (data) => void
|
|
193
193
|
*/
|
|
194
194
|
onChangeIgnoreHideStopPreview?: (data: boolean) => void;
|
|
195
|
+
/**
|
|
196
|
+
* @description.en hide suggested text
|
|
197
|
+
* @description.zh 隐藏建议文案
|
|
198
|
+
* @default (data) => void
|
|
199
|
+
*/
|
|
200
|
+
hideSuggestedText?: boolean;
|
|
201
|
+
/**
|
|
202
|
+
* @description.en hide help button
|
|
203
|
+
* @description.zh 隐藏反馈帮助按钮
|
|
204
|
+
* @default (data) => void
|
|
205
|
+
*/
|
|
206
|
+
hideHelpButton?: boolean;
|
|
207
|
+
/**
|
|
208
|
+
* @description.en hide feedback button
|
|
209
|
+
* @description.zh 隐藏反馈按钮
|
|
210
|
+
* @default (data) => void
|
|
211
|
+
*/
|
|
212
|
+
hideFeedBackButton?: boolean;
|
|
195
213
|
};
|