isPlaying property
ValueStream<bool>
get
isPlaying
Boolean observable representing the current mediaplayer playing state
retrieve directly the current player state final bool playing = _assetsAudioPlayer.isPlaying.value;
will follow the AssetsAudioPlayer playing state return StreamBuilder( stream: _assetsAudioPlayer.currentPosition, builder: (context, asyncSnapshot) { final bool isPlaying = asyncSnapshot.data; return Text(isPlaying ? 'Pause' : 'Play'); }),
Implementation
ValueStream<bool> get isPlaying => _isPlaying.stream;