diff --git a/PRIMER.md b/PRIMER.md index f54cc9d..a140a03 100644 --- a/PRIMER.md +++ b/PRIMER.md @@ -817,6 +817,7 @@ Automatic, from the show's location; there is no setting. `lib/units.js` reverse | 0.33.280-beta.1 | **iPhone/iPad: the viewer page no longer runs out of memory with the player open.** Why: on an iPad (Safari and the ShowPilot app alike) the page reloaded after a few minutes of playing; the iOS memory report showed the page's web process at ~1.9 GB, killed at the per-process limit, while the page alone with the player closed was fine. The player's frosted-glass blur (`backdrop-filter` on `#of-listen-panel`, the fixed progress strip and the time pill) is re-rendered every frame over anything moving behind it (a template's falling snow, the live bulbs, the ticking time) and iOS's web engine holds on to that memory. On Apple touch devices (iPhone/iPod/iPad, including iPadOS's desktop user agent) a small stylesheet turns those blurs off; the panels keep their dark backgrounds. Other platforms unchanged. Player cache-buster 149. Checked: `node --check`; headless Chrome with an iPad user agent (style present, panel `backdrop-filter: none`) and an Android one (unchanged, `blur(8px)`). Main only (audio player). | | 0.33.280-beta.2 | **Live player decorations no longer crash the page on iPhone/iPad.** Why: tests on an iPad narrowed beta.1's memory crash down: page alone fine, player with plain Christmas fine, player with Christmas Live crashed (Safari and the app). The live lights set a CSS variable (`--lvl` on each bulb, `--beat/--treble/--energy` on `#of-deco`) ~30×/s; that restyles the whole subtree including the bulbs' inline SVGs with gradient ``, and iOS's web engine kept the memory until the page hit its ~1.9 GB limit. Now `liveFrame` sets only the glow elements' own `opacity`/`transform` (`.ofd-halo` + `.ofd-hot` per bulb; `.ofd-nyhalo`, `.ofd-nyglint`, `.ofd-nyspots` for New Year's Live), the halos are `will-change: opacity, transform`, the CSS rules keep just the resting values, and inline values are cleared whenever live goes off (`liveOff()`), so the twinkle animation takes over again. Same formulas, same look. Apple touch devices update every 48 ms (~20/s) instead of 30 ms. beta.1's no-blur rule on iPhone/iPad stays (cheaper, not the cause). Player cache-buster 150. Checked: `node --check`; headless Chrome with a stub app bridge: Christmas Live (16 bands requested, halos/hot cores follow the fed levels, no variables on `#of-deco`, muting removes live and clears the inline values so `ofdGlow` resumes), New Year's Live (3 bands, halo/spots follow), plain Christmas (no live). Main only (audio player). | | 0.33.280-beta.3 | **Player blur back on iPhone/iPad.** beta.1 turned off the player's `backdrop-filter` on Apple touch devices as a first guess at the iPad page crash; testing showed the cause was the live decorations' per-frame CSS variables (fixed in beta.2), and the crash still happened with the blur off. The `sp-ios-noblur` stylesheet is removed, so the player looks the same everywhere again. Player cache-buster 151. Checked: `node --check`. Main only (audio player). | +| 0.33.280-beta.4 | **iPhone: the automatic timing check can use the microphone again.** Why: reported in PR #71 by jddocea — on iPhone Safari the mic failed with "audio session category is not compatible with audio capture", because the player keeps the iOS audio session on `'playback'` (so it ignores the mute switch) and that mode doesn't allow recording. `ltGetMic()` now switches `navigator.audioSession.type` to `'play-and-record'` just before `getUserMedia`; `ltDetect()` already sets it back to `'playback'` when the mic closes (success and error paths). The PR's version changed all four `'playback'` assignments, which would have kept every iPhone listener in record mode (risking quieter/earpiece output) and cancelled the reset after measuring, so only the mic path changes. Player cache-buster 152. Checked: `node --check`. Credit: jddocea (diagnosis and first fix). Main only (audio player). | **Plugin version history (this session):** | Version | Change | diff --git a/lib/viewer-renderer.js b/lib/viewer-renderer.js index d18621c..667b713 100644 --- a/lib/viewer-renderer.js +++ b/lib/viewer-renderer.js @@ -1355,7 +1355,7 @@ ${visitorMessages.BOX_CSS}${showButtons.CSS} ${cfg.debug_mic_measure === 1 ? '' : ''} - + `; if (html.includes('')) { html = html.replace('', injection + ''); diff --git a/package.json b/package.json index 2045384..e7d2ca1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "showpilot", - "version": "0.33.280-beta.3", + "version": "0.33.280-beta.4", "description": "Self-hosted light show viewer control server. Falcon Player (FPP) plugin compatible. Replaces Remote Falcon for self-hosters.", "main": "server.js", "scripts": { diff --git a/public/admin/index.html b/public/admin/index.html index 14375cc..4a17bb0 100644 --- a/public/admin/index.html +++ b/public/admin/index.html @@ -2101,7 +2101,7 @@

ShowPilot

ShowPilot - v0.33.280-beta.3 + v0.33.280-beta.4 OFF diff --git a/public/rf-compat.js b/public/rf-compat.js index 723708a..3bffad2 100644 --- a/public/rf-compat.js +++ b/public/rf-compat.js @@ -4101,6 +4101,12 @@ } async function ltGetMic() { const base = { echoCancellation: false, noiseSuppression: false, autoGainControl: false }; + // iOS Safari refuses the mic while the audio session is 'playback' + // ("audio session category is not compatible with audio capture"). + // Switch to play-and-record only for the measurement; ltDetect() puts + // it back to 'playback' when the mic closes, so normal listening is + // unchanged. Feature-detected: a no-op outside Safari. (Thanks jddocea, #71) + try { if (navigator.audioSession) navigator.audioSession.type = 'play-and-record'; } catch (_) {} let stream = await navigator.mediaDevices.getUserMedia({ audio: base }); let devices = []; try {