play method
Plays a single run of the given file
, with a given volume
.
Implementation
@override
Future<void> play([int delay = 0]) async{
if (_isPlaying) {
console.warning( 'Audio: Audio is already playing.' );
return;
}
if(!hasPlaybackControl){
console.warning( 'Audio: this Audio has no playback control.' );
return;
}
_isPlaying = true;
if(source == null){
if(delay != 0){
_delay = Timer(Duration(milliseconds: delay), (){
_play();
_delay?.cancel();
_delay = null;
});
}
else{
_play();
}
}
else{
replay();
}
}