cordova-music-controls-plugin icon indicating copy to clipboard operation
cordova-music-controls-plugin copied to clipboard

Controls are not firing

Open Kannan2020 opened this issue 5 years ago • 2 comments

Control are not firing event all the time, it is fairing one or twice after so many time of try

Kannan2020 avatar Sep 14 '19 12:09 Kannan2020

+1

thomassimko avatar Sep 26 '19 21:09 thomassimko

You have to wait until the control is created:

const options: MusicControlsOptions = {
        track: sender.name,
        isPlaying: true,
        dismissable: true,
        hasPrev: false,
        hasNext: false,
        hasClose: true
      };
      this.musicControls.create(options).catch((e) => {
        console.log(e);
      }).then( () => {
        this.musicControls.subscribe().subscribe(action => {
          console.log(action);
        });
        this.musicControls.listen();
      });

simontribus avatar Oct 26 '19 09:10 simontribus