0

I am using to play the youtube videos in androidwebview .Loading and playing all related youtube videos well in android version of 4.3 and below .but problem in starting video not playing in android version of 4.4 and above.i didn't findout the mistake where i done .because its working androidversion 4.3 and below.some problem in androidversion 4.4 and above.please guide anyone known.

I am using code to load the webview video url:

Webview  wvYoutube=(WebView)view.findViewById(R.id.wv_youtube);      
         wvYoutube.clearCache(true);
         wvYoutube.clearHistory();
         wvYoutube.clearView();
         wvYoutube.getSettings().setJavaScriptEnabled(true);
         wvYoutube.getSettings().setRenderPriority(RenderPriority.HIGH);
         wvYoutube.getSettings().setPluginState(PluginState.ON);
         wvYoutube.getSettings().setLoadWithOverviewMode(true);
         wvYoutube.getSettings().setUseWideViewPort(true);
         wvYoutube.setWebChromeClient(new MyWebChromeClient());
         wvYoutube.setWebViewClient(new myWebViewClient());


         try {
             wvYoutube.loadUrl("http://www.youtube.com//watch?v=LXrxCT0NpHo");

        } catch (IllegalArgumentException e) {
        //TODO Auto-generated catch block
        e.printStackTrace();
        }

and the related image

enter image description here

image showing video not playing .Advance thanks to all

Ashok
  • 637
  • 2
  • 11
  • 24
  • I would suggest not to load your youtube video in WebView. We have more efficient implementation , we call it Youtube Android Player API Integration https://developers.google.com/youtube/android/player/ . So now play youtube video within your app only. – Hardik Trivedi Sep 03 '14 at 05:55
  • possible duplicate of [Play Youtube HTML5 embedded Video in Android WebView](http://stackoverflow.com/questions/6323169/play-youtube-html5-embedded-video-in-android-webview) – Maveňツ Sep 03 '14 at 05:56

0 Answers0