Troubleshoot errors
    • PDF

    Troubleshoot errors

    • PDF

    Article summary

    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.

    Note

    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.

    Note

    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.
    image-EFN2HNB7

    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 numberError codeError messageDescription
    E0001ACCESS DENIEDInvalid access.Occurs when wrong option values are sent, video playback is unavailable
    E0002NOT AUTHORIZEDYou are not authorized to play this video.Occurs when player authentication fails due to bad request
    E0003NETWORK ERRORNetwork connection is unstable.Occur when player authentication fails due to a network problem
    E0004CANNOT PLAY VIDEOVideo can't be played.Occurs when failing to play a video
    E0005LICENSE IS INVALIDThe license is invalid.Occurs when the player license expires, video playback is unavailable
    E0006LIMIT DENIEDThe monthly basic call count has been exceeded.Occurs when the monthly usage limit for a free player has been reached, video playback is unavailable

    Was this article helpful?

    What's Next
    Changing your password will log you out immediately. Use the new password to log back in.
    First name must have atleast 2 characters. Numbers and special characters are not allowed.
    Last name must have atleast 1 characters. Numbers and special characters are not allowed.
    Enter a valid email
    Enter a valid password
    Your profile has been successfully updated.