Permalink
Browse files

too many issues, just using modified version

  • Loading branch information...
1 parent 5445f14 commit 2cd6e2cd94bed9449a3446eed9015520150fa6dc @joeellis joeellis committed Dec 27, 2012
Showing with 25 additions and 21 deletions.
  1. +25 −21 backbone.soundmanager2.coffee
@@ -52,7 +52,9 @@ class Backbone.SoundManager2
# Returns newly changed self.
release: ->
- @fadeout() if @sound
+ if @sound
+ @fadeout =>
+ @sound.destruct()
@sound = null
@@ -65,15 +67,24 @@ class Backbone.SoundManager2
this
- # Fade out the current sound's volume to 0 and destroy it.
+ # Fade out the current sound's volume to 0 and run any callbacks.
#
# Examples
#
# player.fadeout() # => volume smoothly goes to zero.
#
# Returns self
- fadeout: ->
+ fadeout: (callback) ->
+
+ # Fade out started causing issues when the track sharing went in.
+ # Removing this ability for now until we can circle back.
+
+ callback()
+ return this
+
+ # Original fade out. Can't get here now.
+
s = @sound
vol = @volume * 100
@@ -83,7 +94,7 @@ class Backbone.SoundManager2
if vol > 0
_.delay fnc, 10
else
- s.destruct()
+ callback()
fnc()
@@ -110,31 +121,30 @@ class Backbone.SoundManager2
if @sound.paused then "paused" else "playing"
- # Determine if a sound has already been already loaded.
+ # Determine if current playable is equal to playable passed in.
#
# Examples
#
# player.load track
- # player.hasSoundLoaded() # => true
+ # player.isAlreadyPlaying track # => true
#
# Returns boolean.
- hasSoundLoaded: ->
- @sound?
+ isAlreadyPlaying: (playable) ->
+ @playable? and @playable.id == playable.id
- # Determine if current playable is equal to playable passed in.
+ # Determine if a sound has already been already loaded.
#
# Examples
#
# player.load track
- # player.isAlreadyPlaying track # => true
+ # player.hasSoundLoaded() # => true
#
# Returns boolean.
- isAlreadyPlaying: (playable) ->
- @playable? and @playable.id == playable.id
-
+ hasSoundLoaded: ->
+ @sound?
# Test if a `playable` has getAudioURL() method.
@@ -289,7 +299,7 @@ class Backbone.SoundManager2
@load playable
- # Stop the current sound.
+ # Stop for the current sound.
#
# Examples
#
@@ -299,14 +309,8 @@ class Backbone.SoundManager2
return unless @sound?
@sound.stop()
- # Pause the current sound.
- #
- # Examples
- #
- # player.pause() # => track will pause
-
pause: ->
return unless @sound
@fadeout =>
@sound.pause()
- @sound.setVolume 100
+ @sound.setVolume 100

0 comments on commit 2cd6e2c

Please sign in to comment.