0

when i want to load webpage, everything works well except iframe, he wont load youtube video... html code is

<div class="td-module-meta-info">
  <h4>
    <strong></strong>
  </h4>
  <p>
    <iframe class=" lazyloaded" 
      data-src="https://www.youtube.com/embed/MTiojrD_tls" 
      width="100%" height="392" frameborder="0" 
      allowfullscreen="allowfullscreen" data-mce-fragment="1">
    </iframe>
  </p>
</div>

so basic code just wont load video...

WebView myWebView = (WebView) findViewById(R.id.webview);
            WebSettings ws=myWebView.getSettings();
            ws.setJavaScriptEnabled(true);
            ws.setDefaultTextEncodingName("utf-8");
myWebView.load("<div class="td-module-meta-info"><h4><strong</strong></h4><p><iframe class=" lazyloaded" data-src="https://www.youtube.com/embed/MTiojrD_tls" width="100%" height="392" frameborder="0" allowfullscreen="allowfullscreen" data-mce-fragment="1"></iframe></p></div>")

Why its happend? Should i add something in WebSettings?

Christopher Schneider
  • 3,745
  • 2
  • 24
  • 38

0 Answers0