Skip to content
This repository has been archived by the owner on Apr 3, 2024. It is now read-only.

Creating lots of events #19

Open
bugragenc opened this issue Dec 31, 2020 · 1 comment
Open

Creating lots of events #19

bugragenc opened this issue Dec 31, 2020 · 1 comment

Comments

@bugragenc
Copy link

hello thank you for your support!
I'm writing a music application and I'm using howler.js as a sound library. I do not have a problem with the player, but I think I am using the music control plugin incorrectly. my problem is as follows;

As you mentioned in the documentation, first I call the "CapacitorMusicControls.create" function from within a service that I created. As far as I understand we can only update the "isPlaying" parameter. Therefore, I tried calling the "CapacitorMusicControls.create" function again every time the song starts, or rather when there is a "play" event because I need to update the "track", "artist" and "cover" information. I destroyed the previous one before recalling its function. however, multiple "eventListeners" occur and the previous function is not deleted so it tries to play the song consecutively for the number of events. What should I do to prevent it from generating "CapacitorMusicControls" over and over every time a song is played, and also how do I update the "track", "artist" and "cover" information if the method I tried is wrong. Thank you.

@Andriah91
Copy link

hello, did you fix the problem? i have the same issue

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants