Apprtc-swift
Apprtc-swift copied to clipboard
RTCdatachannel implementation?
hi, any idea how you'd implement RTCDataChannel into your video chat stream?
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?