Skip to content

Commit 569568b

Browse files
Fix persistent player: resume across pages, remove inline embeds from index
- restore() now waits for loadedmetadata before seeking – browsers silently drop currentTime on a not-yet-loaded Audio so the player was stuck at 0:00 - Added pulsing "TAP TO RESUME" hint on the player bar after page navigation - Mixcloud / YouTube cards on the index now navigate to the show page on play instead of opening an iframe inline – Mixcloud audio lives inside the iframe and cannot be routed through our Audio element; show pages already have the embed at full width so this is the only reliable way to play them - setNowPlaying() no longer kills local audio – if a file is playing in the bar it stays; the embed indicator is skipped - Removed dead togglePlay function and unused player-container divs Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent bc2c66f commit 569568b

21 files changed

Lines changed: 64 additions & 213 deletions

assets/player.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@
3333
.kp-progress-fill { height:100%; background:#00ff00; width:0%; }
3434
.kp-time { color:#fff; font-family:monospace; font-size:.7rem; white-space:nowrap; min-width:72px; text-align:right; }
3535

36+
/* resume hint (shown after page-nav restore) */
37+
.kp-resume { color:#00ff00; font-family:monospace; font-size:.75rem; font-weight:bold; text-align:center; padding:2px 0; animation:kp-pulse 1.4s ease-in-out infinite; }
38+
@keyframes kp-pulse { 0%,100%{opacity:1} 50%{opacity:.3} }
39+
3640
/* embed / youtube "now playing" badge */
3741
.kp-badge {
3842
display:inline-flex; align-items:center; gap:6px;

assets/player.js

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,11 @@
3636
persist();
3737
}
3838

39-
/* indicator only – used for Mixcloud / YouTube embeds */
39+
/* indicator only – used for Mixcloud / YouTube embeds.
40+
If local audio is currently playing we leave the player bar alone;
41+
the embed is an iframe we can't control anyway. */
4042
function setNowPlaying(data) {
43+
if (audio && !audio.paused) return;
4144
killAudio();
4245
state = {
4346
id: data.id,
@@ -56,19 +59,34 @@
5659
var s = JSON.parse(localStorage.getItem(KEY));
5760
if (!s || s.type !== 'local_audio' || (!s.src && !s.audio_url)) return;
5861
state = s;
62+
state.playing = false;
5963
renderFull();
64+
syncBtn();
6065
audio = new Audio(state.audio_url || state.src);
6166
audio.addEventListener('timeupdate', tick);
6267
audio.addEventListener('ended', onEnded);
63-
/* browsers block autoplay without gesture – show paused state */
64-
audio.currentTime = state.time || 0;
65-
state.playing = false;
66-
syncBtn();
68+
/* seek only after the browser knows the duration; earlier calls are silently dropped */
69+
audio.addEventListener('loadedmetadata', function onMeta() {
70+
audio.removeEventListener('loadedmetadata', onMeta);
71+
audio.currentTime = state.time || 0;
72+
tick(); // paint progress bar at the saved position
73+
});
74+
/* pulsing hint so user knows audio was playing */
75+
var mid = document.getElementById('kp-mid');
76+
if (mid) {
77+
var hint = document.createElement('div');
78+
hint.id = 'kp-resume';
79+
hint.className = 'kp-resume';
80+
hint.textContent = '\u25B6 TAP TO RESUME';
81+
mid.insertBefore(hint, mid.firstChild);
82+
}
6783
} catch (e) { /* ignore */ }
6884
}
6985

7086
function togglePlay() {
7187
if (!audio) return;
88+
var hint = document.getElementById('kp-resume');
89+
if (hint) hint.parentNode.removeChild(hint);
7290
if (audio.paused) { audio.play(); state.playing = true; }
7391
else { audio.pause(); state.playing = false; }
7492
syncBtn();

index.html

Lines changed: 18 additions & 126 deletions
Large diffs are not rendered by default.

shows/bots-religion.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ <h1>NOTHING<br>IS HOLY</h1>
223223
</div>
224224

225225
<div class="footer">
226-
KLOOM LO KADOSH RADIO ARCHIVE // GENERATED 2026-02-03 09:47:42
226+
KLOOM LO KADOSH RADIO ARCHIVE // GENERATED 2026-02-03 10:03:05
227227
</div>
228228

229229
<script src="../assets/player.js"></script>

shows/creative-destruction-2025-12-02.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ <h1>NOTHING<br>IS HOLY</h1>
223223
</div>
224224

225225
<div class="footer">
226-
KLOOM LO KADOSH RADIO ARCHIVE // GENERATED 2026-02-03 09:47:42
226+
KLOOM LO KADOSH RADIO ARCHIVE // GENERATED 2026-02-03 10:03:05
227227
</div>
228228

229229
<script src="../assets/player.js"></script>

shows/hightolerance-2020-02-02.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ <h1>NOTHING<br>IS HOLY</h1>
239239
</div>
240240

241241
<div class="footer">
242-
KLOOM LO KADOSH RADIO ARCHIVE // GENERATED 2026-02-03 09:47:43
242+
KLOOM LO KADOSH RADIO ARCHIVE // GENERATED 2026-02-03 10:03:05
243243
</div>
244244

245245
<script src="../assets/player.js"></script>

shows/kol-hazuti-breakup.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ <h1>NOTHING<br>IS HOLY</h1>
223223
</div>
224224

225225
<div class="footer">
226-
KLOOM LO KADOSH RADIO ARCHIVE // GENERATED 2026-02-03 09:47:43
226+
KLOOM LO KADOSH RADIO ARCHIVE // GENERATED 2026-02-03 10:03:05
227227
</div>
228228

229229
<script src="../assets/player.js"></script>

shows/kol-hazuti-forbidden.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ <h1>NOTHING<br>IS HOLY</h1>
223223
</div>
224224

225225
<div class="footer">
226-
KLOOM LO KADOSH RADIO ARCHIVE // GENERATED 2026-02-03 09:47:43
226+
KLOOM LO KADOSH RADIO ARCHIVE // GENERATED 2026-02-03 10:03:05
227227
</div>
228228

229229
<script src="../assets/player.js"></script>

shows/kol-hazuti-god.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ <h1>NOTHING<br>IS HOLY</h1>
223223
</div>
224224

225225
<div class="footer">
226-
KLOOM LO KADOSH RADIO ARCHIVE // GENERATED 2026-02-03 09:47:43
226+
KLOOM LO KADOSH RADIO ARCHIVE // GENERATED 2026-02-03 10:03:05
227227
</div>
228228

229229
<script src="../assets/player.js"></script>

shows/kol-hazuti-love.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ <h1>NOTHING<br>IS HOLY</h1>
223223
</div>
224224

225225
<div class="footer">
226-
KLOOM LO KADOSH RADIO ARCHIVE // GENERATED 2026-02-03 09:47:43
226+
KLOOM LO KADOSH RADIO ARCHIVE // GENERATED 2026-02-03 10:03:05
227227
</div>
228228

229229
<script src="../assets/player.js"></script>

0 commit comments

Comments
 (0)