@ray-js/ray-ipc-player 2.0.27 → 2.0.28
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 +15 -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,
|
|
@@ -805,7 +808,6 @@ const Player = props => {
|
|
|
805
808
|
return Strings.getLang('ipc_player_no_line');
|
|
806
809
|
}
|
|
807
810
|
if (videoErrCode !== '') {
|
|
808
|
-
console.log(Strings["ipc_player_error_".concat(codeCoverToInt(videoErrCode))], '多语言');
|
|
809
811
|
if (Strings["ipc_player_error_".concat(codeCoverToInt(videoErrCode))]) {
|
|
810
812
|
return "".concat(Strings.getLang("ipc_player_error_".concat(codeCoverToInt(videoErrCode))), "(").concat(videoErrCode, ")");
|
|
811
813
|
}
|
|
@@ -817,16 +819,21 @@ const Player = props => {
|
|
|
817
819
|
/**
|
|
818
820
|
* 根据自定义类型获取错误码展示内容
|
|
819
821
|
*/
|
|
822
|
+
|
|
820
823
|
const getErrorContentByType = useMemoizedFn((errCode, type) => {
|
|
821
824
|
const errContent = getErrCodeDetailDataByCode(String(errCode));
|
|
822
825
|
const contentEmpty = _isEmpty(errContent);
|
|
823
826
|
switch (type) {
|
|
824
827
|
// 是否展示建议文案
|
|
825
828
|
case 'suggestedFlag':
|
|
829
|
+
if (hideSuggestedText) {
|
|
830
|
+
return false;
|
|
831
|
+
}
|
|
826
832
|
if (contentEmpty) {
|
|
827
833
|
return false;
|
|
828
834
|
}
|
|
829
835
|
return errContent.suggestedText !== '';
|
|
836
|
+
|
|
830
837
|
// 建议文案
|
|
831
838
|
case 'suggestedText':
|
|
832
839
|
if (contentEmpty || privateState) {
|
|
@@ -866,6 +873,9 @@ const Player = props => {
|
|
|
866
873
|
}
|
|
867
874
|
return Strings.getLang('ipc_player_retry');
|
|
868
875
|
case 'help':
|
|
876
|
+
if (hideHelpButton) {
|
|
877
|
+
return false;
|
|
878
|
+
}
|
|
869
879
|
if (!phoneNetworkConnect || privateState) {
|
|
870
880
|
return false;
|
|
871
881
|
}
|
|
@@ -891,6 +901,9 @@ const Player = props => {
|
|
|
891
901
|
}
|
|
892
902
|
return errContent.helpNum;
|
|
893
903
|
case 'feedBack':
|
|
904
|
+
if (hideFeedBackButton) {
|
|
905
|
+
return false;
|
|
906
|
+
}
|
|
894
907
|
if (!phoneNetworkConnect) {
|
|
895
908
|
return true;
|
|
896
909
|
}
|
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
|
};
|