YouTube Video not playing in WebView – Android

Add these lines before loading HTML content to your WebView.

wv.setWebChromeClient(new WebChromeClient() {
});

From the documentation:

In order to support inline HTML5 video in your application, you need to have hardware acceleration turned on, and set a WebChromeClient. For full screen support, implementations of onShowCustomView(View, WebChromeClient.CustomViewCallback) and onHideCustomView() are required, getVideoLoadingProgressView() is optional.

Leave a Comment