cordova-music-controls-plugin
cordova-music-controls-plugin copied to clipboard
Controls are not firing
Control are not firing event all the time, it is fairing one or twice after so many time of try
+1
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();
});