nullByte nullByte - 1 year ago 85
Java Question

android live streaming app using embed code

Can anyone please guide me on how to resize video(fit to screen and full screen) in web view.
I am trying to stream from embed link of channels in android app
here is code snippet

String playVideo= "<html><body><iframe type=\"text/html\" width=\"350\" height=\"235\"src=\"\" frameborder=\"0\"></body></html>";

webView.loadData(playVideo, "text/html", "utf-8");

thanx in advance

Answer Source

If you mean resizing the WebView or iframe to full screen, you can use this :

in layout xml


in java source :

      WebView webView=(WebView)findViewById(;

     // **** use width="100%" and height="100%" to fill the webview by iFrame ******
     String playVideo= "<html><body><iframe type=\"text/html\" width=\"100%\" height=\"100%\"src=\"\" frameborder=\"0\"></body></html>";

     webView.loadData(playVideo, "text/html", "utf-8");

but if you mean resizing the src elements in . it is not possible. this has to done from server side .by adding a javaScript like this :

var elem = document.getElementById("myFrame");
   if (elem.requestFullscreen) {

finallay if you need to paly a streamed video , best way is using MediaPlayer. How to play live streaming in android application?

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download