resumeMusic method
Resumes playback of paused music.
If music is not paused, this method does nothing. Handles potential "NotAllowedError" if the browser blocks resuming audio, in which case the music state might revert to stopped.
Implementation
void resumeMusic() {
if (musicState != ChannelState.paused) {
return;
}
_playPromise = _music!.play().toDart;
musicState = ChannelState.playing;
_playPromise!.catchError((error) {
if (error.isA<DOMException>() && error.name == "NotAllowedError") {
musicState = ChannelState.stopped;
}
});
}