mirror of
https://github.com/element-hq/element-android
synced 2024-11-27 03:48:12 +03:00
Merge pull request #7806 from vector-im/yostyle/update_live_status
[Voice Broadcast] Update live indicator color
This commit is contained in:
commit
14290abfcf
2 changed files with 2 additions and 7 deletions
|
@ -93,7 +93,7 @@ abstract class MessageVoiceBroadcastListeningItem : AbsMessageVoiceBroadcastItem
|
|||
override fun renderLiveIndicator(holder: Holder) {
|
||||
when {
|
||||
voiceBroadcastState == null || voiceBroadcastState == VoiceBroadcastState.STOPPED -> renderNoLiveIndicator(holder)
|
||||
voiceBroadcastState == VoiceBroadcastState.PAUSED || !player.isLiveListening -> renderPausedLiveIndicator(holder)
|
||||
voiceBroadcastState == VoiceBroadcastState.PAUSED -> renderPausedLiveIndicator(holder)
|
||||
else -> renderPlayingLiveIndicator(holder)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -130,7 +130,7 @@ class VoiceBroadcastPlayerImpl @Inject constructor(
|
|||
listeners[voiceBroadcast.voiceBroadcastId] = CopyOnWriteArrayList<Listener>().apply { add(listener) }
|
||||
}
|
||||
listener.onPlayingStateChanged(if (voiceBroadcast == currentVoiceBroadcast) playingState else State.IDLE)
|
||||
listener.onLiveModeChanged(voiceBroadcast == currentVoiceBroadcast && isLiveListening)
|
||||
listener.onLiveModeChanged(voiceBroadcast == currentVoiceBroadcast)
|
||||
}
|
||||
|
||||
override fun removeListener(voiceBroadcast: VoiceBroadcast, listener: Listener) {
|
||||
|
@ -373,11 +373,6 @@ class VoiceBroadcastPlayerImpl @Inject constructor(
|
|||
}
|
||||
|
||||
private fun onLiveListeningChanged(isLiveListening: Boolean) {
|
||||
currentVoiceBroadcast?.voiceBroadcastId?.let { voiceBroadcastId ->
|
||||
// Notify live mode change to all the listeners attached to the current voice broadcast id
|
||||
listeners[voiceBroadcastId]?.forEach { listener -> listener.onLiveModeChanged(isLiveListening) }
|
||||
}
|
||||
|
||||
// Live has ended and last chunk has been reached, we can stop the playback
|
||||
if (!isLiveListening && playingState == State.BUFFERING && playlist.currentSequence == mostRecentVoiceBroadcastEvent?.content?.lastChunkSequence) {
|
||||
stop()
|
||||
|
|
Loading…
Reference in a new issue