AudioPlayer constructor

AudioPlayer({
  1. String? playerId,
})

Creates a new instance and assigns an unique id to it.

Implementation

AudioPlayer({String? playerId}) : playerId = playerId ?? _uuid.v4() {
  _onPlayerCompleteStreamSubscription = onPlayerComplete.listen((_) {
    state = PlayerState.completed;
    if (releaseMode == ReleaseMode.release) {
      _source = null;
    }
  });
}