Tracking Errors
Video can throw error due to number of reasons. If the playback tokens (otp, playbackInfo) is out of time, the end-user will get a message saying "2013 time expired". Most such errors contains two parts, a code and an error message. The code can be either 4 digits or 8 digits. The exact error code tells us the root cause of the error, that is why we ask for that.
The video player has an error
event that can help you track such errors for your
/**
* @param {{status: object, error, object}} payload
* @param {hasError: boolean, errorMessage: string} payload.status
* @param {vdo: number, shaka: number, details: object} payload.error
*/
function errorHandler(payload) {}
video.addEventListener('error', errorHandler);
property | type | description |
---|---|---|
status | object | what to display |
status.hasError | boolean | true |
status.errorMessage | string | message that can be displayed to user. We have tried to keep error messages to be actionable by the user and not technical |
error | object | error object that can be used for analytics |
error.vdo | number | 4 digit number returned by license server |
error.shaka | number | 4 digit number generated by shaka player |
error.details | object | object with variable structure depending on the source |