Fixed a bug with the music player where sometimes it wouldn't loop.

This commit is contained in:
Scott Erickson 2014-03-11 16:23:04 -07:00
parent eac219a2be
commit da58b68fa0

View file

@ -23,7 +23,7 @@ module.exports = class MusicPlayer extends CocoClass
src = e.file src = e.file
if src if src
src = "/file#{src}#{AudioPlayer.ext}" src = "/file#{src}#{AudioPlayer.ext}"
return @currentMusic.play() if src is @currentMusic?.src return @currentMusic.play('none', 0, 0, -1, 0.3) if src is @currentMusic?.src
media = AudioPlayer.getStatus(src) media = AudioPlayer.getStatus(src)
if not media?.loaded if not media?.loaded
AudioPlayer.preloadSound(src) AudioPlayer.preloadSound(src)