-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiple remote users gets unpublished on unpublishing one remote user #359
Comments
looks like an application issue. could you pls help provide a minimal reproducible project? |
Sure. Let me share with you the config and other details. React component markup: `<Draggable {users.length > 0 && users.map((user) => { if (user.videoTrack) { return ( ); } else return null; })}
AgoraVideoPlayer Component
Here's a complete minimal component VideoCall.js
Everything works fine while publishing. Suppose there are 4 users in a call. If any 1 remote user unpublishes the video or leaves the call, the unpublish event is triggered for the other users also with their unique uid. |
This is my useEffect code. I have subscribed to the user-joined, user-unpublished events. When multiple remote users join the channel, their video gets published successfully. When any of the remote user leaves the channel, all remote users get unpublished somehow.
useEffect(() => {
let initClientCallbacks = () => {
videoCallContext.client.on("user-published", async (remoteUser, mediaType) => {
await videoCallContext.client.subscribe(remoteUser, mediaType);
if (mediaType == "video") {
console.log("subscribe video success");
// remoteUser.videoTrack.play(document.getElementById("subscriber"));
setUsers((prevUsers) => {
return [...prevUsers, remoteUser];
});
}
if (mediaType == "audio") {
console.log("subscribe audio success");
remoteUser.audioTrack.play();
}
const p = document.getElementById('publisher');
p.style.width = '30%';
p.style.height = '30%';
p.style.left = '10px';
p.style.bottom = '10px';
})
The text was updated successfully, but these errors were encountered: