update
This commit is contained in:
@@ -7,8 +7,7 @@ export const useApp = createGlobalState(() => {
|
||||
const { clients } = useClients()
|
||||
const mediasoup = useMediasoup()
|
||||
const signaling = useSignaling()
|
||||
const toast = useToast()
|
||||
const sfx = useSfx()
|
||||
const { emit } = useEventBus()
|
||||
|
||||
const ready = ref(false)
|
||||
const isTauri = computed(() => '__TAURI_INTERNALS__' in window)
|
||||
@@ -53,8 +52,7 @@ export const useApp = createGlobalState(() => {
|
||||
|
||||
await mediasoup.pauseProducer(mediasoup.micProducer.value)
|
||||
|
||||
sfx.playEvent('mic-off').then()
|
||||
toast.add({ severity: 'info', summary: 'Microphone muted', closable: false, life: 1000 })
|
||||
emit('audio:muted')
|
||||
}
|
||||
|
||||
async function unmuteInput() {
|
||||
@@ -67,8 +65,7 @@ export const useApp = createGlobalState(() => {
|
||||
|
||||
await mediasoup.resumeProducer(mediasoup.micProducer.value)
|
||||
|
||||
sfx.playEvent('mic-on').then()
|
||||
toast.add({ severity: 'info', summary: 'Microphone activated', closable: false, life: 1000 })
|
||||
emit('audio:unmuted')
|
||||
}
|
||||
|
||||
async function toggleInput() {
|
||||
@@ -92,7 +89,7 @@ export const useApp = createGlobalState(() => {
|
||||
outputMuted: true,
|
||||
})
|
||||
|
||||
toast.add({ severity: 'info', summary: 'Sound muted', closable: false, life: 1000 })
|
||||
emit('output:muted')
|
||||
}
|
||||
|
||||
async function unmuteOutput() {
|
||||
@@ -105,7 +102,7 @@ export const useApp = createGlobalState(() => {
|
||||
outputMuted: false,
|
||||
})
|
||||
|
||||
toast.add({ severity: 'info', summary: 'Sound resumed', closable: false, life: 1000 })
|
||||
emit('output:unmuted')
|
||||
}
|
||||
|
||||
async function toggleOutput() {
|
||||
@@ -118,22 +115,22 @@ export const useApp = createGlobalState(() => {
|
||||
async function toggleVideo() {
|
||||
if (!mediasoup.videoProducer.value) {
|
||||
await mediasoup.enableVideo()
|
||||
await sfx.playEvent('stream-on')
|
||||
emit('video:enabled')
|
||||
}
|
||||
else {
|
||||
await mediasoup.disableProducer(mediasoup.videoProducer.value)
|
||||
await sfx.playEvent('stream-off')
|
||||
emit('video:disabled')
|
||||
}
|
||||
}
|
||||
|
||||
async function toggleShare() {
|
||||
if (!mediasoup.shareProducer.value) {
|
||||
await mediasoup.enableShare()
|
||||
await sfx.playEvent('stream-on')
|
||||
emit('share:enabled')
|
||||
}
|
||||
else {
|
||||
await mediasoup.disableProducer(mediasoup.shareProducer.value)
|
||||
await sfx.playEvent('stream-off')
|
||||
emit('share:disabled')
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user