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