Permalink
Browse files

Fix auto play.

  • Loading branch information...
1 parent 46f5f22 commit 23bd00cc15e7024f590205f34f23492c05ac033b Alexis Bernard committed Dec 6, 2012
Showing with 3 additions and 3 deletions.
  1. +3 −3 app/assets/javascripts/player.js.coffee
View
6 app/assets/javascripts/player.js.coffee
@@ -31,7 +31,7 @@ class @Player
autoPlay: () ->
if window.location.hash && $(window.location.hash)[0]
- @play($(window.location.hash)[0])
+ @play(@findTrackByAnchor(window.location.hash.replace('#', '')))
findTrackByAnchor: (anchor) ->
for track in @tracks()
@@ -88,15 +88,15 @@ class @Player
if (track != @playingTrack && track != @pausedTrack)
$(@official).attr('src', track.streamUrl + '?api_key=4qpH1KdXhJF64NPD3zdK7t2gpTF8vHHz')
@soundcloud.pause()
- @youtube.pause()
+ @youtube.pause() if @youtube.pause
@official.play()
@official
playSoundcloud: (track) ->
if (track != @playingTrack && track != @pausedTrack)
$(@soundcloud).attr('src', track.streamUrl + '?client_id=880faec8a616cb8ddc4fc35fe410b644')
@official.pause()
- @youtube.pause()
+ @youtube.pause() if @youtube.pause
@soundcloud.play()
@soundcloud

0 comments on commit 23bd00c

Please sign in to comment.