jinseongeun
Committed by GitHub

Set primarySpeaker muteIndicator visibility (#95)

* Add private keyword

* Set primarySpeaker muteIndicator visibility
@@ -87,6 +87,21 @@ class CallActivity : AppCompatActivity() { @@ -87,6 +87,21 @@ class CallActivity : AppCompatActivity() {
87 // Update new primary speaker identity 87 // Update new primary speaker identity
88 binding.identityText.text = primarySpeaker?.identity 88 binding.identityText.text = primarySpeaker?.identity
89 89
  90 + if (primarySpeaker != null) {
  91 + primarySpeaker::audioTracks.flow
  92 + .flatMapLatest { tracks ->
  93 + val audioTrack = tracks.firstOrNull()?.first
  94 + if (audioTrack != null) {
  95 + audioTrack::muted.flow
  96 + } else {
  97 + flowOf(true)
  98 + }
  99 + }
  100 + .collect { muted ->
  101 + binding.muteIndicator.visibility = if (muted) View.VISIBLE else View.INVISIBLE
  102 + }
  103 + }
  104 +
90 // observe videoTracks changes. 105 // observe videoTracks changes.
91 if (primarySpeaker != null) { 106 if (primarySpeaker != null) {
92 primarySpeaker::videoTracks.flow 107 primarySpeaker::videoTracks.flow