client volumes
This commit is contained in:
1
client/app/components.d.ts
vendored
1
client/app/components.d.ts
vendored
@@ -17,6 +17,7 @@ declare module 'vue' {
|
||||
PrimeFloatLabel: typeof import('primevue/floatlabel')['default']
|
||||
PrimeInputText: typeof import('primevue/inputtext')['default']
|
||||
PrimePassword: typeof import('primevue/password')['default']
|
||||
PrimeProgressBar: typeof import('primevue/progressbar')['default']
|
||||
PrimeScrollPanel: typeof import('primevue/scrollpanel')['default']
|
||||
PrimeSelect: typeof import('primevue/select')['default']
|
||||
PrimeSelectButton: typeof import('primevue/selectbutton')['default']
|
||||
|
||||
@@ -7,7 +7,12 @@
|
||||
}"
|
||||
>
|
||||
<div class="p-3 flex items-center gap-3" @click="toggleExpand">
|
||||
<PrimeAvatar size="small">
|
||||
<PrimeAvatar
|
||||
size="small"
|
||||
:class="{
|
||||
'outline-1 outline-primary outline-offset-2': speaking,
|
||||
}"
|
||||
>
|
||||
<template #icon>
|
||||
<User :size="20" />
|
||||
</template>
|
||||
@@ -61,7 +66,7 @@ const props = defineProps<{
|
||||
}>()
|
||||
|
||||
const { outputMuted } = useApp()
|
||||
const { consumers: allConsumers, micProducer } = useMediasoup()
|
||||
const { consumers: allConsumers, micProducer, speakingClients } = useMediasoup()
|
||||
const { me } = useClients()
|
||||
const { show } = useFullscreenVideo()
|
||||
|
||||
@@ -94,6 +99,10 @@ const audioTrack = computed(() => {
|
||||
return audioConsumer.value?.track
|
||||
})
|
||||
|
||||
const speaking = computed(() => {
|
||||
return speakingClients.value.find(speaker => speaker.clientId === props.client.socketId)
|
||||
})
|
||||
|
||||
const audioConsumerPaused = ref(false)
|
||||
|
||||
const inputMuted = computed(() => {
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import type { SpeakingClient } from '#shared/types'
|
||||
import type { MediaKind, ProducerOptions } from 'mediasoup-client/types'
|
||||
import { createSharedComposable } from '@vueuse/core'
|
||||
import * as mediasoupClient from 'mediasoup-client'
|
||||
import { shallowRef } from 'vue'
|
||||
import { useDevices } from '~/composables/use-devices'
|
||||
import { usePreferences } from '~/composables/use-preferences'
|
||||
import { useSignaling } from '~/composables/use-signaling'
|
||||
@@ -40,6 +42,8 @@ export const useMediasoup = createSharedComposable(() => {
|
||||
const consumers = shallowRef<Map<string, mediasoupClient.types.Consumer>>(new Map())
|
||||
const producers = shallowRef<Map<string, mediasoupClient.types.Producer>>(new Map())
|
||||
|
||||
const speakingClients = shallowRef<SpeakingClient[]>([])
|
||||
|
||||
watch(signaling.socket, (socket) => {
|
||||
if (!socket)
|
||||
return
|
||||
@@ -227,6 +231,10 @@ export const useMediasoup = createSharedComposable(() => {
|
||||
|
||||
triggerRef(consumers)
|
||||
})
|
||||
|
||||
socket.on('speakingPeers', (value: SpeakingClient[]) => {
|
||||
speakingClients.value = value
|
||||
})
|
||||
}, { immediate: true, flush: 'sync' })
|
||||
|
||||
async function enableProducer(type: ProducerType, options: ProducerOptions) {
|
||||
@@ -424,6 +432,7 @@ export const useMediasoup = createSharedComposable(() => {
|
||||
init,
|
||||
consumers,
|
||||
producers,
|
||||
speakingClients,
|
||||
sendTransport,
|
||||
recvTransport,
|
||||
rtpCapabilities,
|
||||
|
||||
Reference in New Issue
Block a user