Index: webrtc/examples/objc/AppRTCMobile/ios/ARDSettingsStore.m |
diff --git a/webrtc/examples/objc/AppRTCMobile/ios/ARDSettingsStore.m b/webrtc/examples/objc/AppRTCMobile/ios/ARDSettingsStore.m |
index 6b3642e00697f1581b04a487ae86da6f22f49818..04c78ea428b1e2623e244bf64b673877c7e3e5a9 100644 |
--- a/webrtc/examples/objc/AppRTCMobile/ios/ARDSettingsStore.m |
+++ b/webrtc/examples/objc/AppRTCMobile/ios/ARDSettingsStore.m |
@@ -10,19 +10,31 @@ |
#import "ARDSettingsStore.h" |
-static NSString *const kUserDefaultsMediaConstraintsKey = |
+static NSString *const kMediaConstraintsKey = |
@"rtc_video_resolution_media_constraints_key"; |
+static NSString *const kBitrateKey = @"rtc_max_bitrate_key"; |
NS_ASSUME_NONNULL_BEGIN |
@implementation ARDSettingsStore |
+- (NSUserDefaults *)storage { |
tkchin_webrtc
2016/11/14 21:14:32
Why not store this as an instance variable?
daniela-webrtc
2016/11/16 13:21:17
Done.
|
+ return [NSUserDefaults standardUserDefaults]; |
+} |
+ |
- (nullable NSString *)videoResolutionConstraintsSetting { |
tkchin_webrtc
2016/11/14 21:14:32
nit: a bit redundant to have a settingsstore objec
daniela-webrtc
2016/11/16 13:21:17
Done.
|
- return [[NSUserDefaults standardUserDefaults] objectForKey:kUserDefaultsMediaConstraintsKey]; |
+ return [[self storage] objectForKey:kMediaConstraintsKey]; |
} |
- (void)setVideoResolutionConstraintsSetting:(NSString *)constraintsString { |
- [[NSUserDefaults standardUserDefaults] setObject:constraintsString |
- forKey:kUserDefaultsMediaConstraintsKey]; |
+ [[self storage] setObject:constraintsString forKey:kMediaConstraintsKey]; |
tkchin_webrtc
2016/11/14 21:14:32
It's more predictable if you force a sync after se
daniela-webrtc
2016/11/16 13:21:17
Done.
|
+} |
+ |
+- (nullable NSNumber *)maxBitrateSetting { |
+ return [[self storage] objectForKey:kBitrateKey]; |
+} |
+ |
+- (void)setMaxBitrateSetting:(nullable NSNumber *)value { |
+ [[self storage] setObject:value forKey:kBitrateKey]; |
} |
@end |