asset static method

PlayerController asset(
  1. String media, {
  2. int? id,
  3. bool? autoPlay = true,
  4. bool? once,
})

create assets instance

var player = Player.asset("assets/file.mp3");
player.play();

Implementation

static PlayerController asset(String media,
    {int? id, bool? autoPlay = true, bool? once}) {
  return Player.create(
      id: id, media: PlayerMedia.asset(media), autoPlay: autoPlay, once: once)
    ..init();
}