From e4ccec1cdd8c8de6b59964206119a4ee51148024 Mon Sep 17 00:00:00 2001 From: Valere Date: Mon, 20 Apr 2026 14:53:05 +0200 Subject: [PATCH] call: Remove deprecated web<->EX api calls, use the new ones --- .../features/call/impl/utils/WebViewAudioManager.kt | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/features/call/impl/src/main/kotlin/io/element/android/features/call/impl/utils/WebViewAudioManager.kt b/features/call/impl/src/main/kotlin/io/element/android/features/call/impl/utils/WebViewAudioManager.kt index 2d674d21af..a72acb0594 100644 --- a/features/call/impl/src/main/kotlin/io/element/android/features/call/impl/utils/WebViewAudioManager.kt +++ b/features/call/impl/src/main/kotlin/io/element/android/features/call/impl/utils/WebViewAudioManager.kt @@ -268,10 +268,9 @@ class WebViewAudioManager( private fun setWebViewAndroidNativeBridge() { Timber.d("Adding callback in controls.onAudioPlaybackStarted") webView.evaluateJavascript("controls.onAudioPlaybackStarted = () => { androidNativeBridge.onTrackReady(); };", null) - Timber.d("Adding callback in controls.onOutputDeviceSelect") - webView.evaluateJavascript("controls.onOutputDeviceSelect = (id) => { androidNativeBridge.setOutputDevice(id); };", null) + Timber.d("Adding callback in controls.onAudioDeviceSelect") + webView.evaluateJavascript("controls.onAudioDeviceSelect = (id) => { androidNativeBridge.setAudioDevice(id); };", null) } - /** * Returns the list of available audio devices, sorted by likelihood of it being used for communication. * @@ -296,8 +295,8 @@ class WebViewAudioManager( ) { Timber.d("Updating available audio devices") val deviceList = json.encodeToString(devices) - webView.evaluateJavascript("controls.setAvailableOutputDevices($deviceList);", { - Timber.d("Audio: setAvailableOutputDevices result: $it") + webView.evaluateJavascript("controls.setAvailableAudioDevices($deviceList);", { + Timber.d("Audio: setAvailableAudioDevices result: $it") }) } @@ -402,7 +401,7 @@ private class AndroidWebViewAudioBridge( private val onAudioPlaybackStarted: () -> Unit, ) { @JavascriptInterface - fun setOutputDevice(id: String) { + fun setAudioDevice(id: String) { Timber.d("Audio device selected in webview, id: $id") onAudioDeviceSelected(id) }