Skip to content
Permalink
Browse files

Fix timeUpdate methods overriding one another and breaking audio prog…

…ress
  • Loading branch information...
Benjamin den Boer
Benjamin den Boer committed Sep 15, 2016
1 parent 39a9eea commit e95310af99f3ab9d4c3dc5c9d3cc514f65afe840
Showing with 1 addition and 7 deletions.
  1. +1 −7 module/audio.coffee
@@ -112,9 +112,6 @@ class exports.AudioPlayer extends Layer
@time.style = @timeStyle
@time.html = "0:00"

@player.ontimeupdate = =>
@time.html = @player.formatTime()

getTimeLeft: (showTimeLeft) =>
@_checkBoolean(showTimeLeft)
@_showTimeLeft = showTimeLeft
@@ -131,9 +128,6 @@ class exports.AudioPlayer extends Layer
@player.on "loadedmetadata", =>
@timeLeft.html = "-" + @player.formatTimeLeft()

@player.ontimeupdate = =>
@timeLeft.html = "-" + @player.formatTimeLeft()

setProgress: (showProgress) ->
@_checkBoolean(showProgress)

@@ -185,7 +179,7 @@ class exports.AudioPlayer extends Layer
@progressBar.knob.midX = @progressBar.pointForValue(@player.currentTime)
@progressBar.knob.draggable.isMoving = false

if @time and @timeLeft
if @time or @timeLeft
@time.html = @player.formatTime()
@timeLeft.html = "-" + @player.formatTimeLeft()

0 comments on commit e95310a

Please sign in to comment.
You can’t perform that action at this time.