From 2b51bc4bfa86863ed14b550fe3281840587ab038 Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Sun, 12 Nov 2017 02:48:36 -0500 Subject: enhancement/video-player (#480) * Add toolbar visibility toggle and draw it over viewer * Set contract bindings once available * Fix video url param error and prepare progressanimator * Add gif support and better transitions * Interface a lot of things * Reorder back press * Clean up files and fix selector * Add gif support * Redraw bounds when necessary --- app/src/main/kotlin/com/pitchedapps/frost/web/FrostJSI.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'app/src/main/kotlin/com/pitchedapps/frost/web/FrostJSI.kt') 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 4700c894..71ceb4ca 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/web/FrostJSI.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/web/FrostJSI.kt @@ -4,6 +4,7 @@ import android.content.Context import android.support.v4.widget.SwipeRefreshLayout import android.webkit.JavascriptInterface import com.pitchedapps.frost.activities.MainActivity +import com.pitchedapps.frost.contracts.VideoViewerContract import com.pitchedapps.frost.dbflow.CookieModel import com.pitchedapps.frost.facebook.FbCookie import com.pitchedapps.frost.utils.* @@ -36,9 +37,10 @@ class FrostJSI(val webView: FrostWebViewCore) { = if (url == null) false else webView.requestWebOverlay(url) @JavascriptInterface - fun loadVideo(url: String?) { + fun loadVideo(url: String?, isGif: Boolean) { if (url != null) - webView.post { activity?.showVideo(url) } + webView.post { (context as? VideoViewerContract)?.showVideo(url, isGif) + ?: L.d("Could not load video; contract not implemented") } } @JavascriptInterface -- cgit v1.2.3