Tizen TV: Transparenter iframe-Overlay statt opacity:0 - Player-Controls (Progress-Bar, Buttons, Popup-Menue) jetzt sichtbar ueber dem AVPlay-Video. CSS-Klasse "vknative-playing" macht Hintergruende transparent, AVPlay-Video scheint durch den iframe hindurch. Android App: Immersive Sticky Fullscreen mit WindowInsetsControllerCompat. Status- und Navigationsleiste komplett versteckt, per Swipe vom Rand temporaer einblendbar. Audio-Normalisierung (3 Stufen): - Server-seitig: EBU R128 loudnorm (I=-14 LUFS) im HLS-Transcoding - Server-seitig: dynaudnorm (dynamische Szenen-Anpassung) im HLS-Transcoding - Client-seitig: DynamicsCompressorNode im Browser-Player Alle Optionen konfigurierbar: loudnorm/dynaudnorm im TV Admin-Center, Audio-Kompressor pro Client in den Einstellungen. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
70 lines
2.1 KiB
JavaScript
70 lines
2.1 KiB
JavaScript
/**
|
|
* VideoKonverter TV - Service Worker (minimal)
|
|
* Ermoeglicht PWA-Installation auf Handys und Tablets
|
|
* Kein Offline-Caching noetig (Streaming braucht Netzwerk)
|
|
*/
|
|
|
|
const CACHE_NAME = "vk-tv-v16";
|
|
const STATIC_ASSETS = [
|
|
"/static/tv/css/tv.css",
|
|
"/static/tv/js/tv.js",
|
|
"/static/tv/js/player.js",
|
|
"/static/tv/js/vknative-bridge.js",
|
|
"/static/tv/icons/icon-192.png",
|
|
];
|
|
|
|
// Installation: Statische Assets cachen
|
|
self.addEventListener("install", (event) => {
|
|
event.waitUntil(
|
|
caches.open(CACHE_NAME)
|
|
.then(cache => cache.addAll(STATIC_ASSETS))
|
|
.then(() => self.skipWaiting())
|
|
);
|
|
});
|
|
|
|
// Aktivierung: Alte Caches aufraemen
|
|
self.addEventListener("activate", (event) => {
|
|
event.waitUntil(
|
|
caches.keys()
|
|
.then(keys => Promise.all(
|
|
keys.filter(k => k !== CACHE_NAME)
|
|
.map(k => caches.delete(k))
|
|
))
|
|
.then(() => self.clients.claim())
|
|
);
|
|
});
|
|
|
|
// Fetch: Network-First Strategie (Streaming braucht immer Netzwerk)
|
|
self.addEventListener("fetch", (event) => {
|
|
// Nur GET-Requests cachen
|
|
if (event.request.method !== "GET") return;
|
|
|
|
// API-Requests und Streaming nie cachen
|
|
const url = new URL(event.request.url);
|
|
if (url.pathname.startsWith("/api/") || url.pathname.startsWith("/tv/api/")
|
|
|| url.pathname.includes("/stream") || url.pathname.includes("/direct-stream")) {
|
|
return;
|
|
}
|
|
|
|
// Statische Assets: Cache-First
|
|
if (url.pathname.startsWith("/static/tv/")) {
|
|
event.respondWith(
|
|
caches.match(event.request)
|
|
.then(cached => cached || fetch(event.request)
|
|
.then(response => {
|
|
const clone = response.clone();
|
|
caches.open(CACHE_NAME)
|
|
.then(cache => cache.put(event.request, clone));
|
|
return response;
|
|
})
|
|
)
|
|
);
|
|
return;
|
|
}
|
|
|
|
// Alles andere: Network-First
|
|
event.respondWith(
|
|
fetch(event.request)
|
|
.catch(() => caches.match(event.request))
|
|
);
|
|
});
|