4

I am developing an android application.

This is my xml feed tag:

<FullContent>
  <style> img {padding:2px;} p{color:#fff} </style>
   <p> Actor Hrithik Roshan has always nursed a</p> <br/><br/><br/><br/><br/>
   <p style=font-size:12px>@Notch 2013</p>
    <iframe src="http://www.youtube.com/embed/k8T3_JupGhI?fs=0" 
     width="500" height="298" frameborder="0"></iframe>
     </FullContent>

I am trying to play the video in android WebView with following code -

  content = (WebView) findViewById(R.id.fullcontent);
  content.setWebChromeClient(new WebChromeClient());
   content.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY);
   content.getSettings().setJavaScriptEnabled(true);
    content.getSettings().setDomStorageEnabled(true);
     content.getSettings().setPluginsEnabled(true);
       String fullcontent = in.getStringExtra("FullContent");
         full_content=fullcontent.substring(1);
          content.loadDataWithBaseURL(null,full_content, "text/html", "UTF-8",null);

But when I click on it the video is not playing.

What is wrong with my code ?

EDIT:

    I have added below code on my android app

    web.getSettings().setPluginState(PluginState.ON_DEMAND);
    web.getSettings().setPluginState(PluginState.ON);
    web.getSettings().setPluginsEnabled(true);

now also I am facing same problem.The video is opened. But when I click on it the video is not playing.

Girish
  • 4,692
  • 4
  • 35
  • 55
user2218667
  • 607
  • 6
  • 25
  • 46

1 Answers1

0

Don't try to include iframe but simply provide a thumbnail of the video which directly links to YouTube page or h264 file.

Earlier discussion, with a possible solution.

Community
  • 1
  • 1
Nirav Ranpara
  • 13,753
  • 3
  • 39
  • 54