兼容低内核版本的浏览器

This commit is contained in:
eafonyang
2026-06-03 15:42:58 +08:00
parent e17c096f0b
commit 56da3e0d1f
29 changed files with 1246 additions and 82 deletions
+7 -1
View File
@@ -28,6 +28,12 @@ export function decodeCustomBase64(encoded: string): string {
const index = ALPHABET_CUSTOM.indexOf(char);
translated += index !== -1 ? ALPHABET_STANDARD.charAt(index) : char;
}
// Chrome 91 atob() is stricter than modern browsers.
translated = translated.replace(/\s/g, "");
const padNeeded = (4 - (translated.length % 4)) % 4;
if (padNeeded > 0) {
translated += "=".repeat(padNeeded);
}
const decoded = atob(translated);
const bytes = new Uint8Array(decoded.length);
for (let i = 0; i < decoded.length; i++) {
@@ -168,7 +174,7 @@ export interface PeqApplyPayload {
// ============================================================
// Input/Output Labels
// ============================================================
export const INPUT_LABELS = ["USB", "USB-C", "Coaxial", "Optical", "Bluetooth", "IIS", "RCA"];
export const INPUT_LABELS = ["USB", "USB-C", "Coaxial", "Optical", "Bluetooth", "HDMI-EARC", "RCA"];
export const OUTPUT_LABELS = ["XLR", "RCA", "Headset", "XLR/RCA"];
/** Device `input` index for Bluetooth source. */