Web: der Lautstärkeregler gilt auch für Podcasts, sw v57
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
cd0547c2f0
commit
713b25f36a
2 changed files with 18 additions and 2 deletions
|
|
@ -548,9 +548,25 @@
|
||||||
applyVolume();
|
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() {
|
function applyVolume() {
|
||||||
// Louder than 1 needs an audio graph, which episodes from other servers can't feed: 1 at most.
|
// 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() {
|
function applyKind() {
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
* diora service worker — caches the app shell for offline use.
|
* diora service worker — caches the app shell for offline use.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const CACHE = 'diora-v56';
|
const CACHE = 'diora-v57';
|
||||||
const SHELL = [
|
const SHELL = [
|
||||||
'/static/css/app.css',
|
'/static/css/app.css',
|
||||||
'/static/js/app.js',
|
'/static/js/app.js',
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue