mirror of
https://github.com/9001/copyparty.git
synced 2025-08-18 01:22:13 -06:00
try to discourage android from stopping playback...
...when continuing into the next folder accidentally introduces a neat bonus feature where the music no longer stops while you go looking for stuff to play next
This commit is contained in:
parent
03193de6d0
commit
33442026b8
|
@ -1499,6 +1499,7 @@ var mpl = (function () {
|
||||||
if (!r.os_ctl)
|
if (!r.os_ctl)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
// dead code; left for debug
|
||||||
navigator.mediaSession.metadata = null;
|
navigator.mediaSession.metadata = null;
|
||||||
navigator.mediaSession.playbackState = "paused";
|
navigator.mediaSession.playbackState = "paused";
|
||||||
|
|
||||||
|
@ -1538,12 +1539,13 @@ var re_au_native = can_ogg ? /\.(aac|flac|m4a|mp3|ogg|opus|wav)$/i :
|
||||||
|
|
||||||
|
|
||||||
// extract songs + add play column
|
// extract songs + add play column
|
||||||
|
var mpo = { "au": null, "au2": null, "acs": null };
|
||||||
function MPlayer() {
|
function MPlayer() {
|
||||||
var r = this;
|
var r = this;
|
||||||
r.id = Date.now();
|
r.id = Date.now();
|
||||||
r.au = null;
|
r.au = mpo.au;
|
||||||
r.au = null;
|
r.au2 = mpo.au2;
|
||||||
r.au2 = null;
|
r.acs = mpo.acs;
|
||||||
r.tracks = {};
|
r.tracks = {};
|
||||||
r.order = [];
|
r.order = [];
|
||||||
r.cd_pause = 0;
|
r.cd_pause = 0;
|
||||||
|
@ -2483,7 +2485,7 @@ var afilt = (function () {
|
||||||
if (mp.acs)
|
if (mp.acs)
|
||||||
mp.acs.disconnect();
|
mp.acs.disconnect();
|
||||||
|
|
||||||
mp.acs = null;
|
mp.acs = mpo.acs = null;
|
||||||
};
|
};
|
||||||
|
|
||||||
r.apply = function () {
|
r.apply = function () {
|
||||||
|
@ -2722,7 +2724,9 @@ function play(tid, is_ev, seek) {
|
||||||
|
|
||||||
if (mp.au) {
|
if (mp.au) {
|
||||||
mp.au.pause();
|
mp.au.pause();
|
||||||
clmod(ebi('a' + mp.au.tid), 'act');
|
var el = ebi('a' + mp.au.tid);
|
||||||
|
if (el)
|
||||||
|
clmod(el, 'act');
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
mp.au = new Audio();
|
mp.au = new Audio();
|
||||||
|
@ -2895,7 +2899,7 @@ function autoplay_blocked(seek) {
|
||||||
modal.confirm('<h6>' + L.mm_hashplay + '</h6>\n«' + esc(fn) + '»', function () {
|
modal.confirm('<h6>' + L.mm_hashplay + '</h6>\n«' + esc(fn) + '»', function () {
|
||||||
// chrome 91 may permanently taint on a failed play()
|
// chrome 91 may permanently taint on a failed play()
|
||||||
// depending on win10 settings or something? idk
|
// depending on win10 settings or something? idk
|
||||||
mp.au = null;
|
mp.au = mpo.au = null;
|
||||||
|
|
||||||
play(tid, true, seek);
|
play(tid, true, seek);
|
||||||
mp.fade_in();
|
mp.fade_in();
|
||||||
|
@ -7280,18 +7284,16 @@ function reload_mp() {
|
||||||
if (afilt)
|
if (afilt)
|
||||||
afilt.stop();
|
afilt.stop();
|
||||||
|
|
||||||
mp.au.pause();
|
mpo.au = mp.au;
|
||||||
mp.au = null;
|
mpo.au2 = mp.au2;
|
||||||
|
mpo.acs = mp.acs;
|
||||||
mpl.unbuffer();
|
mpl.unbuffer();
|
||||||
}
|
}
|
||||||
mpl.stop();
|
|
||||||
var plays = QSA('tr>td:first-child>a.play');
|
var plays = QSA('tr>td:first-child>a.play');
|
||||||
for (var a = plays.length - 1; a >= 0; a--)
|
for (var a = plays.length - 1; a >= 0; a--)
|
||||||
plays[a].parentNode.innerHTML = '-';
|
plays[a].parentNode.innerHTML = '-';
|
||||||
|
|
||||||
mp = new MPlayer();
|
mp = new MPlayer();
|
||||||
if (afilt)
|
|
||||||
afilt.acst = {};
|
|
||||||
|
|
||||||
setTimeout(pbar.onresize, 1);
|
setTimeout(pbar.onresize, 1);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue