Skip to main content Link Menu Expand (external link) Document Search Copy Copied
pausePlayer method - FlutterSoundPlayer class - player library - Dart API
menu
pausePlayer

pausePlayer method

Future<void> pausePlayer()

Pause the current playback.


An exception is thrown if the player is not in the "playing" state.

Return

Return a Future which is completed when the function is done.

Example

await myPlayer.pausePlayer();

See also


Implementation

Future<void> pausePlayer() async {
  _logger.d('FS:---> pausePlayer ');
  await _lock.synchronized(() async {
    await _pausePlayer();
  });
  _logger.d('FS:<--- pausePlayer ');
}
flutter_sound 9.25.3