fix: code-review round 1 — 4 findings
- og: guard safe_abs_path's None (missing/gc'd poster) before _jpeg_size, else the public /watch OG render crashed with an uncaught AttributeError - channels: hoist the priority step button to module scope so it no longer remounts on every hold-repeat tick (which dropped the pointer capture and could let a hold run away on pointer drift) - watch: only route audio through Web Audio on iOS (where a backgrounded <video> is suspended); other platforms keep their reliable native audio, avoiding a foreground-silence risk if the AudioContext can't resume - share: drop the unstable `create` mutation object from the auto-create effect deps (it changes every render); the links.data trigger + autoTried ref already fire it exactly once The clipboard-on-focus finding is intended (the user explicitly asked for auto-paste on focus; the read is best-effort and browsers reject it without a gesture, so no real prompt fires).
This commit is contained in:
@@ -25,6 +25,14 @@ function useBackgroundAudio(
|
||||
useEffect(() => {
|
||||
const video = videoRef.current;
|
||||
if (!video || !ready) return;
|
||||
// Only iOS suspends a backgrounded <video> — and only there does rerouting the audio through
|
||||
// Web Audio buy anything. Every other platform backgrounds media audio natively, so we leave
|
||||
// their <video> untouched rather than risk the reroute leaving foreground audio silent if the
|
||||
// AudioContext can't resume. (iPadOS reports as MacIntel + touch.)
|
||||
const isIOS =
|
||||
/iP(hone|ad|od)/.test(navigator.userAgent) ||
|
||||
(navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1);
|
||||
if (!isIOS) return;
|
||||
const wire = () => {
|
||||
if (wiredRef.current) {
|
||||
ctxRef.current?.resume().catch(() => {});
|
||||
|
||||
Reference in New Issue
Block a user