简体   繁体   中英

Android detect URL video in Webview

In my Android app, I have a custom Webview. How do I detect the video URL in the webview?

webView.setWebViewClient(new MyWebViewClient(addressBar));

buttonGo.setOnClickListener(new Button.OnClickListener() {
    @Override
    public void onClick(View view) {
        goUrl();
    }
});
webView.setWebViewClient(new MyWebViewClient()); 

String currentUrl; 

private class MyWebViewClient extends WebViewClient {
        @Override 
        public boolean shouldOverrideUrlLoading(WebView view, String url) {         
            currentUrl=url;
            return true; 
        } 
    }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM