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

jukebox/player: Pandora not advancing to next song when song is complete #53

Open
jmouel opened this issue Jan 11, 2013 · 1 comment
Open

Comments

@jmouel
Copy link

jmouel commented Jan 11, 2013

There's a JS error when Pandora finishes a song. It causes the player to stop progressing in the queue.

@jmouel
Copy link
Author

jmouel commented Jan 11, 2013

Not sure if this is a good way to submit patches... let me know if not.

From 2d9cd87f6ef7e64696d44f63c13a1ceb2c148f9c Mon Sep 17 00:00:00 2001
From: Jason Ouellette <jason@parkstconsulting.com>
Date: Fri, 11 Jan 2013 11:15:45 -0800
Subject: [PATCH] https://github.com/nixme/warble/issues/53

---
 app/assets/javascripts/ui/player/pandora.js.coffee |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/app/assets/javascripts/ui/player/pandora.js.coffee b/app/assets/javascripts/ui/player/pandora.js.coffee
index 7dac659..0fe648f 100644
--- a/app/assets/javascripts/ui/player/pandora.js.coffee
+++ b/app/assets/javascripts/ui/player/pandora.js.coffee
@@ -21,11 +21,9 @@ class Warble.PandoraPlayerView extends Backbone.View
       @$('audio').bind 'canplay', ->
         @volume = (vol ? DEFAULT_VOLUME) / 100
         @play()  # chrome 10 bug workaround: autoplay on <audio> doesn't work
-      @$('audio').bind 'ended', @finished   # ended doesn't bubble so backbone can't handle it
+      @$('audio').bind 'ended', =>
+        @trigger 'song:finished' # ended doesn't bubble so backbone can't handle it

   volume: ->
     value = @model.get('volume') / 100
     @$('audio').each -> @volume = value
-
-  finished: ->
-    @trigger 'song:finished'
--
1.7.9.6 (Apple Git-31.1)

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

1 participant