brightcove

Could I handle Brightcove Error Code: PLAYER_ERR_TIMEOUT manually?


Our company is using brightcove player in our kiosks in local branch stores. The error as below occurs very rarely.

enter image description here

Could not download the video

Error Code: PLAYER_ERR_TIMEOUT

If I reload browser then resolve the problem in most case but we can't reload it manually every time when it occurs.

  1. If the slow internet connection is the problem then changing bitrate manually helps this situation?
  2. Is there any api or function when I can handle this error? for example, like try/catch clause in javascript..
  3. Is there any request time out param in brightcove?
  4. I found the error message handling in below link. Can I execute some action like reload or redownload if I set up the specific errorcode in player.error? (The document seems to be meant just show custom error message only)

Brightcove defined custom errors

Thanks in advance.


Solution

  • I reply the question myself in first time. The below code can handle the errors.

    myPlayer.on('error', function(err) {
        var errNo = myPlayer.error().code;
        if (errNo == '-2'){
            blabla..
        }
    })
    

    And there is another way. This code retry to connect again when any error occurred.

    reloadOptions = {};
    reloadOptions.errorInterval = 10;
    myPlayer.reloadSourceOnError(reloadOptions);
    

    I hope this code helps someone like me.

    Thanks.