Discussions

Ask a Question
Back to All

Obtaining media stream via API call

I had a question about API method usage. I am trying to obtain participant's media stream via the function below:

const participants = api.call.participants();
const firstParticipant = participants[0];

const mediaStream = api.call.getMediaForParticipant(firstParticipant.id);
console.log(mediaStream);

What do I need to do in order to get back the JSON object from this API call?

What sort of files and setup do I need to make this work?