fixed Sound nach Verbinden auf RG
This commit is contained in:
@@ -25,8 +25,6 @@ import { ROOMS } from "_data/livekitRooms";
|
||||
|
||||
let interval: NodeJS.Timeout;
|
||||
|
||||
const connectedSound = new Audio("/sounds/403.wav");
|
||||
|
||||
type TalkState = {
|
||||
addSpeakingParticipant: (participant: Participant) => void;
|
||||
connect: (room: (typeof ROOMS)[number] | undefined, role: string) => void;
|
||||
@@ -190,6 +188,7 @@ export const useAudioStore = create<TalkState>((set, get) => ({
|
||||
if (!token) throw new Error("Fehlende Berechtigung");
|
||||
const room = new Room({});
|
||||
await room.prepareConnection(url, token);
|
||||
const roomConnectedSound = new Audio("/sounds/403.wav");
|
||||
room
|
||||
// Connection events
|
||||
.on(RoomEvent.Connected, async () => {
|
||||
@@ -219,7 +218,7 @@ export const useAudioStore = create<TalkState>((set, get) => ({
|
||||
source: Track.Source.Microphone,
|
||||
});
|
||||
await publishedTrack.mute();
|
||||
connectedSound.play().catch((e) => console.error("Fehler beim Abspielen des Sounds", e));
|
||||
roomConnectedSound.play();
|
||||
set({ localRadioTrack: publishedTrack });
|
||||
|
||||
set({ state: "connected", room, isTalking: false, message: null });
|
||||
|
||||
Reference in New Issue
Block a user