On android, using html5 video tag to load a video, before video loads, the placeholder image is a grayish image with a big "play" icon on it, suppose I don't have a poster image for the video so I couldn't replace it, is there any way I could disable the ugly one?
I know this question is old, but I was looking for the answer to this. It turns out that WebChromeClient
has a getDefaultVideoPoster
method. So you can do something like:
webView.setWebChromeClient(new WebChromeClient() {
@Override public Bitmap getDefaultVideoPoster() {
final Bitmap bitmap = Bitmap.createBitmap(1, 1, Bitmap.Config.RGB_565);
Canvas canvas = new Canvas(bitmap);
// Use whatever color you want here. You could probably use a transparent color
canvas.drawARGB(255, 0, 0, 0);
return bitmap;
}
});
I wouldn't necessarily make new bitmaps for every possible time this method could be called, but I'm sure you get the idea.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With