mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-10-31 16:22:49 +00:00
call: Remove deprecated web<->EX api calls, use the new ones (#6628)
* call: Remove deprecated web<->EX api calls, use the new ones * ktlint format
This commit is contained in:
+5
-5
@@ -265,8 +265,8 @@ 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)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -293,8 +293,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")
|
||||
})
|
||||
}
|
||||
|
||||
@@ -399,7 +399,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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user