1

I am using audioplayers 0.16.1 library for my music application but I keep getting the following error while building notifications. My Error Code:

Exception has occurred.
MissingPluginException (MissingPluginException(No implementation found for method setNotification on 
channel xyz.luan/audioplayers))

My setNotification method:

  setNotification() async {
await advancedPlayer.setNotification(
    albumTitle: "Beatifun Music",
    artist: video.snippet.channelTitle,
    duration: _duration,
    elapsedTime: _position,
    backwardSkipInterval: Duration(seconds: 10),
    forwardSkipInterval: Duration(seconds: 10),
    imageUrl: video.snippet.thumbnails.high.url,
    title: video.snippet.title);
    }

How can I solve this problem?

spydon
  • 9,372
  • 6
  • 33
  • 63
Berat Kurt
  • 95
  • 1
  • 8
  • are you using a pub package. I suggest that you verify the version of he package still uses the same functions. This happens mainly when the creator of the package switches the names of the functions – king mort Sep 22 '20 at 09:56
  • I using audioplayers package in pub.dev. them version is 0.16.1 – Berat Kurt Sep 22 '20 at 10:12
  • can you specify how you initialized advancedPlayer – king mort Sep 22 '20 at 10:40
  • Future initPlay() { advancedPlayer = AudioPlayer( playerId: widget.playlist[widget.currentIndex].snippet.resourceId.videoId, ); audioCache = AudioCache( fixedPlayer: advancedPlayer, ); advancedPlayer.durationHandler = (d) => setState(() { _duration = d; }); advancedPlayer.positionHandler = (p) => setState(() { _position = p; }); } – Berat Kurt Sep 22 '20 at 11:38

1 Answers1

0

Try using the latest version (3.0.1) of AudioPlayers, it should be solved there.

spydon
  • 9,372
  • 6
  • 33
  • 63