State & Events
Every io.video.videokit.recorder.Recorder
implementation keeps its internal state and
offers a way to register listener objects to listen to important events.

#
Recorder stateThe recorder state can be retrieved with recorder.state
and, similar to our player
component, matches one of the constants in the io.video.videokit.recorder.RecorderState
class:
State | Description |
---|---|
RecorderState.BUSY | Recorder is busy in some operation or transitioning from one state to another. |
RecorderState.IDLE | Recorder is showing the camera preview, not recording. |
RecorderState.RECORDING | Recorder is recording the camera preview. |
RecorderState.PREVIEW | Recorder is in preview mode, previewing a previously recorded video. |
When recorder is transitioning from one state to another (that is, state is RecorderState.BUSY
),
you can check the state that is being transitioned to using recorder.targetState
.
#
Recorder eventsAll Recorder
events are dispatched to a io.video.videokit.recorder.RecorderListener
that was
previously registered using addListener
.
Listeners are very important to be up-to-date about the recorder state, handle errors and create a responsive UI. We describe the listener interface as comments in the interface description below.