Count AVC SEI recovery points as keyframes (except on older Chromium versions)

This commit is contained in:
Vanilagy
2025-12-07 19:24:08 +01:00
parent d949d1eadb
commit f424f6e840
2 changed files with 83 additions and 1 deletions
+18
View File
@@ -700,6 +700,24 @@ export const isChromium = () => {
return isChromiumCache = !!(typeof navigator !== 'undefined' && navigator.vendor?.includes('Google Inc'));
};
let chromiumVersionCache: number | null = null;
export const getChromiumVersion = () => {
if (chromiumVersionCache !== null) {
return chromiumVersionCache;
}
if (typeof navigator === 'undefined') {
return null;
}
const match = /\bChrome\/(\d+)/.exec(navigator.userAgent);
if (!match) {
return null;
}
return chromiumVersionCache = Number(match[1]!);
};
/**
* T or a promise that resolves to T.
* @group Miscellaneous