This commit is contained in:
@@ -8,6 +8,7 @@ export const useApp = createGlobalState(() => {
|
||||
const mediasoup = useMediasoup()
|
||||
const signaling = useSignaling()
|
||||
const toast = useToast()
|
||||
const sfx = useSfx()
|
||||
|
||||
const ready = ref(false)
|
||||
const isTauri = computed(() => '__TAURI_INTERNALS__' in window)
|
||||
@@ -52,6 +53,7 @@ export const useApp = createGlobalState(() => {
|
||||
|
||||
await mediasoup.pauseProducer(mediasoup.micProducer.value)
|
||||
|
||||
sfx.play('/sfx/off_micr.ogg').then()
|
||||
toast.add({ severity: 'info', summary: 'Microphone muted', closable: false, life: 1000 })
|
||||
}
|
||||
|
||||
@@ -65,6 +67,7 @@ export const useApp = createGlobalState(() => {
|
||||
|
||||
await mediasoup.resumeProducer(mediasoup.micProducer.value)
|
||||
|
||||
sfx.play('/sfx/on_micr.ogg').then()
|
||||
toast.add({ severity: 'info', summary: 'Microphone activated', closable: false, life: 1000 })
|
||||
}
|
||||
|
||||
@@ -115,18 +118,22 @@ export const useApp = createGlobalState(() => {
|
||||
async function toggleVideo() {
|
||||
if (!mediasoup.videoProducer.value) {
|
||||
await mediasoup.enableVideo()
|
||||
await sfx.play('/sfx/on_trans.ogg', 0.03)
|
||||
}
|
||||
else {
|
||||
await mediasoup.disableProducer(mediasoup.videoProducer.value)
|
||||
await sfx.play('/sfx/off_trans.ogg', 0.03)
|
||||
}
|
||||
}
|
||||
|
||||
async function toggleShare() {
|
||||
if (!mediasoup.shareProducer.value) {
|
||||
await mediasoup.enableShare()
|
||||
await sfx.play('/sfx/on_trans.ogg', 0.03)
|
||||
}
|
||||
else {
|
||||
await mediasoup.disableProducer(mediasoup.shareProducer.value)
|
||||
await sfx.play('/sfx/off_trans.ogg', 0.03)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user