play method

  1. @override
Future<void> play(
  1. String path
)
override

Play a Track by Path

Cancels any pending crossfade listener, resolves the path using the configured source builder (default: AssetSource), and wires a new crossfade schedule for the new track.

To play URLs, call changeSource(UrlSource.new) before playing.

Implementation

@override
Future<void> play(String path) async {
  _positionSub?.cancel();
  await playFromSource(resolveSource(path)); // Uses _sourceBuilder (respects changeSource)
  _scheduleCrossfade();
}