mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-22 17:42:45 +02:00
VB: Make the view model aware of every chunk new coming
this reactive approach will help to cache and reorder them by sequence
This commit is contained in:
+6
-4
@@ -65,9 +65,6 @@ class VoiceBroadcastPlaybackViewModel: VoiceBroadcastPlaybackViewModelType, Voic
|
||||
private func play() {
|
||||
MXLog.debug("[VoiceBroadcastPlaybackViewModel] play")
|
||||
|
||||
// TODO: But what?
|
||||
let requiredNumberOfSamples = 100// playbackView.getRequiredNumberOfSamples() ?
|
||||
|
||||
guard let voiceBroadcast = voiceBroadcastAggregator.voiceBroadcast else {
|
||||
assert(false, "Cannot play. No voice broadcast data")
|
||||
}
|
||||
@@ -77,7 +74,8 @@ class VoiceBroadcastPlaybackViewModel: VoiceBroadcastPlaybackViewModelType, Voic
|
||||
return
|
||||
}
|
||||
|
||||
cacheManager.loadAttachment(attachment, numberOfSamples: requiredNumberOfSamples) { [weak self] result in
|
||||
// numberOfSamples is for the equalizer view we do not support yet
|
||||
cacheManager.loadAttachment(attachment, numberOfSamples: 1) { [weak self] result in
|
||||
|
||||
guard let self = self else {
|
||||
return
|
||||
@@ -137,6 +135,10 @@ extension VoiceBroadcastPlaybackViewModel: VoiceBroadcastAggregatorDelegate {
|
||||
MXLog.debug("AAAA voiceBroadcastAggregatordidFailWithError")
|
||||
}
|
||||
|
||||
func voiceBroadcastAggregator(_ aggregator: VoiceBroadcastAggregator, didReceiveChunk: VoiceBroadcastChunk) {
|
||||
MXLog.debug("AAAA voiceBroadcastAggregatorDidReceiveChunk")
|
||||
}
|
||||
|
||||
func voiceBroadcastAggregatorDidUpdateData(_ aggregator: VoiceBroadcastAggregator) {
|
||||
MXLog.debug("AAAA voiceBroadcastAggregatorDidUpdateData")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user