Disable audio level indicator in calls.

This commit is contained in:
Rashad Sookram
2022-04-15 15:45:50 -04:00
committed by GitHub
parent d62d0efb1d
commit e9804eccbb
2 changed files with 8 additions and 2 deletions

View File

@@ -50,6 +50,12 @@ class AudioIndicatorView(context: Context, attrs: AttributeSet) : FrameLayout(co
fun bind(microphoneEnabled: Boolean, level: CallParticipant.AudioLevel?) {
micMuted.visible = !microphoneEnabled
if (WebRtcActionProcessor.AUDIO_LEVELS_INTERVAL != null) {
bindAudioLevel(microphoneEnabled, level)
}
}
private fun bindAudioLevel(microphoneEnabled: Boolean, level: CallParticipant.AudioLevel?) {
val wasShowingAudioLevel = showAudioLevel
showAudioLevel = microphoneEnabled && level != null
@@ -89,7 +95,7 @@ class AudioIndicatorView(context: Context, attrs: AttributeSet) : FrameLayout(co
val currentHeight = current?.animatedValue as? Float ?: 0f
return ValueAnimator.ofFloat(currentHeight, finalHeight).apply {
duration = WebRtcActionProcessor.AUDIO_LEVELS_INTERVAL.toLong()
duration = WebRtcActionProcessor.AUDIO_LEVELS_INTERVAL?.toLong() ?: 0
interpolator = DecelerateInterpolator()
}
}