import React from "react" ; import Participant from "../../../models/Participant" ; import ParticipantService from "../../../services/ParticipantService" ; import { useObserver } from "mobx-react" ; import AutoPlayAudio from "../TileTypes/Util/AutoPlayAudio" ; interface AudioFillerProps { exclusionList : Participant [ ] ; } export const AudioFiller = ( { exclusionList } ) => { if ( ! exclusionList ) { exclusionList = [ ] ; } return useObserver ( ( ) => { const living = ParticipantService . getLiving ( true ) ; const participants = living . filter ( ( participant ) => participant . hasAudio && ! exclusionList ! . includes ( participant ) ) ; return ( < > { participants . map ( ( participant ) => ( < AutoPlayAudio key = { participant . info . id } volume = { participant . volume } srcObject = { new MediaStream ( [ participant . consumers . microphone ! . track ] ) } / > ) ) } < />); } ) ; } ;