lib / tv.smartclip.smartclientandroid.lib.smartcorefacade / ErrorManager

ErrorManager

class ErrorManager : IKoinDi, ErrorJsInterface, ErrorReceiver, Releasable

Responsible for collecting errors and forward them to the EventProvider.

In the whole library, errors can be produced by the media player (SxMediaError) or by the core (SxAdError). All collected errors are forwarded to the EventProvider to notify the publisher. In case of a media player error we additionally fire an SxEventType.ERROR event so the core can read the media error from implemented ErrorJsInterface.

Constructors

<init>

Responsible for collecting errors and forward them to the EventProvider.

ErrorManager(di: IKoinDi)

Functions

getError

Is called after the core received the SxEventType.ERROR event.

fun getError(): String

newError

Propagates a new SxMediaError to the core and any registered EventProvider listener.

fun newError(error: SxMediaError): Unit

Builds a new SxMediaError out of the provided throwable thrown by the ExoPlayer and propagates it to the core and any registered EventProvider listener.

fun newError(throwable: Throwable): Unit

onAdPluginInitializationFailed

Is called when the ad plugin initialization has failed.

fun onAdPluginInitializationFailed(error: String): Unit

onAdTagLoadingFailed

Is called when the ad tag loading has failed.

fun onAdTagLoadingFailed(error: String): Unit

release

Removes all external class references. Has to be called when the implementing class is not needed anymore.

fun release(): Unit