getDuration method
Get audio duration after setting url. Use it in conjunction with setUrl.
It will be available as soon as the audio duration is available (it might take a while to download or buffer it if file is not local).
Implementation
Future<Duration?> getDuration() async {
await creatingCompleter.future;
final milliseconds = await _platform.getDuration(playerId);
if (milliseconds == null) {
return null;
}
return Duration(milliseconds: milliseconds);
}