Restore old behaviour where events emitted on playing state changes.

This commit is contained in:
Ryan Heise 2020-12-29 21:52:51 +11:00
parent 05a7b768b3
commit 850dca088d
1 changed files with 1 additions and 1 deletions

View File

@ -541,7 +541,6 @@ class AudioPlayer {
_InitialSeekValues(position: initialPosition, index: initialIndex); _InitialSeekValues(position: initialPosition, index: initialIndex);
_playbackEventSubject.add(_playbackEvent = PlaybackEvent( _playbackEventSubject.add(_playbackEvent = PlaybackEvent(
currentIndex: initialIndex, updatePosition: initialPosition)); currentIndex: initialIndex, updatePosition: initialPosition));
_broadcastSequence();
_audioSource = source; _audioSource = source;
_broadcastSequence(); _broadcastSequence();
Duration duration; Duration duration;
@ -689,6 +688,7 @@ class AudioPlayer {
updateTime: DateTime.now(), updateTime: DateTime.now(),
); );
_playingSubject.add(true); _playingSubject.add(true);
_playbackEventSubject.add(_playbackEvent);
final playCompleter = Completer(); final playCompleter = Completer();
final audioSession = await AudioSession.instance; final audioSession = await AudioSession.instance;
if (await audioSession.setActive(true)) { if (await audioSession.setActive(true)) {