android webvie specifies the video player to play video from the site

  • 2020-05-19 05:50:22
  • OfStack

Filter out the other players and use my own player


        wv.setWebViewClient(new WebViewClient() {
            public boolean shouldOverrideUrlLoading(final WebView view,
                    final String url) {

                if (url.contains("3gp") || url.contains("mp4")) {//http://113.31.34.14:80/work/500/152/283/484/500.20120913082849.3gp
                    loadurl(view, url, true);// Load the video 
                } else {
                    loadurl(view, url, false);//  Load the page 
                }
//                http://113.31.34.15:80/work/500/094/076/171/500.20120716165645.3gp
                return true;
            }//  Override click action , with webview load 
        });


Related articles: