I am trying to play audio file from asset using just_audio plugin with latest version. When I try to set the audio source it is giving the following error: Error1
The plugin documentation clearly shows that it supports windows platform then why it is giving this missing plugin exception.
This is my piece of code:
playAudio()
{
final player = AudioPlayer();
await player.setAsset('sound/tone.mp3');
player.play();
}
This is my asset file declaration in pubspec.yaml file
assets:
- img/
- sound/tone.mp3
Any could help me to solve this issue please.
Thanks
CodePudding user response:
Did you add the just_audio_libwinmedia
dependency to pubspec.yaml?
The document says need this dependency too.
Add the just_audio_libwinmedia dependency to your pubspec.yaml alongside just_audio: