front update
All checks were successful
Deploy / deploy (push) Successful in 43s

This commit is contained in:
Никита Круглицкий
2025-10-09 04:42:34 +06:00
parent 7cd4ff72d4
commit 196aa36970
26 changed files with 1049 additions and 324 deletions

View File

@@ -0,0 +1,60 @@
import { createGlobalState } from '@vueuse/core'
export const useApp = createGlobalState(() => {
const mediasoup = useMediasoup()
const inputMuted = ref(false)
const outputMuted = ref(false)
const me = computed(() => mediasoup.clients.value.find(client => client.isMe))
function muteInput() {
inputMuted.value = true
}
function unmuteInput() {
inputMuted.value = false
}
function toggleInput() {
if (inputMuted.value)
unmuteInput()
else
muteInput()
}
function muteOutput() {
outputMuted.value = true
}
function unmuteOutput() {
outputMuted.value = false
}
function toggleOutput() {
if (outputMuted.value)
unmuteOutput()
else
muteOutput()
}
watch(inputMuted, async (state) => {
if (state)
await mediasoup.muteMic()
else
await mediasoup.unmuteMic()
})
return {
clients: mediasoup.clients,
me,
inputMuted,
muteInput,
unmuteInput,
toggleInput,
outputMuted,
muteOutput,
unmuteOutput,
toggleOutput,
}
})