FijkState enum Null safety

State of the FijkPlayer

This is the state machine of ijkplayer. FijkPlayer has the same state as native ijkplayer. The state changed after method called or when some error occurs. One state can only change into the new state it can reach.

For example, idle can't becomes asyncPreparing directly.





idle → const FijkState

The state when a FijkPlayer is just created. Native ijkplayer memory and objects also be alloced or created when a FijkPlayer is created.

const FijkState(0)
initialized → const FijkState

After call FijkPlayer.setDataSource on state idle, the state becomes initialized.

const FijkState(1)
asyncPreparing → const FijkState

There're many tasks to do during prepare, such as detect stream info in datasource, find and open decoder, start decode and refresh thread. So ijkplayer export a async api prepareAsync. When FijkPlayer.prepareAsync is called on state initialized, ths state changed to asyncPreparing immediately. After all task in prepare have finished, the state changed to prepared. Additionally, if any error occurs during prepare, the state will change to error.

const FijkState(2)
prepared → const FijkState

After finish all the heavy tasks during FijkPlayer.prepareAsync, the state becomes prepared from asyncPreparing.

  • seekTo() -> self
  • start() -> started
  • reset() -> idle
  • release() -> end
const FijkState(3)
started → const FijkState
const FijkState(4)
paused → const FijkState
const FijkState(5)
completed → const FijkState
const FijkState(6)
stopped → const FijkState
const FijkState(7)
error → const FijkState
const FijkState(8)
end → const FijkState
  • release() -> self
const FijkState(9)


hashCode int
The hash code for this object.
read-only, inherited
index int
A numeric identifier for the enumerated value.
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited


noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
toString() String
A string representation of this object.


operator ==(Object other) bool
The equality operator.


values → const List<FijkState>
A constant List of the values in this enum, in order of their declaration.
[idle, initialized, asyncPreparing, prepared, started, paused, completed, stopped, error, end]