- Print
- PDF
Troubleshoot errors
- Print
- PDF
Available in Classic and VPC
The error response explains how to edit script code and apply custom messages to the playback sources through the error event.
You can view the error codes on the Media analytics management page when subscribing the Media Analytics service along with the Video Player Enhancement service.
JS Error Event Information
The function calling the player can call error codes and messages when detecting the event with the player.on("error", (err) => {});
code.
The error codes are sent to the error code list provided by the Video Player Enhancement service. For more information, see the Error code.
Examples are as follows:
function createPlayer(id) {
let player = new ncplayer('video', {
{
file:"http://example.com/myVideo.mp4",
poster:"http://example.com/myVideoThumb.png"
},
});
player.on("error", (err) => {
const error_code = err.code;
switch (error_code) {
case "E0001":
console.log("E0001 - ACCESS DENIED");
console.log("Invalid access / Occur when an incorrect option value is sent", err);
break;
case "E0002":
console.log("E0002 - NOT AUTHORIZED");
console.log ("No permission to play a video / Occurs when player authentication fails due to bad request", err);
break;
case "E0003":
console.log("E0003 - NETWORK ERROR");
console.log ("Authentication failed / Occurs due to a network connection problem", err);
break;
case "E0004":
console.log("E0004 - CANNOT PLAY");
console.log ("Cannot play a video / Occurs when failing to play a video file", err);
break;
case "E0005":
console.log("E0005 - LICENSE IS INVALID");
console.log ("Invalid license / Occurs when the license expires", err);
break;
case "E0006":
console.log("E0006 - LIMIT DENIED");
console.log ("Exceed monthly basic call / Occurs when the monthly usage limit for a free player has been reached", err);
break;
default:
break;
}
});
}
Error Screen Override (Override)
Customers can change and implement the default error screen with the desired code.
When overriding the error screen, it can be implemented through the player overlay, maintaining the pause at the last playback position as in the following modified screen.
Examples are as follows:
// Video (MP4)
const player = new ncplayer('video', {
playlist: [
{
file: 'https://CDNdomain/example_video_01.mp4',
poster: 'https://CDNdomain/example_image_01.png',
}
],
override:{
error(err){
console.log('player error :', err);
//A customer implements an error screen
//\<example> documnet.getElementById('error').style.display = 'block';
},
}
});
Error Code
The following are the various features provided by Video Player Enhancement service:
Error number | Error code | Error message | Description |
---|---|---|---|
E0001 | ACCESS DENIED | Invalid access. | Occurs when wrong option values are sent, video playback is unavailable |
E0002 | NOT AUTHORIZED | You are not authorized to play this video. | Occurs when player authentication fails due to bad request |
E0003 | NETWORK ERROR | Network connection is unstable. | Occur when player authentication fails due to a network problem |
E0004 | CANNOT PLAY VIDEO | Video can't be played. | Occurs when failing to play a video |
E0005 | LICENSE IS INVALID | The license is invalid. | Occurs when the player license expires, video playback is unavailable |
E0006 | LIMIT DENIED | The monthly basic call count has been exceeded. | Occurs when the monthly usage limit for a free player has been reached, video playback is unavailable |