diff options
author | Allan Wang <me@allanwang.ca> | 2018-01-25 00:23:44 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-25 00:23:44 -0500 |
commit | 8bfbbac2b8f364bb03866712b113cd2f5de8b9d9 (patch) | |
tree | 8001dd1e467ddd22e4dcec84a9c9e3aa36d2bbb8 /app/src/main/kotlin/com/pitchedapps/frost/web/FrostJSI.kt | |
parent | 6fe7bd43581d5dfbb85e4e0deb524e65d07b5ce6 (diff) | |
download | frost-8bfbbac2b8f364bb03866712b113cd2f5de8b9d9.tar.gz frost-8bfbbac2b8f364bb03866712b113cd2f5de8b9d9.tar.bz2 frost-8bfbbac2b8f364bb03866712b113cd2f5de8b9d9.zip |
Enhancement/video (#669)v1.8.0
* Test stricter video extractor
* Mess around with mutations
* Revert back to strict click listener
* Update theme
* Update dependencies
* Update theme
* Create pip toggle
* Add pip disabler
* Update theme
* Update theme
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/web/FrostJSI.kt')
-rw-r--r-- | app/src/main/kotlin/com/pitchedapps/frost/web/FrostJSI.kt | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/web/FrostJSI.kt b/app/src/main/kotlin/com/pitchedapps/frost/web/FrostJSI.kt index d735fd50..4a3fa2a2 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/web/FrostJSI.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/web/FrostJSI.kt @@ -26,17 +26,19 @@ class FrostJSI(val web: FrostWebView) { * or {@code false} otherwise, meaning the event should be propagated */ @JavascriptInterface - fun loadUrl(url: String?): Boolean - = if (url == null) false else web.requestWebOverlay(url) + fun loadUrl(url: String?): Boolean = if (url == null) false else web.requestWebOverlay(url) @JavascriptInterface - fun loadVideo(url: String?, isGif: Boolean) { - if (url != null) - web.post { - (context as? VideoViewHolder)?.showVideo(url, isGif) - ?: L.d { "Could not load video; contract not implemented" } + fun loadVideo(url: String?, isGif: Boolean): Boolean = + if (url != null && Prefs.enablePip) { + web.post { + (context as? VideoViewHolder)?.showVideo(url, isGif) + ?: L.e { "Could not load video; contract not implemented" } + } + true + } else { + false } - } @JavascriptInterface fun reloadBaseUrl(animate: Boolean) { |