File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -504,7 +504,6 @@ - (void)peerConnection:(RTCPeerConnection*)peerConnection didOpenDataChannel:(RT
504
504
505
505
dataChannel.eventChannel = eventChannel;
506
506
dataChannel.flutterChannelId = dataChannelId;
507
- [eventChannel setStreamHandler: dataChannel];
508
507
509
508
FlutterEventSink eventSink = peerConnection.eventSink ;
510
509
if (eventSink){
@@ -514,6 +513,11 @@ - (void)peerConnection:(RTCPeerConnection*)peerConnection didOpenDataChannel:(RT
514
513
@" label" : dataChannel.label
515
514
});
516
515
}
516
+
517
+ dispatch_async (dispatch_get_main_queue (), ^{
518
+ // setStreamHandler on main thread
519
+ [eventChannel setStreamHandler: dataChannel];
520
+ });
517
521
}
518
522
519
523
/* * Called any time the PeerConnectionState changes. */
You can’t perform that action at this time.
0 commit comments