@Override public Bitmap getDefaultVideoPoster() { if (originalWebChromeClient != null) { return originalWebChromeClient.getDefaultVideoPoster(); } return null; }
@Override public Bitmap getDefaultVideoPoster() { TraceEvent.begin(); Bitmap result = null; if (mWebChromeClient != null) { if (TRACE) Log.d(TAG, "getDefaultVideoPoster"); result = mWebChromeClient.getDefaultVideoPoster(); } if (result == null) { // The ic_media_video_poster icon is transparent so we need to draw it on a gray // background. Bitmap poster = BitmapFactory.decodeResource( mWebView.getContext().getResources(), R.drawable.ic_media_video_poster); result = Bitmap.createBitmap(poster.getWidth(), poster.getHeight(), poster.getConfig()); result.eraseColor(Color.GRAY); Canvas canvas = new Canvas(result); canvas.drawBitmap(poster, 0f, 0f, null); } TraceEvent.end(); return result; }