aboutsummaryrefslogtreecommitdiff
path: root/app/src/main
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2020-02-23 17:57:33 -0800
committerAllan Wang <me@allanwang.ca>2020-02-23 17:57:33 -0800
commitbd1876136a80b4e10dc50fc8fbd1b55ab4dacb94 (patch)
tree27e441a2767c7beb944f2db01c33a4bf50415c19 /app/src/main
parent654cc6b943177120dc1a0a22a0d68d5cbfde2b5e (diff)
downloadfrost-bd1876136a80b4e10dc50fc8fbd1b55ab4dacb94.tar.gz
frost-bd1876136a80b4e10dc50fc8fbd1b55ab4dacb94.tar.bz2
frost-bd1876136a80b4e10dc50fc8fbd1b55ab4dacb94.zip
Add default video poster
Diffstat (limited to 'app/src/main')
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/web/FrostChromeClients.kt5
1 files changed, 5 insertions, 0 deletions
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