Skip to content

Commit

Permalink
make it able to hide the default video poster on Android
Browse files Browse the repository at this point in the history
  • Loading branch information
adamkobor committed Nov 15, 2024
1 parent 275cfb6 commit 1654859
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -487,4 +487,10 @@ open class AccompanistWebChromeClient : WebChromeClient() {
KLogger.d { "onPermissionRequest denied permissions: ${request.resources}" }
}
}

override fun getDefaultVideoPoster(): Bitmap? {
return if (state.webSettings.androidWebSettings.hideDefaultVideoPoster) {
Bitmap.createBitmap(50, 50, Bitmap.Config.ARGB_8888)
} else super.getDefaultVideoPoster()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,10 @@ sealed class PlatformWebSettings {
* devices. Available on API level 21 and above.
*/
var allowMidiSysexMessages: Boolean = false,
/**
* Controls whether the default video poster (a gray, pixelated play button) should be hidden.
*/
var hideDefaultVideoPoster: Boolean = false,
/**
* The Layer Type of the WebView.
* Default is [LayerType.HARDWARE]
Expand Down

0 comments on commit 1654859

Please sign in to comment.