fix: wrong play bar behavior when dragging or clicking, #166.
This commit is contained in:
parent
ebbacf652e
commit
92b3a3c7be
@ -64,7 +64,7 @@ class ReverseProxied(object):
|
||||
|
||||
|
||||
web = Flask(__name__)
|
||||
web.config['TEMPLATES_AUTO_RELOAD'] = True
|
||||
#web.config['TEMPLATES_AUTO_RELOAD'] = True
|
||||
log = logging.getLogger("bot")
|
||||
user = 'Remote Control'
|
||||
|
||||
|
@ -1072,13 +1072,13 @@ playerBarBox.addEventListener('mousedown', function () {
|
||||
});
|
||||
playerBarBox.addEventListener('mouseup', function (event) {
|
||||
playerBarBox.removeEventListener('mousemove', playheadDragged);
|
||||
let percent = event.offsetX / playerBarBox.clientWidth;
|
||||
let percent = (event.clientX - playerBarBox.getBoundingClientRect().x) / playerBarBox.clientWidth;
|
||||
request('post', {move_playhead: percent * currentPlayingItem.duration});
|
||||
playhead_dragging = false;
|
||||
});
|
||||
|
||||
function playheadDragged(event){
|
||||
let percent = event.offsetX / playerBarBox.clientWidth;
|
||||
let percent = (event.clientX - playerBarBox.getBoundingClientRect().x) / playerBarBox.clientWidth;
|
||||
setProgressBar(playerBar, percent, secondsToStr(percent * currentPlayingItem.duration));
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user