onProgress property

Stream<PlaybackDisposition>? get onProgress

The stream side of the Food Controller

This is a stream on which FlutterSound will post the player progression. You may listen to this Stream to have feedback on the current playback.

PlaybackDisposition has two fields :

  • Duration duration (the total playback duration)
  • Duration position (the current playback position)

Example:

        _playerSubscription = myPlayer.onProgress.listen((e)
        {
                Duration maxDuration = e.duration;
                Duration position = e.position;
                ...
        }

Implementation

Stream<PlaybackDisposition>? get onProgress =>
    _playerController != null ? _playerController!.stream : null;