diff --git a/static/app.js b/static/app.js index b70ad34..16595a7 100644 --- a/static/app.js +++ b/static/app.js @@ -39,6 +39,7 @@ import { exportSettings, importSettings, } from './js/settings-io.js'; +import { audio } from './js/audio-el.js'; // Demo analytics — real impl set by demo.js; no-op in normal builds window.feedBackDemoTrack = window.feedBackDemoTrack ?? null; @@ -3419,7 +3420,9 @@ function retuneSong(filename, title, tuning, target) { } // ── Player ─────────────────────────────────────────────────────────────── -const audio = document.getElementById('audio'); +// `audio` now lives in ./js/audio-el.js so carved-out modules can reach the +// player without importing app.js back (which would close a cycle). Same +// element, same handle, same lookup — just imported instead of declared here. let isPlaying = false; let _lastSongPositionEventAt = 0; diff --git a/static/js/audio-el.js b/static/js/audio-el.js new file mode 100644 index 0000000..bfca40d --- /dev/null +++ b/static/js/audio-el.js @@ -0,0 +1,17 @@ +// The one