Keep screen on when recording voice message

pull/531/head
ryanzhao 3 years ago
parent e49431d2eb
commit 13b7b1edb6

@ -762,6 +762,8 @@ extension ConversationVC : InputViewDelegate, MessageCellDelegate, ContextMenuAc
requestMicrophonePermissionIfNeeded() { [weak self] in
self?.cancelVoiceMessageRecording()
}
// Keep screen on
UIApplication.shared.isIdleTimerDisabled = false
guard AVAudioSession.sharedInstance().recordPermission == .granted else { return }
// Cancel any current audio playback
audioPlayer?.stop()
@ -810,6 +812,7 @@ extension ConversationVC : InputViewDelegate, MessageCellDelegate, ContextMenuAc
}
func endVoiceMessageRecording() {
UIApplication.shared.isIdleTimerDisabled = true
// Hide the UI
snInputView.hideVoiceMessageUI()
// Cancel the timer

Loading…
Cancel
Save