io.video.videokit.live.host.StreamHost implementation keeps its internal state and
offers a way to register listener objects to listen to important events.
The stream host state can be retrieved with
StreamHost.state and, similar to our other SDKs,
it matches one of the constants in the
|The host is asking the user for permissions, or asking the backend for a Stream object.|
|The host is not streaming, but it is ready to. Stream might have started and then paused, or never started.|
|The host is currently streaming, with good network speed conditions.|
|The host should be streaming but network conditions are bad. In this state, recording is suspended until the upload queue becomes manageable again. This should be shown to the end user, because whatever happens in this state will not be streamed to viewers.|
When the host is transitioning from one state to another (that is, state is
you can check the state that is being transitioned to using
StreamHost events are dispatched to a
io.video.videokit.live.host.StreamHostListener that was
previously registered using
Listeners are very important to be up-to-date about the stream host state, handle errors and create a responsive UI. We describe the listener interface as comments in the interface description below.