playSource method

Future<void> playSource(
  1. String source
)

Make source the active source and start playback. If a different source was active, it is implicitly paused via adapter.load.

Implementation

Future<void> playSource(String source) async {
  if (_activeSource != source) {
    await adapter.load(source);
    _activeSource = source;
    _position = Duration.zero;
    _duration = null;
    notifyListeners();
  }
  await adapter.play();
}