- Timestamp:
- 05/20/2026 10:14:01 PM (4 months ago)
- Branches:
- main
- Children:
- 353c39c
- Parents:
- 46f23fd
- git-author:
- Robin Genis <roboburr@…> (05/20/2026 10:13:26 PM)
- git-committer:
- Robin Genis <roboburr@…> (05/20/2026 10:14:01 PM)
- Location:
- src/views
- Files:
-
- 3 edited
-
pages/admin-audio.ejs (modified) (2 diffs)
-
partials/track-editor.ejs (modified) (1 diff)
-
shell.ejs (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
src/views/pages/admin-audio.ejs
r46f23fd r21522ae 583 583 function resyncAll() { 584 584 const audio = document.getElementById('audio-element'); 585 const player = window.pcmsAudioPlayer; 585 586 const playing = audio && !audio.paused && !audio.ended; 586 const currentSrc = audio ? audio.src : ''; 587 // audio.src is now a blob: URL (Spotify-style playback), so compare 588 // against the player's logical track URL, not the element src. 589 const cur = player && player.currentTrack(); 590 const curUrl = cur ? cur.url : ''; 587 591 buttons.forEach(b => { 588 const isThisOne = playing && cur rentSrc.endsWith(b.dataset.streamUrl);592 const isThisOne = playing && curUrl === b.dataset.streamUrl; 589 593 setIcon(b, isThisOne); 590 594 }); … … 617 621 }; 618 622 619 // If this exact track is already playing, toggle pause/play instead620 // of restarting from zero. 621 const audio = document.getElementById('audio-element');622 if ( audio && audio.src.endsWith(url)) {623 if ( audio.paused) player.play();624 else player.pause();623 // If this exact track is already current, toggle pause/play instead 624 // of restarting from zero. Compare logical URLs (audio.src is a blob:). 625 const cur = player.currentTrack(); 626 if (cur && cur.url === url) { 627 if (player.isPlaying()) player.pause(); 628 else player.play(); 625 629 return; 626 630 } -
src/views/partials/track-editor.ejs
r46f23fd r21522ae 445 445 }; 446 446 const isOurTrack = () => { 447 const audio = document.getElementById('audio-element'); 448 return audio && track.stream_url && audio.src.endsWith(track.stream_url); 447 // audio.src is a blob: URL (Spotify-style playback) — compare against 448 // the player's logical current-track URL instead. 449 const player = window.pcmsAudioPlayer; 450 const cur = player && player.currentTrack(); 451 return !!(cur && track.stream_url && cur.url === track.stream_url); 449 452 }; 450 453 const resync = () => { -
src/views/shell.ejs
r46f23fd r21522ae 277 277 ?v=N — cache-buster: bump bij elke audio-player.js wijziging zodat 278 278 Cloudflare (max-age=1y) niet de oude versie blijft serveren. --> 279 <script src="/assets/js/audio-player.js?v= 3"></script>279 <script src="/assets/js/audio-player.js?v=5"></script> 280 280 <% if (site && site.enable_audio_player && audioTracks && audioTracks.length > 0) { %> 281 281 <script>window.PCMS_SITE_TRACKS = <%- JSON.stringify(audioTracks) %>;</script>
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)