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
19
19
import androidx.core.content.getSystemService
20
20
import kotlinx.coroutines.CoroutineScope
21
21
import kotlinx.coroutines.Dispatchers
22
+ import kotlinx.coroutines.delay
22
23
import kotlinx.coroutines.launch
23
24
import kotlinx.serialization.Serializable
24
25
import kotlinx.serialization.Transient
25
26
import kotlinx.serialization.json.Json
26
27
import timber.log.Timber
27
28
import java.util.concurrent.Executors
28
29
import java.util.concurrent.atomic.AtomicBoolean
30
+ import kotlin.time.Duration.Companion.milliseconds
29
31
30
32
/* *
31
33
* This class manages the audio devices for a WebView.
@@ -221,6 +223,10 @@ class WebViewAudioManager(
221
223
},
222
224
onAudioPlaybackStarted = {
223
225
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
+
224
230
// Calling this ahead of time makes the default audio device to not use the right audio stream
225
231
setAvailableAudioDevices()
226
232
You can’t perform that action at this time.
0 commit comments