Skip to content

Commit

Permalink
Change error message of dash.js and hls.js initialization fail
Browse files Browse the repository at this point in the history
  • Loading branch information
SangwonOh committed May 11, 2022
1 parent 2325210 commit e080df4
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 23 deletions.
28 changes: 14 additions & 14 deletions src/js/api/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ export const INIT_UNSUPPORT_ERROR = 101;
export const INIT_RTMP_SETUP_ERROR = 102;
export const INIT_DASH_UNSUPPORT = 103;
export const INIT_ADS_ERROR = 104;
export const INIT_DASH_NOTFOUND = 105;
export const INIT_HLSJS_NOTFOUND = 106;
export const INIT_DASH_FAIL = 105;
export const INIT_HLSJS_FAIL = 106;
export const PLAYER_UNKNWON_ERROR = 300;
export const PLAYER_UNKNWON_OPERATION_ERROR = 301;
export const PLAYER_UNKNWON_NETWORK_ERROR = 302;
Expand Down Expand Up @@ -170,13 +170,13 @@ export const SYSTEM_TEXT = [
},
105: {
"code": 105,
"message": "Can not find the dashjs. Please check the dashjs.",
"reason": "Not found dashjs."
"message": "Error initializing DASH.",
"reason": "Error initializing DASH."
},
106: {
"code": 106,
"message": "Can not find the hlsjs. Please check the hlsjs.",
"reason": "Not found hlsjs."
"message": "Error initializing HLS.",
"reason": "Error initializing HLS."
},
300: {
"code": 300,
Expand Down Expand Up @@ -313,7 +313,7 @@ export const SYSTEM_TEXT = [
},
103: {
"code": 103,
"message": "DashJS로 인해 로드 할 수 없습니다. 최신 dash.js를 사용해 주세요..",
"message": "DashJS로 인해 로드 할 수 없습니다. 최신 dash.js를 사용해 주세요.",
"reason": "dash.js version is old."
},
104: {
Expand All @@ -323,13 +323,13 @@ export const SYSTEM_TEXT = [
},
105: {
"code": 105,
"message": "DashJS 라이브러리가 없어 로드 할 수 없습니다.",
"reason": "Not found dashjs."
"message": "DASH 초기화 중 오류가 발생했습니다.",
"reason": "Error initializing DASH."
},
106: {
"code": 106,
"message": "HLSJS 라이브러리가 없어 로드 할 수 없습니다.",
"reason": "Not found hlsjs."
"message": "HLS 초기화 중 오류가 발생했습니다.",
"reason": "Error initializing HLS."
},
300: {
"code": 300,
Expand Down Expand Up @@ -476,13 +476,13 @@ export const SYSTEM_TEXT = [
},
105: {
"code": 105,
"message": "Nie można załadować, nie znaleziono dash.js.",
"reason": "Not found dashjs."
"message": "Nie można załadować, nie znaleziono DASH.",
"reason": "Error initializing DASH."
},
106: {
"code": 106,
"message": "Nie można załadować, nie znaleziono hlsjs.",
"reason": "Not found hlsjs."
"reason": "Error initializing HLS"
},
300: {
"code": 300,
Expand Down
4 changes: 2 additions & 2 deletions src/js/api/provider/html5/providers/Dash.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
STATE_AD_PLAYING,
STATE_AD_PAUSED,
INIT_DASH_UNSUPPORT,
INIT_DASH_NOTFOUND,
INIT_DASH_FAIL,
ERRORS,
PLAYER_UNKNWON_NETWORK_ERROR,
CONTENT_LEVEL_CHANGED,
Expand Down Expand Up @@ -273,7 +273,7 @@ const Dash = function (element, playerConfig, adTagUrl) {
if (error && error.code && error.code === INIT_DASH_UNSUPPORT) {
throw error;
} else {
let tempError = ERRORS.codes[INIT_DASH_NOTFOUND];
let tempError = ERRORS.codes[INIT_DASH_FAIL];
tempError.error = error;
throw tempError;
}
Expand Down
12 changes: 5 additions & 7 deletions src/js/api/provider/html5/providers/Hls.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,17 @@ import {errorTrigger} from "api/provider/utils";
import {
PROVIDER_HLS,
PLAYER_STATE, STATE_IDLE, STATE_LOADING,
INIT_DASH_UNSUPPORT, ERRORS,
INIT_HLSJS_NOTFOUND,
ERRORS,
INIT_HLSJS_FAIL,
HLS_PREPARED,
HLS_DESTROYED
} from "api/constants";
import _ from "utils/underscore";

import {
PLAYER_UNKNWON_ERROR,
PLAYER_UNKNWON_NETWORK_ERROR,
PLAYER_UNKNWON_DECODE_ERROR,
PLAYER_BAD_REQUEST_ERROR,
PLAYER_AUTH_FAILED_ERROR,
PLAYER_NOT_ACCEPTABLE_ERROR, DASH_PREPARED, DASH_DESTROYED
PLAYER_NOT_ACCEPTABLE_ERROR
} from "../../../constants";

/**
Expand Down Expand Up @@ -214,7 +212,7 @@ const HlsProvider = function (element, playerConfig, adTagUrl) {
superDestroy_func();
};
} catch (error) {
let tempError = ERRORS.codes[INIT_HLSJS_NOTFOUND];
let tempError = ERRORS.codes[INIT_HLSJS_FAIL];
tempError.error = error;
throw tempError;
}
Expand Down

0 comments on commit e080df4

Please sign in to comment.