mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: uses CDN when available for chat mp3 sounds (#19341)
This commit is contained in:
parent
58ffa06d4a
commit
4e92a6e804
@ -1,6 +1,7 @@
|
|||||||
import Service from "@ember/service";
|
import Service from "@ember/service";
|
||||||
import { debounce } from "discourse-common/utils/decorators";
|
import { debounce } from "discourse-common/utils/decorators";
|
||||||
import { isTesting } from "discourse-common/config/environment";
|
import { isTesting } from "discourse-common/config/environment";
|
||||||
|
import { getURLWithCDN } from "discourse-common/lib/get-url";
|
||||||
|
|
||||||
const AUDIO_DEBOUNCE_DELAY = 3000;
|
const AUDIO_DEBOUNCE_DELAY = 3000;
|
||||||
|
|
||||||
@ -17,7 +18,7 @@ const createAudioCache = (sources) => {
|
|||||||
sources.forEach(({ type, src }) => {
|
sources.forEach(({ type, src }) => {
|
||||||
const source = document.createElement("source");
|
const source = document.createElement("source");
|
||||||
source.type = type;
|
source.type = type;
|
||||||
source.src = src;
|
source.src = getURLWithCDN(src);
|
||||||
audio.appendChild(source);
|
audio.appendChild(source);
|
||||||
});
|
});
|
||||||
return audio;
|
return audio;
|
||||||
|
Loading…
Reference in New Issue
Block a user