[Group Chat] How to play New VoiceMessage automatically?

[Problem/Question]
// Detailed description of issue.

How can I implement a feature where the latest received voice message of type VIEW_TYPE_VOICE_MESSAGE_OTHER is automatically played if the current chat window is open? However, if another voice message is already being played or if I am currently recording my own voice, the latest received voice message should not be played.

How can I implement this functionality?


class CustomChannelFragment : ChannelFragment() {

override fun onMessageClicked(view: View, position: Int, message: BaseMessage) {
Toast.makeText(requireContext(), “Message Click Sample”, Toast.LENGTH_SHORT).show()
super.onMessageClicked(view, position, message)
}


}

inner class CustomChannelMessageListAdapter(channel: GroupChannel, useMessageGroupUI: Boolean) :
MessageListAdapter(channel, useMessageGroupUI) {

    override fun onBindViewHolder(holder: MessageViewHolder, position: Int) {
        super.onBindViewHolder(holder, position)
        val message = getItem(position)

        if (message is FileMessage) {
            onMessageClicked(holder.itemView, position, message)
        } else {
            Log.d("ChannelMessageListAdapter", "message type - not file")
        }

    }

}

Looking at the code, it seems that although onBindViewHolder calls onMessageClicked, there is no actual implementation for playing the voice message.



// If problem, please fill out the below. If question, please delete.
[UIKit Version]
// What version of the SDK are you using?
New Android SDK

[Reproduction Steps]
// Please provide reproduction steps and, if possible, code snippets.
Always click event
[Frequency]
// How frequently is this issue occurring?

[Current impact]
// How is this currently impacting your implementation?