diff --git a/copyparty/web/browser.js b/copyparty/web/browser.js index 8ae81d17..a3ce9a9f 100644 --- a/copyparty/web/browser.js +++ b/copyparty/web/browser.js @@ -1499,6 +1499,7 @@ var mpl = (function () { if (!r.os_ctl) return; + // dead code; left for debug navigator.mediaSession.metadata = null; 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 +var mpo = { "au": null, "au2": null, "acs": null }; function MPlayer() { var r = this; r.id = Date.now(); - r.au = null; - r.au = null; - r.au2 = null; + r.au = mpo.au; + r.au2 = mpo.au2; + r.acs = mpo.acs; r.tracks = {}; r.order = []; r.cd_pause = 0; @@ -2483,7 +2485,7 @@ var afilt = (function () { if (mp.acs) mp.acs.disconnect(); - mp.acs = null; + mp.acs = mpo.acs = null; }; r.apply = function () { @@ -2722,7 +2724,9 @@ function play(tid, is_ev, seek) { if (mp.au) { mp.au.pause(); - clmod(ebi('a' + mp.au.tid), 'act'); + var el = ebi('a' + mp.au.tid); + if (el) + clmod(el, 'act'); } else { mp.au = new Audio(); @@ -2895,7 +2899,7 @@ function autoplay_blocked(seek) { modal.confirm('