Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No Events Firing #3

Open
paullryan opened this issue Jun 9, 2015 · 5 comments
Open

No Events Firing #3

paullryan opened this issue Jun 9, 2015 · 5 comments

Comments

@paullryan
Copy link

After calling createAudioPlayer with a working player (I can play and manipulate a queue) I can't get any events to fire. I've tried registering as follows:

var audioPlayer = spotify.createAudioPlayer(clientId);
audioPlayer.addEventListener(spotify.AudioPlayer.EVENT_LOGIN, function(message){
   console.log('logged into player ' + message);
 });
audioPlayer.addEventListener(spotify.AudioPlayer.EVENT_MESSAGE, function(message){
   console.log('Got spotify message ' + message);
 });
audioPlayer.addEventListener(spotify.AudioPlayer.EVENT_PLAYBACK_STATUS, function(status){
   console.log('got playback status ' + status);
 });
audioPlayer.addEventListener(spotify.AudioPlayer.EVENT_ERROR, function(error){
   console.error(error);
 });
audioPlayer.addEventListener('volumeChanged', function(error, value){
   console.log('volumeChanged')
 });
audioPlayer.addEventListener('skippedToNextTrack', function(error, value){
   console.log('skippedToNextTrack')
 });
 audioPlayer.addEventListener('skippedToPreviousTrack', function(error, value){
   console.log('skippedToPreviousTrack')
 });

None of these ever get fired but my music is playing after calling audioPlayer play on a playlist. Any suggestions as to what I'm doing wrong.

@paullryan
Copy link
Author

Oh and I'm calling login after I've added the event listeners.

@paullryan
Copy link
Author

I've been digging and it appears the events are making it to eventNotificationFromAudioPlayer they just are not getting thrown back up into onEventCallback. I'm wondering if the registration for the callbackID is valid.

@paullryan
Copy link
Author

I've added a branch on my repository at https://github.com/ambientBOX/cordova-spotify-plugin/tree/fix-event-callback that fixes this issue but I don't believe it's complete. Can you please review it, if it's good enough I'll submit as pull.

@timflapper
Copy link
Owner

I'll have a look at this issue as soon as I have some time later this week. Great work on initiating the fix.

@timflapper
Copy link
Owner

I believe I found a fix for this issue. I'll create a new release as soon as possible.

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

No branches or pull requests

2 participants