From 768fde91aa41af51717e4e8487b2cadb665bb872 Mon Sep 17 00:00:00 2001 From: Ryan Heise Date: Wed, 16 Dec 2020 18:52:21 +1100 Subject: [PATCH] Rename none state to idle. --- just_audio/lib/just_audio.dart | 8 ++++---- .../lib/just_audio_platform_interface.dart | 2 +- just_audio_web/lib/just_audio_web.dart | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/just_audio/lib/just_audio.dart b/just_audio/lib/just_audio.dart index 0f147b4..1d363c8 100644 --- a/just_audio/lib/just_audio.dart +++ b/just_audio/lib/just_audio.dart @@ -636,7 +636,7 @@ class AudioPlayer { /// timestamps. If [start] is null, it will be reset to the start of the /// original [AudioSource]. If [end] is null, it will be reset to the end of /// the original [AudioSource]. This method cannot be called from the - /// [AudioPlaybackState.none] state. + /// [ProcessingState.idle] state. Future setClip({Duration start, Duration end}) async { if (_disposed) return null; _setPlatformActive(true); @@ -1037,7 +1037,7 @@ class PlaybackEvent { final int androidAudioSessionId; PlaybackEvent({ - this.processingState = ProcessingState.none, + this.processingState = ProcessingState.idle, DateTime updateTime, this.updatePosition = Duration.zero, this.bufferedPosition = Duration.zero, @@ -1078,7 +1078,7 @@ class PlaybackEvent { /// Enumerates the different processing states of a player. enum ProcessingState { /// The player has not loaded an [AudioSource]. - none, + idle, /// The player is loading an [AudioSource]. loading, @@ -1949,7 +1949,7 @@ class _IdleAudioPlayer extends AudioPlayerPlatform { _broadcastPlaybackEvent() { var updateTime = DateTime.now(); _eventSubject.add(PlaybackEventMessage( - processingState: ProcessingStateMessage.none, + processingState: ProcessingStateMessage.idle, updatePosition: _position, updateTime: updateTime, bufferedPosition: Duration.zero, diff --git a/just_audio_platform_interface/lib/just_audio_platform_interface.dart b/just_audio_platform_interface/lib/just_audio_platform_interface.dart index f436bbf..36225ad 100644 --- a/just_audio_platform_interface/lib/just_audio_platform_interface.dart +++ b/just_audio_platform_interface/lib/just_audio_platform_interface.dart @@ -201,7 +201,7 @@ class PlaybackEventMessage { /// A processing state communicated from the platform implementation. enum ProcessingStateMessage { - none, + idle, loading, buffering, ready, diff --git a/just_audio_web/lib/just_audio_web.dart b/just_audio_web/lib/just_audio_web.dart index 40ed664..262638f 100644 --- a/just_audio_web/lib/just_audio_web.dart +++ b/just_audio_web/lib/just_audio_web.dart @@ -37,7 +37,7 @@ class JustAudioPlugin extends JustAudioPlatform { abstract class JustAudioPlayer extends AudioPlayerPlatform { final eventController = StreamController(); - ProcessingStateMessage _processingState = ProcessingStateMessage.none; + ProcessingStateMessage _processingState = ProcessingStateMessage.idle; bool _playing = false; int _index; @@ -393,7 +393,7 @@ class Html5AudioPlayer extends JustAudioPlayer { _currentAudioSourcePlayer?.pause(); _audioElement.removeAttribute('src'); _audioElement.load(); - transition(ProcessingStateMessage.none); + transition(ProcessingStateMessage.idle); return await super.release(); }