2014-11-27 00:52:38 +00:00
|
|
|
/*
|
2015-08-05 15:48:13 -07:00
|
|
|
* Copyright 2014 The WebRTC Project Authors. All rights reserved.
|
2014-11-27 00:52:38 +00:00
|
|
|
*
|
2015-08-05 15:48:13 -07:00
|
|
|
* Use of this source code is governed by a BSD-style license
|
|
|
|
|
* that can be found in the LICENSE file in the root of the source
|
|
|
|
|
* tree. An additional intellectual property rights grant can be found
|
|
|
|
|
* in the file PATENTS. All contributing project authors may
|
|
|
|
|
* be found in the AUTHORS file in the root of the source tree.
|
2014-11-27 00:52:38 +00:00
|
|
|
*/
|
|
|
|
|
|
2016-03-13 22:08:26 -07:00
|
|
|
#import "RTCIceServer+JSON.h"
|
2014-11-27 00:52:38 +00:00
|
|
|
|
2020-05-04 16:14:32 +02:00
|
|
|
@implementation RTC_OBJC_TYPE (RTCIceServer)
|
|
|
|
|
(JSON)
|
2014-11-27 00:52:38 +00:00
|
|
|
|
2025-01-09 02:36:06 -08:00
|
|
|
+ (RTC_OBJC_TYPE(RTCIceServer) *)serverFromJSONDictionary
|
|
|
|
|
: (NSDictionary *)dictionary {
|
2017-01-13 05:59:46 -08:00
|
|
|
NSArray *turnUrls = dictionary[@"urls"];
|
|
|
|
|
NSString *username = dictionary[@"username"] ?: @"";
|
|
|
|
|
NSString *credential = dictionary[@"credential"] ?: @"";
|
2020-05-04 16:14:32 +02:00
|
|
|
return [[RTC_OBJC_TYPE(RTCIceServer) alloc] initWithURLStrings:turnUrls
|
|
|
|
|
username:username
|
|
|
|
|
credential:credential];
|
2014-11-27 00:52:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@end
|