Should add an onError event, which will emit a shaka.util.Error, or a custom error if it's originated from the wrapper implementation. The latter happens when player.load rejects it's promise.
This feature definitely needs a bit of thinking because I'd rather not map each shaka event. We're exposing both shaka's player & ui API through an imperative handle, theoretically this should be suffice for binding any shaka related event.
We do need some sort of error handling when an error occurs due to a method call in the wrapper implementation (such as player.load, but that could confuse people if it was named onError, which is too generic. An onPlayerLoadFailed / onPlayerLoadSuccess event might be better in this case. Those integrating this lib can then use controllerRef.current.player.addEventListener, which is the addEventListener method from the shaka instance underneath.
Should add an
onError
event, which will emit ashaka.util.Error
, or a custom error if it's originated from the wrapper implementation. The latter happens whenplayer.load
rejects it's promise.This feature definitely needs a bit of thinking because I'd rather not map each shaka event. We're exposing both shaka's player & ui API through an imperative handle, theoretically this should be suffice for binding any shaka related event.
We do need some sort of error handling when an error occurs due to a method call in the wrapper implementation (such as
player.load
, but that could confuse people if it was namedonError
, which is too generic. AnonPlayerLoadFailed
/onPlayerLoadSuccess
event might be better in this case. Those integrating this lib can then usecontrollerRef.current.player.addEventListener
, which is the addEventListener method from the shaka instance underneath.