diff --git a/static/js/podcasts-web.js b/static/js/podcasts-web.js index 80d107c..9f529cf 100644 --- a/static/js/podcasts-web.js +++ b/static/js/podcasts-web.js @@ -548,9 +548,25 @@ applyVolume(); } + // The bar's volume slider (app.js setVolume, 0-255): one level for radio and podcasts. + function barVolume() { + const s = document.getElementById('volume'); + const v = s ? parseInt(s.value, 10) : NaN; + return isFinite(v) ? Math.max(0, Math.min(255, v)) / 255 : 1; + } + function applyVolume() { // Louder than 1 needs an audio graph, which episodes from other servers can't feed: 1 at most. - audio.volume = Math.max(0, Math.min(1, Math.min(volumeFor(curFeed()), 1) * fade)); + audio.volume = Math.max(0, Math.min(1, Math.min(volumeFor(curFeed()), 1) * fade * barVolume())); + } + + if (typeof window.setVolume === 'function') { + const setVolume = window.setVolume; + window.setVolume = function () { + const r = setVolume.apply(this, arguments); + applyVolume(); + return r; + }; } function applyKind() { diff --git a/static/js/sw.js b/static/js/sw.js index 0b88e38..cd373e2 100644 --- a/static/js/sw.js +++ b/static/js/sw.js @@ -2,7 +2,7 @@ * diora service worker — caches the app shell for offline use. */ -const CACHE = 'diora-v56'; +const CACHE = 'diora-v57'; const SHELL = [ '/static/css/app.css', '/static/js/app.js',