зеркало из https://github.com/nextcloud/talk-ios.git
Display readable video resolutions.
Signed-off-by: Ivan Sein <ivan@nextcloud.com>
This commit is contained in:
Родитель
363033fedd
Коммит
4b5ea23dde
|
@ -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;
|
||||
|
||||
|
|
|
@ -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:
|
||||
|
|
Загрузка…
Ссылка в новой задаче