• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps WebView Client not able to load video

Pratush

Lurker
Hi,
when I browse with the normal Browser to
m.youtube.com and click a video it starts fine.

I have made a simple WebviewClient
webview.setWebViewClient(new HelloWebViewClient()
and a webview.setWebChromeClient(new WebChromeClient()

that works perfect with normal html pages.
but when I click on a video link, like on Youtube.
NOTHING happens. Even I dont see any error in the adb log.

What Do I have to activate or implement in my WebViewclient
or WebChomeClient???

Thanks in advance.
-pratush
 
You will most likely have to override WebViewClient's onLoadResource() method, and handle the video playback yourself. For example:

Code:
@Override
public void onLoadResource(WebView view, String url) {
	Log.i("onLoadResource()", "url = " + url);
	if (url.endsWith(".3gp")) {
		Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
		view.getContext().startActivity(intent);
	}
}
 
Back
Top Bottom