From c993daab44e24a3e9acec9602415dac189f7ae1b Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Fri, 23 Aug 2024 16:28:13 +0200 Subject: [PATCH] Allow entering Pip mode when `controls.canEnterPip()` cannot be evaluated. --- .../android/features/call/impl/utils/WebViewWebPipApi.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/features/call/impl/src/main/kotlin/io/element/android/features/call/impl/utils/WebViewWebPipApi.kt b/features/call/impl/src/main/kotlin/io/element/android/features/call/impl/utils/WebViewWebPipApi.kt index 43b7dfadde..baf682d6b3 100644 --- a/features/call/impl/src/main/kotlin/io/element/android/features/call/impl/utils/WebViewWebPipApi.kt +++ b/features/call/impl/src/main/kotlin/io/element/android/features/call/impl/utils/WebViewWebPipApi.kt @@ -26,7 +26,8 @@ class WebViewWebPipApi( override suspend fun canEnterPip(): Boolean { return suspendCoroutine { continuation -> webView.evaluateJavascript("controls.canEnterPip()") { result -> - continuation.resume(result == "true") + // Note if the method is not available, it will return "null" + continuation.resume(result == "true" || result == "null") } } }