mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-03 16:10:00 +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() {
|
private fun setWebViewAndroidNativeBridge() {
|
||||||
Timber.d("Adding callback in controls.onAudioPlaybackStarted")
|
Timber.d("Adding callback in controls.onAudioPlaybackStarted")
|
||||||
webView.evaluateJavascript("controls.onAudioPlaybackStarted = () => { androidNativeBridge.onTrackReady(); };", null)
|
webView.evaluateJavascript("controls.onAudioPlaybackStarted = () => { androidNativeBridge.onTrackReady(); };", null)
|
||||||
Timber.d("Adding callback in controls.onOutputDeviceSelect")
|
Timber.d("Adding callback in controls.onAudioDeviceSelect")
|
||||||
webView.evaluateJavascript("controls.onOutputDeviceSelect = (id) => { androidNativeBridge.setOutputDevice(id); };", null)
|
webView.evaluateJavascript("controls.onAudioDeviceSelect = (id) => { androidNativeBridge.setAudioDevice(id); };", null)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -293,8 +293,8 @@ class WebViewAudioManager(
|
|||||||
) {
|
) {
|
||||||
Timber.d("Updating available audio devices")
|
Timber.d("Updating available audio devices")
|
||||||
val deviceList = json.encodeToString(devices)
|
val deviceList = json.encodeToString(devices)
|
||||||
webView.evaluateJavascript("controls.setAvailableOutputDevices($deviceList);", {
|
webView.evaluateJavascript("controls.setAvailableAudioDevices($deviceList);", {
|
||||||
Timber.d("Audio: setAvailableOutputDevices result: $it")
|
Timber.d("Audio: setAvailableAudioDevices result: $it")
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -399,7 +399,7 @@ private class AndroidWebViewAudioBridge(
|
|||||||
private val onAudioPlaybackStarted: () -> Unit,
|
private val onAudioPlaybackStarted: () -> Unit,
|
||||||
) {
|
) {
|
||||||
@JavascriptInterface
|
@JavascriptInterface
|
||||||
fun setOutputDevice(id: String) {
|
fun setAudioDevice(id: String) {
|
||||||
Timber.d("Audio device selected in webview, id: $id")
|
Timber.d("Audio device selected in webview, id: $id")
|
||||||
onAudioDeviceSelected(id)
|
onAudioDeviceSelected(id)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user