Add an (optional) prompt when sending a video to select its size.

Use high quality when filming video in-app.
This commit is contained in:
Doug
2021-08-16 17:48:26 +01:00
parent 7dea78bae9
commit a9d5d4d5d7
7 changed files with 97 additions and 26 deletions

View File

@@ -89,7 +89,8 @@ enum
enum
{
MEDIA_SETTINGS_CONFIRM_IMAGE_SIZE = 0
MEDIA_SETTINGS_CONFIRM_IMAGE_SIZE = 0,
MEDIA_SETTINGS_CONFIRM_VIDEO_SIZE
};
enum
@@ -355,10 +356,11 @@ TableViewSectionsDelegate>
sectionUserSettings.headerTitle = NSLocalizedStringFromTable(@"settings_user_settings", @"Vector", nil);
[tmpSections addObject:sectionUserSettings];
if (BuildSettings.settingsScreenShowConfirmImageSize)
if (BuildSettings.settingsScreenShowConfirmMediaSize)
{
Section *sectionMedia = [Section sectionWithTag:SECTION_TAG_MEDIA];
[sectionMedia addRowWithTag:MEDIA_SETTINGS_CONFIRM_IMAGE_SIZE];
[sectionMedia addRowWithTag:MEDIA_SETTINGS_CONFIRM_VIDEO_SIZE];
sectionMedia.headerTitle = NSLocalizedStringFromTable(@"settings_media", @"Vector", nil);
[tmpSections addObject:sectionMedia];
}
@@ -1833,6 +1835,18 @@ TableViewSectionsDelegate>
labelAndSwitchCell.mxkSwitch.enabled = YES;
[labelAndSwitchCell.mxkSwitch addTarget:self action:@selector(toggleConfirmImageSize:) forControlEvents:UIControlEventTouchUpInside];
cell = labelAndSwitchCell;
}
else if (row == MEDIA_SETTINGS_CONFIRM_VIDEO_SIZE)
{
MXKTableViewCellWithLabelAndSwitch* labelAndSwitchCell = [self getLabelAndSwitchCell:tableView forIndexPath:indexPath];
labelAndSwitchCell.mxkLabel.text = NSLocalizedStringFromTable(@"settings_confirm_video_size", @"Vector", nil);
labelAndSwitchCell.mxkSwitch.on = RiotSettings.shared.promptForVideoConversionPreset;
labelAndSwitchCell.mxkSwitch.onTintColor = ThemeService.shared.theme.tintColor;
labelAndSwitchCell.mxkSwitch.enabled = YES;
[labelAndSwitchCell.mxkSwitch addTarget:self action:@selector(toggleConfirmVideoSize:) forControlEvents:UIControlEventTouchUpInside];
cell = labelAndSwitchCell;
}
}
@@ -2877,6 +2891,11 @@ TableViewSectionsDelegate>
RiotSettings.shared.roomInputToolbarCompressionMode = sender.on ? MXKRoomInputToolbarCompressionModePrompt : MXKRoomInputToolbarCompressionModeNone;
}
- (void)toggleConfirmVideoSize:(UISwitch *)sender
{
RiotSettings.shared.promptForVideoConversionPreset = sender.on;
}
- (void)togglePushNotifications:(UISwitch *)sender
{
// Check first whether the user allow notification from system settings