CONNECT Player SDK 5 for Browsers and Connected TV
5.28.x 5.27.x 5.26.x 5.25.x 5.24.x 5.23.x 5.22.x 5.21.x 5.20.x 5.19.x 5.18.x 5.17.x 5.16.x 5.15.x 5.14.x 5.13.x 5.12.x 5.11.x 5.10.x 5.9.x 5.7.x 5.6.x 5.5.x 5.4.x 5.3.x 5.2.x
5.28.x 5.27.x 5.26.x 5.25.x 5.24.x 5.23.x 5.22.x 5.21.x 5.20.x 5.19.x 5.18.x 5.17.x 5.16.x 5.15.x 5.14.x 5.13.x 5.12.x 5.11.x 5.10.x 5.9.x 5.7.x 5.6.x 5.5.x 5.4.x 5.3.x 5.2.x

Error reporting

If required, errors can be reported from the SDK player engine to a listener function in your Application layer. The function signature needs to be as follows:

JavaScript
function onErrorCallback(
	errorSeverity,
	errorCategory,
	errorCode,
	errorMessage
) {
	// functionality to be implemented by the integrator
}

The listener function name should be passed to the SDK via a call through otvtoolkit to addErrorListener() on the exposed errorReporting component as follows:

JavaScript
window.player.otvtoolkit().errorReporting.addErrorListener({
	errorChanged: onErrorCallback
});

When it is no longer required to be notified of errors, the removeErrorListener() API can be called as follows:

JavaScript
window.player.otvtoolkit().errorReporting.removeErrorListener({
	errorChanged: onErrorCallback
});


The original setErrorListener API had a single usability limitation and is hence at notice of deprecation.

Full details of the error codes can be found at
https://shaka-player-demo.appspot.com/docs/api/shaka.util.Error.html#.Code