Allow entering Pip mode when controls.canEnterPip() cannot be evaluated.
This commit is contained in:
parent
508e9106e2
commit
c993daab44
1 changed files with 2 additions and 1 deletions
|
|
@ -26,7 +26,8 @@ class WebViewWebPipApi(
|
||||||
override suspend fun canEnterPip(): Boolean {
|
override suspend fun canEnterPip(): Boolean {
|
||||||
return suspendCoroutine { continuation ->
|
return suspendCoroutine { continuation ->
|
||||||
webView.evaluateJavascript("controls.canEnterPip()") { result ->
|
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")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue