play method
Future<void>
play(
- Source source, {
- double? volume,
- double? balance,
- AudioContext? ctx,
- Duration? position,
- PlayerMode? mode,
Implementation
Future<void> play(
Source source, {
double? volume,
double? balance,
AudioContext? ctx,
Duration? position,
PlayerMode? mode,
}) async {
if (mode != null) {
await setPlayerMode(mode);
}
if (volume != null) {
await setVolume(volume);
}
if (balance != null) {
await setBalance(balance);
}
if (ctx != null) {
await setAudioContext(ctx);
}
if (position != null) {
await seek(position);
}
await setSource(source);
return resume();
}