Apprtc-swift icon indicating copy to clipboard operation
Apprtc-swift copied to clipboard

RTCdatachannel implementation?

Open galileomd opened this issue 8 years ago • 1 comments

hi, any idea how you'd implement RTCDataChannel into your video chat stream?

galileomd avatar May 20 '16 06:05 galileomd

in your ARDAppClient.m i have:

(void)startSignalingIfReady { if (!_isTurnComplete || !self.isRegisteredWithRoomServer) { return; } self.state = kARDAppClientStateConnected;

// Create peer connection. RTCMediaConstraints *constraints = [self defaultPeerConnectionConstraints]; _peerConnection = [_factory peerConnectionWithICEServers:_iceServers constraints:constraints delegate:self]; ///////// Initialize data channel RTCDataChannelInit *rtcChannelDataInit = [[RTCDataChannelInit alloc] init]; rtcChannelDataInit.isNegotiated = true; rtcChannelDataInit.streamId = 11; rtcChannelDataInit.isOrdered = true; _rtcDataChannel = [_peerConnection createDataChannelWithLabel:@"DataChannel" config:rtcChannelDataInit]; _rtcDataChannel.delegate = _delegate;

RTCMediaStream *localStream = [self createLocalMediaStream]; self.localMediaStream=localStream; [_peerConnection addStream:localStream]; if (_isInitiator) { [self sendOffer]; } else { [self waitForAnswer]; } }

doest quite seem to do it though.. seems the deleate isn't firing correctly. any thoughts?

galileomd avatar May 20 '16 12:05 galileomd