From bd1876136a80b4e10dc50fc8fbd1b55ab4dacb94 Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Sun, 23 Feb 2020 17:57:33 -0800 Subject: Add default video poster --- app/src/main/kotlin/com/pitchedapps/frost/web/FrostChromeClients.kt | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'app') diff --git a/app/src/main/kotlin/com/pitchedapps/frost/web/FrostChromeClients.kt b/app/src/main/kotlin/com/pitchedapps/frost/web/FrostChromeClients.kt index 03bfacd5..bdaf22ba 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/web/FrostChromeClients.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/web/FrostChromeClients.kt @@ -16,6 +16,7 @@ */ package com.pitchedapps.frost.web +import android.graphics.Bitmap import android.net.Uri import android.webkit.ConsoleMessage import android.webkit.GeolocationPermissions @@ -52,6 +53,10 @@ class FrostChromeClient(web: FrostWebView) : WebChromeClient() { private val activity = (web.context as? ActivityContract) private val context = web.context!! + override fun getDefaultVideoPoster(): Bitmap? = + super.getDefaultVideoPoster() + ?: Bitmap.createBitmap(50, 50, Bitmap.Config.ARGB_8888) + override fun onConsoleMessage(consoleMessage: ConsoleMessage): Boolean { L.v { "Chrome Console ${consoleMessage.lineNumber()}: ${consoleMessage.message()}" } return true -- cgit v1.2.3