Play online sound only once at time.

This commit is contained in:
Martin Edenhofer 2016-02-29 13:42:18 +01:00
parent 84581e372d
commit 3713014079

View file

@ -19,8 +19,11 @@ class App.OnlineNotification extends App.Model
preferences = App.Session.get('preferences') preferences = App.Session.get('preferences')
return if !preferences return if !preferences
return if !App.OnlineNotification.soundEnabled() return if !App.OnlineNotification.soundEnabled()
sound = App.Config.get('latest_online_notification_sond')
return if sound && !sound.ended
file = App.OnlineNotification.soundFile() file = App.OnlineNotification.soundFile()
sound = new Audio("assets/sounds/#{file}") sound = new Audio("assets/sounds/#{file}")
App.Config.set('latest_online_notification_sond', sound)
sound.play() sound.play()
### ###