mirror of
https://github.com/vector-im/element-call.git
synced 2026-07-18 18:59:23 +00:00
Remove unused audio format.
This commit is contained in:
@@ -71,26 +71,11 @@ export function CallEventAudioRenderer({
|
|||||||
const [effectSoundVolume] = useSetting(effectSoundVolumeSetting);
|
const [effectSoundVolume] = useSetting(effectSoundVolumeSetting);
|
||||||
const devices = useMediaDevices();
|
const devices = useMediaDevices();
|
||||||
const audioSourceElement = useRef<HTMLAudioElement>(null);
|
const audioSourceElement = useRef<HTMLAudioElement>(null);
|
||||||
const audioFormatPreference = useMemo(() => {
|
|
||||||
const a = document.createElement("audio");
|
|
||||||
if (a.canPlayType("audio/ogg")) {
|
|
||||||
return "ogg";
|
|
||||||
}
|
|
||||||
|
|
||||||
if (a.canPlayType("audio/mpeg")) {
|
|
||||||
return "mp3";
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
const [audioContext, setAudioContext] = useState<AudioContext>();
|
const [audioContext, setAudioContext] = useState<AudioContext>();
|
||||||
const [joinCallBuffer, setJoinSoundNode] = useState<AudioBuffer>();
|
const [joinCallBuffer, setJoinSoundNode] = useState<AudioBuffer>();
|
||||||
const [leaveCallBuffer, setLeaveSoundNode] = useState<AudioBuffer>();
|
const [leaveCallBuffer, setLeaveSoundNode] = useState<AudioBuffer>();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!audioFormatPreference) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const ctx = new AudioContext({
|
const ctx = new AudioContext({
|
||||||
latencyHint: "interactive",
|
latencyHint: "interactive",
|
||||||
// XXX: Types don't include this yet.
|
// XXX: Types don't include this yet.
|
||||||
@@ -128,7 +113,7 @@ export function CallEventAudioRenderer({
|
|||||||
});
|
});
|
||||||
setAudioContext(undefined);
|
setAudioContext(undefined);
|
||||||
};
|
};
|
||||||
}, [!audioFormatPreference, devices.audioOutput]);
|
}, [devices.audioOutput]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const joinSub = vm.memberChanges
|
const joinSub = vm.memberChanges
|
||||||
|
|||||||
Reference in New Issue
Block a user