What to do in webrtc callback? - (void) peerConnectionOnRenegotiationNeeded: (RTCPeerConnection *) peerConnection "?

I am trying to get a webRTC application running on an iPad (iOS7). I am at the point where both devices display local video, and one is trying to display the remote video (stream added), but the remote video screen remains black.
When trying to find out why my remote video screen is black, I found this callback :

 - (void)peerConnectionOnRenegotiationNeeded:(RTCPeerConnection *)peerConnection_ { NSLog(@"peerConnectionOnRenegotiationNeeded:(RTCPeerConnection *)%@",peerConnection_); } 

In the appRTC example appRTC it is implemented as follows:

 - (void)peerConnectionOnRenegotiationNeeded:(RTCPeerConnection*)peerConnection { dispatch_async(dispatch_get_main_queue(), ^{ NSLog(@"PCO onRenegotiationNeeded - ignoring because AppRTC has a " "predefined negotiation strategy"); }); } 

What should be done when calling this method? I ask about this because I think that everything is almost the same as in the example, only the alarm is different, but it still does not work. I think I have to do something when this callback fires because I don’t have a “predefined negotiation strategy”, as in the example.

My environment:

  • Testing on iPad3 and iPad4
  • Both launch the latest version of iOS
  • Development Using Xcode Version 5.1.1 (5B1008)
  • I have my own alarm server
  • I did not install a stunning server as I am still testing the local network
  • I tried to set up a stunning server, but that didn't matter
+5
source share
2 answers

It turns out I just need to recreate sdp and send it, now I have a sound.

+4
source

Although the message is quite old, the reason for the black screen may have nothing to do with Peer re-convention.

Personally, I found that the remote feed did not appear on my device (audio only) because I didn’t refer very well to the RTCVideoTrack or RTCMediaStream objects, which meant that the video track was reset whenever I tried to use it.

 @property (nonatomic, strong) RTCMediaStream *remoteStream; @property (nonatomic, strong) RTCVideoTrack *remoteVideoTrack; 

Having these properties in an object of the RTCPeerConnection subclass and sending the object to my view controller through a delegate call when the WebRTC connection is established, I can easily reference the video track and install the visualization tool for video and audio data.

+1
source

Source: https://habr.com/ru/post/1200810/


All Articles