mirror of
https://github.com/chenasraf/castroulette-receiver.git
synced 2026-05-17 17:58:05 +00:00
Stop sound on click
This commit is contained in:
@@ -17,11 +17,13 @@ class StateDefinition
|
||||
constructor: ({@handler = window.stateHandler, @audio} = {}) ->
|
||||
console.debug 'statedef', arguments...
|
||||
if @audio?
|
||||
audio = new Audio("/static/sounds/#{@audio}")
|
||||
audio.play()
|
||||
@soundFile = new Audio("/static/sounds/#{@audio}")
|
||||
@soundFile.play()
|
||||
|
||||
onMessage: (message) ->
|
||||
@handler.resetState()
|
||||
@soundFile.pause()
|
||||
@soundFile.currentTime = 0
|
||||
|
||||
class SplashState extends StateDefinition
|
||||
constructor: ->
|
||||
|
||||
Reference in New Issue
Block a user