Index: webrtc/examples/objc/AppRTCMobile/RTCIceCandidate+JSON.m |
diff --git a/webrtc/examples/objc/AppRTCMobile/RTCIceCandidate+JSON.m b/webrtc/examples/objc/AppRTCMobile/RTCIceCandidate+JSON.m |
index b1be7fb7e3cb995353768041d15cca94e789cdf8..7769e53417e48991aabcd0b40861acfd3f1650d5 100644 |
--- a/webrtc/examples/objc/AppRTCMobile/RTCIceCandidate+JSON.m |
+++ b/webrtc/examples/objc/AppRTCMobile/RTCIceCandidate+JSON.m |
@@ -18,6 +18,7 @@ static NSString const *kRTCICECandidateMidKey = @"id"; |
static NSString const *kRTCICECandidateMLineIndexKey = @"label"; |
static NSString const *kRTCICECandidateSdpKey = @"candidate"; |
static NSString const *kRTCICECandidatesTypeKey = @"candidates"; |
+static NSString const *kRTCICECandidatesServerUrlKey = @"url"; |
Taylor Brandstetter
2017/02/13 23:53:00
Candidate server URLs don't need to be signaled, s
Zhi Huang
2017/02/14 19:09:08
Done.
|
@implementation RTCIceCandidate (JSON) |
@@ -27,9 +28,11 @@ static NSString const *kRTCICECandidatesTypeKey = @"candidates"; |
NSString *sdp = dictionary[kRTCICECandidateSdpKey]; |
NSNumber *num = dictionary[kRTCICECandidateMLineIndexKey]; |
NSInteger mLineIndex = [num integerValue]; |
+ NSString *url = dictionary[kRTCICECandidatesServerUrlKey]; |
return [[RTCIceCandidate alloc] initWithSdp:sdp |
sdpMLineIndex:mLineIndex |
- sdpMid:mid]; |
+ sdpMid:mid |
+ serverUrl:url]; |
} |
+ (NSData *)JSONDataForIceCandidates:(NSArray<RTCIceCandidate *> *)candidates |
@@ -74,7 +77,8 @@ static NSString const *kRTCICECandidatesTypeKey = @"candidates"; |
kRTCICECandidateTypeKey : kRTCICECandidateTypeValue, |
kRTCICECandidateMLineIndexKey : @(self.sdpMLineIndex), |
kRTCICECandidateMidKey : self.sdpMid, |
- kRTCICECandidateSdpKey : self.sdp |
+ kRTCICECandidateSdpKey : self.sdp, |
+ kRTCICECandidatesServerUrlKey : self.serverUrl |
}; |
NSError *error = nil; |
NSData *data = |
@@ -92,7 +96,8 @@ static NSString const *kRTCICECandidatesTypeKey = @"candidates"; |
NSDictionary *json = @{ |
kRTCICECandidateMLineIndexKey : @(self.sdpMLineIndex), |
kRTCICECandidateMidKey : self.sdpMid, |
- kRTCICECandidateSdpKey : self.sdp |
+ kRTCICECandidateSdpKey : self.sdp, |
+ kRTCICECandidatesServerUrlKey : self.serverUrl |
}; |
return json; |
} |