Only play consecutive voice notes.

This commit is contained in:
Nicholas Tinsley
2024-01-04 16:52:35 -05:00
parent 4d8a3dafe0
commit 940bf0603e

View File

@@ -266,6 +266,6 @@ class VoiceNotePlayerCallback(val context: Context, val player: VoiceNotePlayer)
}
private fun List<MessageRecord>.messageRecordsToVoiceNoteMediaItems(): List<MediaItem> {
return this.filter { it.hasAudio() }.mapNotNull { VoiceNoteMediaItemFactory.buildMediaItem(context, it) }
return this.takeWhile { it.hasAudio() }.mapNotNull { VoiceNoteMediaItemFactory.buildMediaItem(context, it) }
}
}