Prevent dispose from hanging
This commit is contained in:
parent
858c6c01f9
commit
fc9e6e0cd5
|
@ -674,6 +674,9 @@ public class AudioPlayer implements MethodCallHandler, Player.EventListener, Met
|
|||
player = null;
|
||||
transition(ProcessingState.none);
|
||||
}
|
||||
if (eventSink != null) {
|
||||
eventSink.endOfStream();
|
||||
}
|
||||
onDispose.run();
|
||||
}
|
||||
|
||||
|
|
|
@ -567,14 +567,11 @@ class AudioPlayer {
|
|||
_proxy?.stop();
|
||||
await _durationSubject.close();
|
||||
await _eventChannelStreamSubscription.cancel();
|
||||
await _playbackEventSubject.close();
|
||||
await _loopModeSubject.close();
|
||||
await _shuffleModeEnabledSubject.close();
|
||||
await _playingSubject.close();
|
||||
await _volumeSubject.close();
|
||||
await _speedSubject.close();
|
||||
await _playerStateSubject.drain();
|
||||
await _playerStateSubject.close();
|
||||
if (_positionSubject != null) {
|
||||
await _positionSubject.close();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue