load method

  1. @override
Future<Duration?> load({
  1. String? file,
  2. Uint8List? bytes,
})
override

Loads an MP3 file (or bytes when there is no file, on the web) and returns its length when known.

Implementation

@override
Future<Duration?> load({String? file, Uint8List? bytes}) async {
  if (file != null) return _p.setFilePath(file);
  if (bytes != null) return _p.setAudioSource(_BytesSource(bytes));
  return null;
}