I am integrating shaka player in my web application. I have gone throught the documentation and found basic program to load player with video manifest url. Link for basic program is basic tutorial. And it is loading video fine.
I need to implement error handing for player. So I am trying to understand, where the 'error' event listener will be firing. Following is the code for listening error. It is not triggering anymore for me.
// Listen for error events.
player.addEventListener('error', onErrorEvent);
Following are the Trails to get it invoked but not triggered: Trail 1: Not initialized video variable.
const video = null;
const player = new shaka.Player(video);
Trail 2: Loading an invalid manifest url.
try {
await player.load('https://mydymmy.manifest.url');
} catch (e) {
onError(e);
}
I would like to implement error handling in my program. For that i need to understand when this 'error' listener will be invoking.
player.addEventListener('error', onErrorEvent);
The listener example in the tutorial didn't work
const listener = new shaka.util.EventManager();
listener.listen(player,
error
, (event: any) => { onErrorEvent(event); });You should use shaka.util.EventManager