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/).
3
3
4
4
# Upcoming
5
5
6
+ ### ✅ Added
7
+ - Config the audioRecorder that is used when sending async voice messages.
8
+
6
9
### 🔄 Changed
7
10
8
11
# [ 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 {
156
156
public internal( set) var pendingAudioRecording : AddedVoiceRecording ?
157
157
158
158
internal lazy var audioRecorder : AudioRecording = {
159
- let audioRecorder = StreamAudioRecorder ( )
159
+ let audioRecorder = utils . audioRecorder
160
160
audioRecorder. subscribe ( self )
161
161
return audioRecorder
162
162
} ( )
Original file line number Diff line number Diff line change @@ -40,13 +40,25 @@ public class Utils {
40
40
}
41
41
}
42
42
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
+
43
54
public lazy var audioSessionFeedbackGenerator : AudioSessionFeedbackGenerator = StreamAudioSessionFeedbackGenerator ( )
44
55
45
56
var messageCachingUtils = MessageCachingUtils ( )
46
57
var messageListDateUtils : MessageListDateUtils
47
58
var channelControllerFactory = ChannelControllerFactory ( )
48
59
49
60
internal var _audioPlayer : AudioPlaying ?
61
+ internal var _audioRecorder : AudioRecording ?
50
62
51
63
public init (
52
64
dateFormatter: DateFormatter = . makeDefault( ) ,
You can’t perform that action at this time.
0 commit comments