Ads play once on channel 11, separate from music
- Add dedicated ad playback system (no loop, own channel) - Ad channel defaults to 11, saved/loaded with audio settings - Separate play_ad/stop_ad methods and API endpoints - Frontend stop button now calls /api/ads/stop instead of stopMusic Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -131,7 +131,7 @@ function initEventListeners() {
|
||||
|
||||
// Ads
|
||||
document.getElementById('ad-play-btn')?.addEventListener('click', playAd);
|
||||
document.getElementById('ad-stop-btn')?.addEventListener('click', stopMusic);
|
||||
document.getElementById('ad-stop-btn')?.addEventListener('click', stopAd);
|
||||
|
||||
// Settings
|
||||
document.getElementById('settings-btn')?.addEventListener('click', async () => {
|
||||
@@ -686,6 +686,10 @@ async function playAd() {
|
||||
});
|
||||
}
|
||||
|
||||
async function stopAd() {
|
||||
await fetch('/api/ads/stop', { method: 'POST' });
|
||||
}
|
||||
|
||||
|
||||
// --- Sound Effects (Server-Side) ---
|
||||
async function loadSounds() {
|
||||
|
||||
Reference in New Issue
Block a user