Reputation: 2730
I'm trying to get a webRTC
app working on iPad (iOS7). I am at the point where both my devices display local video and one tries to display the remote video (the stream is added), but the remote video screen stays black.
While trying to figure out why my remote video screen is black, I found this callback
:
- (void)peerConnectionOnRenegotiationNeeded:(RTCPeerConnection *)peerConnection_ {
NSLog(@"peerConnectionOnRenegotiationNeeded:(RTCPeerConnection *)%@",peerConnection_);
}
In the appRTC
example it is implemented like this:
- (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 this method is called? I'm asking this because I think I have everything almost the same as the example, only the signaling is different, but it still doesn't work. I think I should maybe do something when this callback fires, because I don't have a "predefined negotiation strategy" like the example.
My environment:
Upvotes: 6
Views: 2883
Reputation: 1904
Although the post is fairly old, the cause of the black screen might not have anything to do with Peer renegotiation.
Personally, I found that the remote feed wasn't being displayed on my device (audio only) because I didn't make a strong reference to the RTCVideoTrack or RTCMediaStream objects, which meant the video track was being dropped whenever I tried to utilise it.
@property (nonatomic, strong) RTCMediaStream *remoteStream;
@property (nonatomic, strong) RTCVideoTrack *remoteVideoTrack;
By having these properties in a subclassed RTCPeerConnection object, and sending the object to my view controller via delegate call when the WebRTC connection has been established, I'm easily able to reference the video track and set a renderer for the video & audio data.
Upvotes: 1
Reputation: 2730
Turns out I just have to recreate the sdp and send it, I got audio working now.
Upvotes: 5