2020-12-20 16:21:48 +01:00
|
|
|
class PlaybackEvent {
|
|
|
|
PlaybackEvent({
|
|
|
|
this.index,
|
2020-12-27 11:38:32 +01:00
|
|
|
this.playing,
|
2020-12-20 16:21:48 +01:00
|
|
|
this.processingState,
|
|
|
|
this.updatePosition,
|
|
|
|
this.updateTime,
|
|
|
|
});
|
2020-12-13 12:37:08 +01:00
|
|
|
|
2020-12-20 16:21:48 +01:00
|
|
|
final int index;
|
2020-12-27 11:38:32 +01:00
|
|
|
final bool playing;
|
2020-12-13 12:37:08 +01:00
|
|
|
final ProcessingState processingState;
|
2020-12-20 16:21:48 +01:00
|
|
|
final Duration updatePosition;
|
|
|
|
final DateTime updateTime;
|
2020-12-13 12:37:08 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
enum ProcessingState {
|
|
|
|
/// The player has not loaded an [AudioSource].
|
|
|
|
none,
|
2020-12-20 16:21:48 +01:00
|
|
|
|
2020-12-13 12:37:08 +01:00
|
|
|
/// The player is loading an [AudioSource].
|
|
|
|
loading,
|
2020-12-20 16:21:48 +01:00
|
|
|
|
2020-12-13 12:37:08 +01:00
|
|
|
/// The player is buffering audio and unable to play.
|
|
|
|
buffering,
|
2020-12-20 16:21:48 +01:00
|
|
|
|
2020-12-13 12:37:08 +01:00
|
|
|
/// The player is has enough audio buffered and is able to play.
|
|
|
|
ready,
|
2020-12-20 16:21:48 +01:00
|
|
|
|
2020-12-13 12:37:08 +01:00
|
|
|
/// The player has reached the end of the audio.
|
|
|
|
completed,
|
2020-12-20 16:21:48 +01:00
|
|
|
}
|