-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
call on stream event receives same remote stream twice #609
Comments
any one can coment on this please? |
I came across this problem, it looks like this happens when we transfer a stream to another client (audio: true, video: true), try to check this, transfer the stream from both video and audio, and then only with audio, I solved this problem possibly incorrectly , but it works, I check if I already received this stream (when I receive it, I save the stream, for example, in an array and put down a unique key for it, for example, the user id that can be obtained by passing |
Yeap, |
Please, can we handle this behavior? I can stream video but I don't have sound |
Still an issue |
Sipjs handles it this way https://sipjs.com/guides/attach-media/ by having onTrackAdded |
I figured I was wrong. Both streams received contain audio and video. I forgot to remove the mute prop from my HTML tag... |
I have both video and audio its just the behavior that bothers me.
El vie., 17 abr. 2020 a las 10:27, Baptiste Arnaud (<
[email protected]>) escribió:
… Please, can we handle this behavior? I can stream video but I don't have
sound
I figured I was wrong. Both streams received contain audio *and* video. I
forgot to remove the mute prop from my HTML tag...
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#609 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA47FG5NRKADFOYTFWURTI3RNAHFRANCNFSM4J4HHKVA>
.
|
Anyone have working solution for these? still stream event called twice. |
This things still have an issue as of today, anyone have an idea to deal with? |
i create an array. const callList = []; When i get a call or i call other users, first i check that list in onStream event and if that call not in my list, doing my stuf (add to page a video element or anything else). // make a call (userId is other users peer id)
const call = peer.call(userId, myVideoElement.srcObject, { metadata: { userId: peer.id } });
// create a video element
const video = createVideoElement(); // this is my custom function for create a html video element, it returns a video element.
// call on stream
call.on('stream', remoteStream => {
// check call list if call not in the list then add to list and page
if(!callList[call.peer]){
// add stream to video element
video.srcObject = remoteStream;
// show on page
showVideoElemenetOnPage(video); // this is my custom function for append video element to another element on the page
// add call objec to global object
callList[call.peer] = call;
}
}); This can solve twice run problem. |
This solve my problem, thanks |
after using the above method it was still accepting twice. const callList = []; peer.on('call', call =>{ socket.on('user-connected', ID => {
}); |
If you get double stream issue then try to create video element before |
Now it is working as expected |
Same problem here :( I did the work around to ignore the second event |
I have found simple solution:
|
ooo god i was confused with 48 hour thanks bro i love u |
on create video element before call.on('stream', data => { }); even though it executing two time but video is not displaying because the adding of same track is not allowed by video Element. when keeping video element inside the call.on('stream'(stream)=>{}) it will create new video element for twice. |
Using a very simple example from peerjs.com between two peers.
call.on('stream') always receives two same remote streams.
Here is a screen shot.
Is it a known issue?
Thanks
The text was updated successfully, but these errors were encountered: