From d94b5b3fc950ddf45f28e4458b4c9127c9a2ac78 Mon Sep 17 00:00:00 2001 From: ed Date: Sat, 6 Apr 2024 18:43:45 +0000 Subject: [PATCH] fau doesn't work on iphones; compensate by preloading much earlier --- copyparty/web/browser.js | 4 ++-- copyparty/web/util.js | 4 +--- docs/TODO.md | 3 --- docs/devnotes.md | 15 +++++++++++++++ scripts/sfx.ls | 1 + 5 files changed, 19 insertions(+), 8 deletions(-) diff --git a/copyparty/web/browser.js b/copyparty/web/browser.js index 72a3e9bc..6b4e1db1 100644 --- a/copyparty/web/browser.js +++ b/copyparty/web/browser.js @@ -1464,7 +1464,7 @@ var mpl = (function () { bcfg_bind(r, 'preload', 'au_preload', true); bcfg_bind(r, 'prescan', 'au_prescan', true); bcfg_bind(r, 'fullpre', 'au_fullpre', false); - bcfg_bind(r, 'fau', 'au_fau', MOBILE, function (v) { + bcfg_bind(r, 'fau', 'au_fau', MOBILE && !IPHONE, function (v) { mp.nopause(); if (mp.fau) { mp.fau.pause(); @@ -2534,7 +2534,7 @@ var mpui = (function () { rem = pos > 1 ? len - pos : 999, full = null; - if (rem < (mpl.fullpre ? 7 : 40)) { + if (rem < 7 || (!mpl.fullpre && (rem < 40 || pos > 10))) { preloaded = fpreloaded = mp.au.rsrc; full = false; } diff --git a/copyparty/web/util.js b/copyparty/web/util.js index 4c837877..fcec7107 100644 --- a/copyparty/web/util.js +++ b/copyparty/web/util.js @@ -127,7 +127,7 @@ if ((document.location + '').indexOf(',rej,') + 1) try { console.hist = []; - var CMAXHIST = 100; + var CMAXHIST = 1000; var hook = function (t) { var orig = console[t].bind(console), cfun = function () { @@ -148,8 +148,6 @@ try { hook('error'); } catch (ex) { - if (console.stdlog) - console.log = console.stdlog; console.log('console capture failed', ex); } var crashed = false, ignexd = {}, evalex_fatal = false; diff --git a/docs/TODO.md b/docs/TODO.md index 59a7eb5d..7648a943 100644 --- a/docs/TODO.md +++ b/docs/TODO.md @@ -5,9 +5,6 @@ a living list of upcoming features / fixes / changes, very roughly in order of p * maybe resumable downloads (chrome-only, jank api) * maybe checksum validation (return sha512 of requested range in responses, and probably also warks) -* [github issue #64](https://github.com/9001/copyparty/issues/64) - dirkeys 2nd season - * popular feature request, finally time to refactor browser.js i suppose... - * [github issue #37](https://github.com/9001/copyparty/issues/37) - upload PWA * or [maybe not](https://arstechnica.com/tech-policy/2024/02/apple-under-fire-for-disabling-iphone-web-apps-eu-asks-developers-to-weigh-in/), or [maybe](https://arstechnica.com/gadgets/2024/03/apple-changes-course-will-keep-iphone-eu-web-apps-how-they-are-in-ios-17-4/) diff --git a/docs/devnotes.md b/docs/devnotes.md index 986cba24..57d47d15 100644 --- a/docs/devnotes.md +++ b/docs/devnotes.md @@ -20,6 +20,8 @@ * [just the sfx](#just-the-sfx) * [build from release tarball](#build-from-release-tarball) - uses the included prebuilt webdeps * [complete release](#complete-release) +* [debugging](#debugging) + * [music playback halting on phones](#music-playback-halting-on-phones) - mostly fine on android * [todo](#todo) - roughly sorted by priority * [discarded ideas](#discarded-ideas) @@ -301,6 +303,19 @@ in the `scripts` folder: * run `./rls.sh 1.2.3` which uploads to pypi + creates github release + sfx +# debugging + +## music playback halting on phones + +mostly fine on android, but still haven't find a way to massage iphones into behaving well + +* conditionally starting/stopping mp.fau according to mp.au.readyState <3 or <4 doesn't help +* loop=true doesn't work, and manually looping mp.fau from an onended also doesn't work (it does nothing) +* assigning fau.currentTime in a timer doesn't work, as safari merely pretends to assign it + +can be reproduced with `--no-sendfile --s-wr-sz 8192 --s-wr-slp 0.3 --rsp-slp 6` and then play a collection of small audio files with the screen off, `ffmpeg -i track01.cdda.flac -c:a libopus -b:a 128k -segment_time 12 -f segment smol-%02d.opus` + + # todo roughly sorted by priority diff --git a/scripts/sfx.ls b/scripts/sfx.ls index 407137be..707f6a66 100644 --- a/scripts/sfx.ls +++ b/scripts/sfx.ls @@ -81,6 +81,7 @@ copyparty/web/dd/5.png, copyparty/web/dd/__init__.py, copyparty/web/deps, copyparty/web/deps/__init__.py, +copyparty/web/deps/busy.mp3, copyparty/web/deps/easymde.css, copyparty/web/deps/easymde.js, copyparty/web/deps/marked.js,