mirror of
https://github.com/vector-im/element-call.git
synced 2026-07-15 18:49:21 +00:00
fix lint
This commit is contained in:
@@ -18,6 +18,7 @@ import {
|
|||||||
} from "./livekit/MediaDevicesContext";
|
} from "./livekit/MediaDevicesContext";
|
||||||
import { type PrefetchedSounds } from "./soundUtils";
|
import { type PrefetchedSounds } from "./soundUtils";
|
||||||
import { useUrlParams } from "./UrlParams";
|
import { useUrlParams } from "./UrlParams";
|
||||||
|
import { useInitial } from "./useInitial";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Play a sound though a given AudioContext. Will take
|
* Play a sound though a given AudioContext. Will take
|
||||||
@@ -59,7 +60,6 @@ interface Props<S extends string> {
|
|||||||
|
|
||||||
interface UseAudioContext<S> {
|
interface UseAudioContext<S> {
|
||||||
playSound(soundName: S): Promise<void>;
|
playSound(soundName: S): Promise<void>;
|
||||||
htmlAudioElement: HTMLAudioElement;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -77,7 +77,7 @@ export function useAudioContext<S extends string>(
|
|||||||
const [audioContext, setAudioContext] = useState<AudioContext>();
|
const [audioContext, setAudioContext] = useState<AudioContext>();
|
||||||
const [audioBuffers, setAudioBuffers] = useState<Record<S, AudioBuffer>>();
|
const [audioBuffers, setAudioBuffers] = useState<Record<S, AudioBuffer>>();
|
||||||
|
|
||||||
const [htmlAudioElement] = useState((): HTMLAudioElement => new Audio());
|
const htmlAudioElement = useInitial((): HTMLAudioElement => new Audio());
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const sounds = props.sounds;
|
const sounds = props.sounds;
|
||||||
@@ -141,6 +141,5 @@ export function useAudioContext<S extends string>(
|
|||||||
earpiecePan,
|
earpiecePan,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
htmlAudioElement,
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user