Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
69 Views

How to enable(or use) RTCConfiguration in iOS SDK?

The Documents for iOS SDK didn't show how to use RTCConfiguration. I used it as the code below, no effect. What's the right usage for RTCConfiguration ?

I want to change the configuration for ICE. The interfaces of the RTCPeerClientConfiguration for ICE has only one(candidateNetworkPolicy).
How to use RTCConfiguration in iOS SDK ?   3x!

iOS SDK Intel 官方文档只是给出了类说明,没有说明怎么使用。我使用了如下代码配置RTCConfiguration,好像没有起作用。正确使用方法应该是怎么样的?多谢指点!!
- (RTCPeerClient*)peerClient{
  if (_peerClient==nil){
    id<RTCP2PSignalingChannelProtocol> scc=[[SocketSignalingChannel alloc]init];
    RTCConfiguration* globalRTCconfig = [[RTCConfiguration alloc] init];
    globalRTCconfig.tcpCandidatePolicy = RTCTcpCandidatePolicyDisabled;
    globalRTCconfig.bundlePolicy = RTCBundlePolicyMaxBundle;
    globalRTCconfig.rtcpMuxPolicy = RTCRtcpMuxPolicyRequire;
    RTCPeerClientConfiguration* config=[[RTCPeerClientConfiguration alloc]init];

    NSArray *ice=[[NSArray alloc]initWithObjects:[[RTCIceServer alloc]initWithURLStrings:[[NSArray alloc]initWithObjects:@"turn:x.x.x.x?transport=udp", nil] username:@"xx" credential:@"xx"], nil];
    config.ICEServers=ice;
    config.mediaCodec.videoCodec=VideoCodecH264;
    config.candidateNetworkPolicy=RTCCandidateNetworkPolicyAll;
    _peerClient=[[RTCPeerClient alloc]initWithConfiguration:config signalingChannel:scc];
    [_peerClient addObserver:self];
  }
  return _peerClient;
}

 

Tags (2)
0 Kudos
4 Replies
Highlighted
Beginner
69 Views

I want to change the configuration for ICE. The interfaces of the RTCPeerClientConfiguration for ICE has only one(candidateNetworkPolicy).
How to use RTCConfiguration in iOS SDK ?   3x!

0 Kudos
Highlighted
69 Views

Hi Zhang,

Setting RTCConfiguration is not supported at this time. Only items in RTCPeerClientConfiguration work.

0 Kudos
Highlighted
Beginner
69 Views

Jianjun Z. (Intel) wrote:

Hi Zhang,

Setting RTCConfiguration is not supported at this time. Only items in RTCPeerClientConfiguration work.

I tested the demo(although I setted “config.candidateNetworkPolicy=RTCCandidateNetworkPolicyAll;), RTCPeerClientConfiguration can't deal with networks changing case. During the call, the network switch(eg.wifi-->4G) will cause the call interrupt. I found that the ice is not configured properly. So I need to change the RTCConfiguration. If only items in RTCPeerClientConfiguration work, how to deal with the network change case seamlessly

0 Kudos
Highlighted
69 Views

SDK 3.3 does not perform ICE restart when networks changed. config.candidateNetworkPolicy controls what kind of candidates are collected.

0 Kudos