Broadcast correct position during seek in iOS
This commit is contained in:
parent
4695d53398
commit
2596da4a5b
2 changed files with 22 additions and 0 deletions
|
@ -494,6 +494,12 @@ class AudioPlayer {
|
|||
/// from any state except for [AudioPlaybackState.none] and
|
||||
/// [AudioPlaybackState.connecting].
|
||||
Future<void> seek(final Duration position, {int index}) async {
|
||||
// Update local state immediately so that queries aren't surprised.
|
||||
_audioPlaybackEvent = _audioPlaybackEvent.copyWith(
|
||||
updatePosition: position,
|
||||
updateTime: Duration(milliseconds: DateTime.now().millisecondsSinceEpoch),
|
||||
);
|
||||
_playbackEventSubject.add(_audioPlaybackEvent);
|
||||
await _invokeMethod('seek', [position?.inMilliseconds, index]);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue