зеркало из 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.
|
* When defaulting to value, the default is saved in store for consistency reasons.
|
||||||
*/
|
*/
|
||||||
- (NSString *)currentVideoResolutionSettingFromStore;
|
- (NSString *)currentVideoResolutionSettingFromStore;
|
||||||
|
- (NSString *)readableResolution:(NSString *)resolution;
|
||||||
- (int)currentVideoResolutionWidthFromStore;
|
- (int)currentVideoResolutionWidthFromStore;
|
||||||
- (int)currentVideoResolutionHeightFromStore;
|
- (int)currentVideoResolutionHeightFromStore;
|
||||||
|
|
||||||
|
|
|
@ -42,6 +42,20 @@ static NSArray<NSString *> *videoCodecsStaticValues() {
|
||||||
return resolution;
|
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 {
|
- (BOOL)storeVideoResolutionSetting:(NSString *)resolution {
|
||||||
if (![[self availableVideoResolutions] containsObject:resolution]) {
|
if (![[self availableVideoResolutions] containsObject:resolution]) {
|
||||||
return NO;
|
return NO;
|
||||||
|
|
|
@ -57,7 +57,7 @@
|
||||||
NSString *storedResolution = [[[NCSettingsController sharedInstance] videoSettingsModel] currentVideoResolutionSettingFromStore];
|
NSString *storedResolution = [[[NCSettingsController sharedInstance] videoSettingsModel] currentVideoResolutionSettingFromStore];
|
||||||
BOOL isStoredResolution = [resolution isEqualToString:storedResolution];
|
BOOL isStoredResolution = [resolution isEqualToString:storedResolution];
|
||||||
|
|
||||||
cell.textLabel.text = resolution;
|
cell.textLabel.text = [[[NCSettingsController sharedInstance] videoSettingsModel] readableResolution:resolution];
|
||||||
cell.accessoryType = (isStoredResolution) ? UITableViewCellAccessoryCheckmark : UITableViewCellAccessoryNone;
|
cell.accessoryType = (isStoredResolution) ? UITableViewCellAccessoryCheckmark : UITableViewCellAccessoryNone;
|
||||||
|
|
||||||
return cell;
|
return cell;
|
||||||
|
|
|
@ -78,7 +78,8 @@ typedef enum VideoSettingsSection {
|
||||||
}
|
}
|
||||||
|
|
||||||
cell.textLabel.text = @"Video resolution";
|
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;
|
break;
|
||||||
case kVideoSettingsSectionDefaultVideo:
|
case kVideoSettingsSectionDefaultVideo:
|
||||||
|
|
Загрузка…
Ссылка в новой задаче