Display readable video resolutions.

Signed-off-by: Ivan Sein <ivan@nextcloud.com>
This commit is contained in:
Ivan Sein 2018-03-15 19:08:22 +01:00
Родитель 363033fedd
Коммит 4b5ea23dde
4 изменённых файлов: 18 добавлений и 2 удалений

1
ThirdParty/AppRTC/ARDSettingsModel.h поставляемый
Просмотреть файл

@ -34,6 +34,7 @@ NS_ASSUME_NONNULL_BEGIN
* When defaulting to value, the default is saved in store for consistency reasons.
*/
- (NSString *)currentVideoResolutionSettingFromStore;
- (NSString *)readableResolution:(NSString *)resolution;
- (int)currentVideoResolutionWidthFromStore;
- (int)currentVideoResolutionHeightFromStore;

14
ThirdParty/AppRTC/ARDSettingsModel.m поставляемый
Просмотреть файл

@ -42,6 +42,20 @@ static NSArray<NSString *> *videoCodecsStaticValues() {
return resolution;
}
- (NSString *)readableResolution:(NSString *)resolution {
NSString *readableResolution = @"Unknown";
if ([resolution isEqualToString:videoResolutionsStaticValues()[0]]) {
readableResolution = @"Low";
} else if ([resolution isEqualToString:videoResolutionsStaticValues()[1]]) {
readableResolution = @"Normal";
} else if ([resolution isEqualToString:videoResolutionsStaticValues()[2]]) {
readableResolution = @"High";
} else if ([resolution isEqualToString:videoResolutionsStaticValues()[3]]) {
readableResolution = @"HD";
}
return readableResolution;
}
- (BOOL)storeVideoResolutionSetting:(NSString *)resolution {
if (![[self availableVideoResolutions] containsObject:resolution]) {
return NO;

Просмотреть файл

@ -57,7 +57,7 @@
NSString *storedResolution = [[[NCSettingsController sharedInstance] videoSettingsModel] currentVideoResolutionSettingFromStore];
BOOL isStoredResolution = [resolution isEqualToString:storedResolution];
cell.textLabel.text = resolution;
cell.textLabel.text = [[[NCSettingsController sharedInstance] videoSettingsModel] readableResolution:resolution];
cell.accessoryType = (isStoredResolution) ? UITableViewCellAccessoryCheckmark : UITableViewCellAccessoryNone;
return cell;

Просмотреть файл

@ -78,7 +78,8 @@ typedef enum VideoSettingsSection {
}
cell.textLabel.text = @"Video resolution";
cell.detailTextLabel.text = [[[NCSettingsController sharedInstance] videoSettingsModel] currentVideoResolutionSettingFromStore];
NSString *resolution = [[[NCSettingsController sharedInstance] videoSettingsModel] currentVideoResolutionSettingFromStore];
cell.detailTextLabel.text = [[[NCSettingsController sharedInstance] videoSettingsModel] readableResolution:resolution];
}
break;
case kVideoSettingsSectionDefaultVideo: