diff --git a/packages/audioplayers_web/lib/audioplayers_web.dart b/packages/audioplayers_web/lib/audioplayers_web.dart index 0e294dba1..51bf5d3eb 100644 --- a/packages/audioplayers_web/lib/audioplayers_web.dart +++ b/packages/audioplayers_web/lib/audioplayers_web.dart @@ -53,7 +53,7 @@ class AudioplayersPlugin extends AudioplayersPlatform with StreamsInterface { @override Future resume(String playerId) async { - getOrCreatePlayer(playerId).resume(); + await getOrCreatePlayer(playerId).resume(); } @override diff --git a/packages/audioplayers_web/lib/wrapped_player.dart b/packages/audioplayers_web/lib/wrapped_player.dart index bbacad711..bb26f783d 100644 --- a/packages/audioplayers_web/lib/wrapped_player.dart +++ b/packages/audioplayers_web/lib/wrapped_player.dart @@ -127,7 +127,7 @@ class WrappedPlayer { playerPlaySubscription = null; } - void start(double position) { + Future start(double position) async { isPlaying = true; if (currentUrl == null) { return; // nothing to play yet @@ -135,12 +135,12 @@ class WrappedPlayer { if (player == null) { recreateNode(); } - player?.play(); + await player?.play(); player?.currentTime = position; } - void resume() { - start(pausedAt ?? 0); + Future resume() async { + await start(pausedAt ?? 0); } void pause() {