Skip to content

Instantly share code, notes, and snippets.

@sendbird-community
Created March 17, 2023 19:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sendbird-community/361643fee83b5d48c4aed621c8671927 to your computer and use it in GitHub Desktop.
Save sendbird-community/361643fee83b5d48c4aed621c8671927 to your computer and use it in GitHub Desktop.
const addSendbirdCallsListener = (room) => {
const target = document.getElementById('remote_video_target')
room.on('remoteParticipantStreamStarted', (remoteParticipant) => {
if(sendbirdUser.sendbirdUserId == remoteParticipant.user.userId) return
const remoteMediaView = document.createElement('video');
remoteMediaView.autoplay = true;
remoteParticipant.setMediaView(remoteMediaView);
target.appendChild(remoteMediaView);
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment