File tree Expand file tree Collapse file tree 3 files changed +16
-1
lines changed
Sources/StreamChatSwiftUI Expand file tree Collapse file tree 3 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
33
44# Upcoming
55
6+ ### ✅ Added
7+ - Config the audioRecorder that is used when sending async voice messages.
8+
69### 🔄 Changed
710
811# [ 4.48.0] ( https://github.com/GetStream/stream-chat-swiftui/releases/tag/4.48.0 )
Original file line number Diff line number Diff line change @@ -156,7 +156,7 @@ open class MessageComposerViewModel: ObservableObject {
156156 public internal( set) var pendingAudioRecording : AddedVoiceRecording ?
157157
158158 internal lazy var audioRecorder : AudioRecording = {
159- let audioRecorder = StreamAudioRecorder ( )
159+ let audioRecorder = utils . audioRecorder
160160 audioRecorder. subscribe ( self )
161161 return audioRecorder
162162 } ( )
Original file line number Diff line number Diff line change @@ -40,13 +40,25 @@ public class Utils {
4040 }
4141 }
4242
43+ public var audioRecorderBuilder : ( ) -> AudioRecording = { StreamAudioRecorder ( ) }
44+ public var audioRecorder : AudioRecording {
45+ if let _audioRecorder {
46+ return _audioRecorder
47+ } else {
48+ let recorder = audioRecorderBuilder ( )
49+ _audioRecorder = recorder
50+ return recorder
51+ }
52+ }
53+
4354 public lazy var audioSessionFeedbackGenerator : AudioSessionFeedbackGenerator = StreamAudioSessionFeedbackGenerator ( )
4455
4556 var messageCachingUtils = MessageCachingUtils ( )
4657 var messageListDateUtils : MessageListDateUtils
4758 var channelControllerFactory = ChannelControllerFactory ( )
4859
4960 internal var _audioPlayer : AudioPlaying ?
61+ internal var _audioRecorder : AudioRecording ?
5062
5163 public init (
5264 dateFormatter: DateFormatter = . makeDefault( ) ,
You can’t perform that action at this time.
0 commit comments