Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(196)

Unified Diff: webrtc/examples/objc/AppRTCMobile/RTCIceServer+JSON.m

Issue 2627523004: Update ice server provider response format in iOS AppRTCMobile (Closed)
Patch Set: lower similarity and rebase Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/examples/objc/AppRTCMobile/RTCIceServer+JSON.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/examples/objc/AppRTCMobile/RTCIceServer+JSON.m
diff --git a/webrtc/examples/objc/AppRTCMobile/RTCIceServer+JSON.m b/webrtc/examples/objc/AppRTCMobile/RTCIceServer+JSON.m
index 0bc31bb875923804fea96de1280d116498f161f3..912b521c48bf2aa09496919a7d77c37b48ade3e7 100644
--- a/webrtc/examples/objc/AppRTCMobile/RTCIceServer+JSON.m
+++ b/webrtc/examples/objc/AppRTCMobile/RTCIceServer+JSON.m
@@ -10,34 +10,15 @@
#import "RTCIceServer+JSON.h"
-static NSString const *kRTCICEServerUsernameKey = @"username";
-static NSString const *kRTCICEServerPasswordKey = @"password";
-static NSString const *kRTCICEServerUrisKey = @"uris";
-static NSString const *kRTCICEServerUrlKey = @"urls";
-static NSString const *kRTCICEServerCredentialKey = @"credential";
-
@implementation RTCIceServer (JSON)
+ (RTCIceServer *)serverFromJSONDictionary:(NSDictionary *)dictionary {
- NSString *url = dictionary[kRTCICEServerUrlKey];
- NSString *username = dictionary[kRTCICEServerUsernameKey];
- NSString *credential = dictionary[kRTCICEServerCredentialKey];
- username = username ? username : @"";
- credential = credential ? credential : @"";
- return [[RTCIceServer alloc] initWithURLStrings:@[url]
+ NSArray *turnUrls = dictionary[@"urls"];
+ NSString *username = dictionary[@"username"] ?: @"";
+ NSString *credential = dictionary[@"credential"] ?: @"";
+ return [[RTCIceServer alloc] initWithURLStrings:turnUrls
username:username
credential:credential];
}
-+ (RTCIceServer *)serverFromCEODJSONDictionary:(NSDictionary *)dictionary {
- NSString *username = dictionary[kRTCICEServerUsernameKey];
- NSString *password = dictionary[kRTCICEServerPasswordKey];
- NSArray *uris = dictionary[kRTCICEServerUrisKey];
- RTCIceServer *server =
- [[RTCIceServer alloc] initWithURLStrings:uris
- username:username
- credential:password];
- return server;
-}
-
@end
« no previous file with comments | « webrtc/examples/objc/AppRTCMobile/RTCIceServer+JSON.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698