StreamerLifeCycleObserver
open class StreamerLifeCycleObserver(streamer: IStreamer, releaseOnDestroy: Boolean = false, startAudioCaptureOnResume: Boolean = false, coroutineDispatcher: CoroutineDispatcher = Dispatchers.Default) : DefaultLifecycleObserver(source)
A DefaultLifecycleObserver to control a streamer on Activity lifecycle.
It stops streamer when application goes to background and release it when application is destroyed.
To use it, call:
lifeCycle.addObserver(StreamerActivityLifeCycleObserver(streamer))
Parameters
streamer
The streamer to control
releaseOnDestroy
Whether to release the streamer when application is destroyed. If a view model is used, this should be set to false.
startAudioCaptureOnResume
Whether to start audio capture when application is resumed.