File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
features/call/impl/src/main/kotlin/io/element/android/features/call/impl/utils Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -19,13 +19,15 @@ import androidx.annotation.RequiresApi
1919import androidx.core.content.getSystemService
2020import kotlinx.coroutines.CoroutineScope
2121import kotlinx.coroutines.Dispatchers
22+ import kotlinx.coroutines.delay
2223import kotlinx.coroutines.launch
2324import kotlinx.serialization.Serializable
2425import kotlinx.serialization.Transient
2526import kotlinx.serialization.json.Json
2627import timber.log.Timber
2728import java.util.concurrent.Executors
2829import java.util.concurrent.atomic.AtomicBoolean
30+ import kotlin.time.Duration.Companion.milliseconds
2931
3032/* *
3133 * This class manages the audio devices for a WebView.
@@ -221,6 +223,10 @@ class WebViewAudioManager(
221223 },
222224 onAudioPlaybackStarted = {
223225 coroutineScope.launch(Dispatchers .Main ) {
226+ // Even with the callback, it seems like starting the audio takes a bit on the webview side,
227+ // so we add an extra delay here to make sure it's ready
228+ delay(500 .milliseconds)
229+
224230 // Calling this ahead of time makes the default audio device to not use the right audio stream
225231 setAvailableAudioDevices()
226232
You can’t perform that action at this time.
0 commit comments