Version: Android 1.2.1
Viewing State & Events
Every io.video.videokit.live.viewer.StreamViewer
implementation keeps its internal state and
offers a way to register listener objects to listen to important events.
#
Viewer stateThe stream viewer state can be retrieved with StreamViewer.state
and, similar to our other SDKs,
it matches one of the constants in the io.video.videokit.live.viewer.StreamViewerState
class:
State | Description |
---|---|
StreamViewerState.IDLE | Viewer is ready to accept streams through StreamViewer.set . No stream was set. |
StreamViewerState.BUFFERING | Stream was set and will play as soon as buffering is finished. |
StreamViewerState.WATCHING | Stream was set and it is being played. |
StreamViewerState.PAUSED | Stream was set but playback was paused with pause() . Viewer is ready to play it as soon as play() is called. |
StreamViewerState.PAUSED_BUFFERING | Stream was set but playback was paused with pause() . Viewer is not ready to play because it needs to buffer more data. |
#
Viewer eventsAll StreamViewer
events are dispatched to a io.video.videokit.live.viewer.StreamViewerListener
that was
previously registered using addListener
.
Listeners are very important to be up-to-date about the stream viewer state, handle errors and create a responsive UI. We describe the listener interface as comments in the interface description below.