peerjs icon indicating copy to clipboard operation
peerjs copied to clipboard

[SOLVED] call.on('stream') never triggered

Open mozhn opened this issue 6 years ago • 2 comments

Hello, I am writing a video calling application with ionic 4. I start a search but the stream never returns. My image and voice go to the other side. Android is ok, but I have this situation in iOS. I use iosrtc.

` const call = this.peer.call(partnerId, this.localStream);

call.on('stream', (stream) => {
  // never comes
  this.loadingElement.classList.add('hidden');
  this.remoteElement.classList.remove('hidden');

  this.remoteElement.srcObject = stream;
});

`

mozhn avatar May 28 '20 12:05 mozhn

fighting with the same issue on iOS. As far it looks like peerConnection.ontrack in PeerJS is the issue. Have a look at https://github.com/Zemke/react-native-peerjs. He changed .ontrack to .onaddstream

pcvengros avatar Jun 01 '20 04:06 pcvengros

My solution is as follows: call.peerConnection.addEventListener('addstream', (e: any) => { console.log(e.stream); });

mozhn avatar Jun 01 '20 08:06 mozhn