Video: Enable service worker on Chromium 133 (#5536)

This commit is contained in:
zubiden 2025-01-27 23:51:06 +01:00 committed by Alexander Zinchuk
parent 7eae642e18
commit db11ee8647

View File

@ -63,8 +63,11 @@ export const IS_VOICE_RECORDING_SUPPORTED = Boolean(
export const IS_EMOJI_SUPPORTED = PLATFORM_ENV && (IS_MAC_OS || IS_IOS) && isLastEmojiVersionSupported();
export const IS_SERVICE_WORKER_SUPPORTED = 'serviceWorker' in navigator;
// Remove in mid-late 2025 when Chromium 132 is no longer a problem
// https://issues.chromium.org/issues/390581541
const chromeVersion = navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./)?.[2];
const hasBrokenServiceWorkerStreaming = chromeVersion && Number(chromeVersion) >= 132; // TODO: Update constraint when bug is fixed
const hasBrokenServiceWorkerStreaming = chromeVersion && Number(chromeVersion) === 132;
// TODO Consider failed service worker
export const IS_PROGRESSIVE_SUPPORTED = IS_SERVICE_WORKER_SUPPORTED && !hasBrokenServiceWorkerStreaming;
export const IS_OPUS_SUPPORTED = Boolean((new Audio()).canPlayType('audio/ogg; codecs=opus'));