8000 [iOS] fix removeTrack methodChannel response, onTrack's `stream` and … · next-coder/flutter-webrtc@1a51904 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1a51904

Browse files
[iOS] fix removeTrack methodChannel response, onTrack's stream and track not being registered in native. (flutter-webrtc#404)
* [iOS] RemoveTrack result fix for iOS to return BOOL instead of nil as Dart code expects a boolean and throws []"result" called on null. * [iOS/Darwin] fix issue with video tracks not being registered `Not found video track for RTCMediaStream: {streamId}` in onTrack for Unified-plan as they are not being added to native. Co-authored-by: Ayman-Barghout <ayman.a.barghout@gmail.com>
1 pare
8000
nt e177408 commit 1a51904

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

common/darwin/Classes/FlutterRTCPeerConnection.m

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,10 @@ - (void)peerConnection:(RTCPeerConnection *)peerConnection
545545
}
546546
}
547547
}
548-
548+
549+
peerConnection.remoteTracks[rtpReceiver.track.trackId] = rtpReceiver.track;
550+
peerConnection.remoteStreams[mediaStreams[0].streamId] = mediaStreams[0];
551+
549552
eventSink(event);
550553
}
551554
}

common/darwin/Classes/FlutterWebRTCPlugin.m

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -680,8 +680,7 @@ - (void)handleMethodCall:(FlutterMethodCall*)call result:(FlutterResult) result
680680
details:nil]);
681681
return;
682682
}
683-
[peerConnection removeTrack:sender];
684-
result(nil);
683+
result(@{@"result": @([peerConnection removeTrack:sender])});
685684
} else if ([@"addTransceiver" isEqualToString:call.method]){
686685
NSDictionary* argsMap = call.arguments;
687686
NSString* peerConnectionId = argsMap[@"peerConnectionId"];

0 commit comments

Comments
 (0)
0