FIX: uses CDN when available for chat mp3 sounds (#19341)

This commit is contained in:
Joffrey JAFFEUX 2022-12-06 16:27:59 +01:00 committed by GitHub
parent 58ffa06d4a
commit 4e92a6e804
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,6 +1,7 @@
import Service from "@ember/service";
import { debounce } from "discourse-common/utils/decorators";
import { isTesting } from "discourse-common/config/environment";
import { getURLWithCDN } from "discourse-common/lib/get-url";
const AUDIO_DEBOUNCE_DELAY = 3000;
@ -17,7 +18,7 @@ const createAudioCache = (sources) => {
sources.forEach(({ type, src }) => {
const source = document.createElement("source");
source.type = type;
source.src = src;
source.src = getURLWithCDN(src);
audio.appendChild(source);
});
return audio;