Skip to content

[Bug]: Voice recording doesnt stop sometimes when user plays an recording or opens an attachment #3678

@prateekrk

Description

@prateekrk

Actual behaviour

We have added custom code so that,

  1. Voice recording stops if user plays any already sent recordings
    class HMECustomVoiceRecordingViewController: VoiceRecordingVC { override func audioPlayer(_ audioPlayer: any AudioPlaying, didUpdateContext context: AudioPlaybackContext) { if (content.state == .locked || content.state == .recording), context.state == .loading { self.audioRecorder.stopRecording() } super.audioPlayer(audioPlayer, didUpdateContext: context) } }
  2. Or User opens any attachmentclass HMECustomChatMessageListRouter: ChatMessageListRouter { weak var galleryShownDelegate: HMECoachChatShowGalleryDelegate? override func showGallery(message: StreamChat.ChatMessage, initialAttachmentId: AttachmentId, previews: [any GalleryItemPreview]) { super.showGallery(message: message, initialAttachmentId: initialAttachmentId, previews: previews) galleryShownDelegate?.galleryViewShown() } }

Expected behaviour

Recording has to be stopped

Steps to reproduce

1. Start recording
2. Open an attachment or play already sent recording

Note: This is an intermittent issue

Which packages are you using?

StreamChatUI

Which SDK version are you using?

4.77.0

Which iOS version is the issue reproducible?

18.4.1

Which iPhone Device is the issue reproducible?

iPhone 16

Which Xcode version are you using?

16.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions