File tree 1 file changed +11
-6
lines changed 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -493,16 +493,21 @@ -(void)mediaStreamGetTracks:(NSString*)streamId
493
493
}
494
494
}
495
495
496
- - (RTCMediaStream*)streamForId : (NSString *)streamId
496
+ - (RTCMediaStream*)streamForId : (NSString *)streamId peerConnectionId : ( NSString *) peerConnectionId
497
497
{
498
498
RTCMediaStream *stream = _localStreams[streamId];
499
499
if (!stream) {
500
- for (RTCPeerConnection *peerConnection in _peerConnections.allValues ) {
501
- stream = peerConnection.remoteStreams [streamId];
502
- if (stream) {
503
- break ;
500
+ if (peerConnectionId.length > 0 ) {
501
+ RTCPeerConnection *peerConnection = [_peerConnections objectForKey: peerConnectionId];
502
+ stream = peerConnection.remoteStreams [streamId];
503
+ } else {
504
+ for (RTCPeerConnection *peerConnection in _peerConnections.allValues ) {
505
+ stream = peerConnection.remoteStreams [streamId];
506
+ if (stream) {
507
+ break ;
508
+ }
504
509
}
505
- }
510
+ }
506
511
}
507
512
return stream;
508
513
}
You can’t perform that action at this time.
0 commit comments