mirror of
https://github.com/9001/copyparty.git
synced 2025-08-18 01:22:13 -06:00
audio seek with scrollbar on progressbar
This commit is contained in:
parent
229c3f5dab
commit
b75ce909c8
|
@ -858,7 +858,10 @@ function playpause(e) {
|
||||||
ebi('bplay').onclick = playpause;
|
ebi('bplay').onclick = playpause;
|
||||||
ebi('bprev').onclick = prev_song;
|
ebi('bprev').onclick = prev_song;
|
||||||
ebi('bnext').onclick = next_song;
|
ebi('bnext').onclick = next_song;
|
||||||
ebi('barpos').onclick = function (e) {
|
|
||||||
|
var bar = ebi('barpos');
|
||||||
|
|
||||||
|
bar.onclick = function (e) {
|
||||||
if (!mp.au) {
|
if (!mp.au) {
|
||||||
play(0, true);
|
play(0, true);
|
||||||
return mp.fade_in();
|
return mp.fade_in();
|
||||||
|
@ -869,6 +872,19 @@ function playpause(e) {
|
||||||
|
|
||||||
seek_au_mul(x * 1.0 / rect.width);
|
seek_au_mul(x * 1.0 / rect.width);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (!is_touch)
|
||||||
|
bar.onwheel = function (e) {
|
||||||
|
var dist = Math.sign(e.deltaY) * 15;
|
||||||
|
if (Math.abs(e.deltaY) < 30 && !e.deltaMode)
|
||||||
|
dist = e.deltaY;
|
||||||
|
|
||||||
|
if (!dist || !mp.au)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
seek_au_rel(dist);
|
||||||
|
ev(e);
|
||||||
|
};
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue