setUrl method

Future<void> setUrl(
  1. String url
)

Implementation

Future<void> setUrl(String url) async {
  if (_currentUrl == url) {
    eventStreamController.add(
      const AudioEvent(
        eventType: AudioEventType.prepared,
        isPrepared: true,
      ),
    );
    return;
  }
  _currentUrl = url;

  release();
  recreateNode();
  if (_isPlaying) {
    await resume();
  }
}