Check if a participant exists in a conference using participant label

237 Views Asked by At

I tried

participant = conferences[0].participants('participant')

but this always return a participant even though the participant is not in the conference.

participant = conferences[0].participants('participant').fetch()

returns an error if the participant is not in the conference

1

There are 1 best solutions below

0
On BEST ANSWER

Try something like the below:

function findParticipant() {
return client.conferences('CFba9989...')
    .participants
    .list()
}

let findMe = 'Winston';

findParticipant()
.then(participants => {
    let result = participants.filter(participant => participant.label === findMe )
     console.log(result);
}).catch(err => console.log(err.message))