diff --git a/static/js/app.js b/static/js/app.js index 32bdeee..e01dee1 100644 --- a/static/js/app.js +++ b/static/js/app.js @@ -67,11 +67,12 @@ function escapeHtml(str) { function playStation(url, name, stationId) { stopPlayback(false); - // HTTP stream on HTTPS page → open minimal player in new tab, keep main window as home base + // HTTP stream on HTTPS page: the custom /radio/stream-player/ is also HTTPS, + // so the browser still blocks the HTTP audio (mixed content upgrade → HTTPS fails). + // Opening the raw HTTP URL directly navigates the tab to HTTP itself — + // no mixed-content restriction, browser plays it natively. if (location.protocol === 'https:' && url.startsWith('http://')) { - const vol = localStorage.getItem('diora_volume') || '204'; - const params = new URLSearchParams({ url, name, vol }); - window.open('/radio/stream-player/?' + params, '_blank'); + window.open(url, '_blank'); return; } diff --git a/templates/radio/stream_player.html b/templates/radio/stream_player.html index 7c80b9a..97b1f04 100644 --- a/templates/radio/stream_player.html +++ b/templates/radio/stream_player.html @@ -156,8 +156,7 @@ if (playing) stopPlay(); else startPlay(); }); - // Auto-play on load - document.addEventListener('DOMContentLoaded', startPlay); + document.getElementById('track-name').textContent = 'Click Play to start';