Player seek feature
This commit is contained in:
@@ -7,3 +7,16 @@ $ ->
|
||||
BH.Player.pause()
|
||||
$(".player .controls .next").live "click", (e) ->
|
||||
BH.Player.next()
|
||||
|
||||
$(".player .move-it")
|
||||
.live "mousedown", (e) ->
|
||||
BH.Player.move_it_mousedown = true
|
||||
.live "mouseup", (e) ->
|
||||
BH.Player.move_it_mousedown = false
|
||||
return false unless BH.Player.current_track?
|
||||
percent = e.offsetX / $(this).width()
|
||||
BH.Player.seek(percent)
|
||||
.live "mousemove", (e) ->
|
||||
return false unless BH.Player.move_it_mousedown and BH.Player.current_track?
|
||||
percent = e.offsetX / $(this).width() * 100
|
||||
$(".player .progress-bar .bar").css(width: "#{percent}%")
|
||||
|
||||
@@ -3,3 +3,7 @@ $ ->
|
||||
e.preventDefault()
|
||||
id = parseInt($(this).parent().data("id"), 10)
|
||||
BH.Player.tracks.get(id).play()
|
||||
$(".track-pause").live "click", (e) ->
|
||||
e.preventDefault()
|
||||
id = parseInt($(this).parent().data("id"), 10)
|
||||
BH.Player.tracks.get(id).pause()
|
||||
|
||||
Reference in New Issue
Block a user