Search code examples
flutterdartaudioaudio-playerjust-audio

Use of Uri.parse or Uri.file


** Hi i want to use my asset image on screen while playing any song but im able to use oniline image but not asset image how to use asset image?**

      Uri.parse("live url"),
      tag: MediaItem(
        id: '${_nextMediaId++}',
        album: "Punjab1Radio",
        title: "Punjab1Radio Live",
        artUri: Uri.file('assets/logo.png'),
      ),
    ),```

Solution

  • go to pubspec.yaml and remove the comment from asset dependency and chang the asset path to your asset path