Skip to content
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

modified transceiver seems that it has a bug with chrome #2374

Open
Adamkaram opened this issue Dec 17, 2022 · 1 comment
Open

modified transceiver seems that it has a bug with chrome #2374

Adamkaram opened this issue Dec 17, 2022 · 1 comment

Comments

@Adamkaram
Copy link

Your environment.

  • Browser: chrome 108.0.5359.124
  • Other Information - stacktraces, related issues, suggestions how to fix, links for us to have context

What did you do?

What did you expect?

that ontrack event on addTranceiver side fires as intend

What happened?

when i do the following code in ontrack event
e.transceiver.direction = "sendrecv";
e.transceiver.sender
.replaceTrack(localStream.getAudioTracks()[0])
this doesn't trigger ontrack event in yourConn side the caller
there is nothing received in the other side yourConn also that mean yourConn seem to not triggerd there

yourConn2.ontrack = (e) => {

           remoteVideo = document.getElementById("wbrtcremote");
           transceiversRemotePeer = new MediaStream([
             e.transceiver.receiver.track,
           ]);
           remoteVideo.srcObject = transceiversRemotePeer;
           console.log(
             `kind of this track that has arrived to remote peer is ${e.transceiver.receiver.track.kind}`
           );
           console.log("transceiversRemotePeer.receiver.track.onunmute");
           // remoteVideo.srcObject = e.streams[0].getAudioTracks()[0];
         
        //send backTrack

        e.transceiver.direction = "sendrecv";
        e.transceiver.sender
          .replaceTrack(localStream.getAudioTracks()[0])
          .then(() => {
             //check Tranciever
          let senderList = yourConn2.getSenders();
          let recieverList = yourConn2.getReceivers();
          console.log("recieverList in remotepeer is ", recieverList);
          console.log("senderList in remotepeer is ", senderList);
            console.log("Track replaced on transceiver's sender");
            console.log(
              "current direction in remotPeer after changing it is ",
              e.transceiver.direction
            );
          });
    };

but with addTrack used it's triggers theres on yourConn side
yourConn2.addTrack(localStream.getAudioTracks()[0]);

configuration code for yourConn side to send and receive is :


          yourConn.addTransceiver(streams.getAudioTracks()[0]);

    yourConn.ontrack = (e) => {
     transceiversLocalPeer = new MediaStream([
          e.transceiver.receiver.track,
        ]);
        localVideo.srcObject = transceiversLocalPeer;
    }

behavior that happend with modified transceiver

yourConn after the call is done or connection is established just as fine
yourConn (the caller ) can send audio but not recieve
yourConn2 (the calle) can receive audio but can't send

ontrack event for yourConn => not triggered
ontrack event for yourConn2 => triggered

@Adamkaram
Copy link
Author

seems that modified tranciever doesn't trigger ontrack on addtranceiver side since there's no track added to connection

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant