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;
|
player = null;
|
||||||
transition(ProcessingState.none);
|
transition(ProcessingState.none);
|
||||||
}
|
}
|
||||||
|
if (eventSink != null) {
|
||||||
|
eventSink.endOfStream();
|
||||||
|
}
|
||||||
onDispose.run();
|
onDispose.run();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -567,14 +567,11 @@ class AudioPlayer {
|
||||||
_proxy?.stop();
|
_proxy?.stop();
|
||||||
await _durationSubject.close();
|
await _durationSubject.close();
|
||||||
await _eventChannelStreamSubscription.cancel();
|
await _eventChannelStreamSubscription.cancel();
|
||||||
await _playbackEventSubject.close();
|
|
||||||
await _loopModeSubject.close();
|
await _loopModeSubject.close();
|
||||||
await _shuffleModeEnabledSubject.close();
|
await _shuffleModeEnabledSubject.close();
|
||||||
await _playingSubject.close();
|
await _playingSubject.close();
|
||||||
await _volumeSubject.close();
|
await _volumeSubject.close();
|
||||||
await _speedSubject.close();
|
await _speedSubject.close();
|
||||||
await _playerStateSubject.drain();
|
|
||||||
await _playerStateSubject.close();
|
|
||||||
if (_positionSubject != null) {
|
if (_positionSubject != null) {
|
||||||
await _positionSubject.close();
|
await _positionSubject.close();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue