1

I got the video to show in a Webview in landscape mode..

But somehow the video doesn't cover full screen. There is a white part at the bottom of the video which is a bit annoying..

I've tried using webview.getSettings().setUseWideViewPort(true); webview.getSettings().setLoadWithOverviewMode(true);

But they don't seem to fix it.

How do I make the video that played in a WebView cover the entire device screen?

emenpy
  • 51
  • 1
  • 12
  • Maybe this link help you : http://stackoverflow.com/questions/15796661/android-webview-app-wont-let-video-player-go-full-screen – SAYE Apr 15 '16 at 22:03
  • http://stackoverflow.com/questions/15768837/playing-html5-video-on-fullscreen-in-android-webview – SAYE Apr 15 '16 at 22:04
  • Hi @AbbasNikzad I already look into that.. but my video is not HTML5, it's a live stream in MJPEG format – emenpy Apr 15 '16 at 22:19

1 Answers1

0

if your video is live stream you don't need webview !

I prefer using Vitamio Library to stream and show inside your app!


If you want to perform HLT (HTTP Live Stream) on Android 2.1 and higher you may use the vitamio library.

Site at: (http://www.vitamio.org/).

Here is code example: The main layout:

<LinearLayout android:id="@+id/LinearLayout01"
            android:layout_height="fill_parent"         xmlns:android="http://schemas.android.com/apk/res/android"
            android:paddingLeft="2px" android:paddingRight="2px"
            android:paddingTop="2px" android:paddingBottom="2px"
            android:layout_width="fill_parent" android:orientation="vertical">

            <io.vov.vitamio.widget.VideoView
                 android:layout_height="fill_parent"
                 android:layout_width="fill_parent" android:id="@+id/VideoView">               
            </io.vov.vitamio.widget.VideoView>
</LinearLayout>

the Class:

import io.vov.vitamio.widget.MediaController;
import io.vov.vitamio.widget.VideoView;
import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;



public class LiveStrimingTestActivity extends Activity{

    VideoView videoView;

    private void test_2(){
        String httpLiveUrl = "http://aj.lsops.net/live/aljazeer_en_high.sdp/playlist.m3u8";   
        videoView = (VideoView) findViewById(R.id.VideoView);
        videoView.setVideoURI(Uri.parse(httpLiveUrl));
        MediaController mediaController = new MediaController(this);
        videoView.setMediaController(mediaController);
        videoView.requestFocus();
        videoView.start();
    }


    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        test_2();             
    }     
}
SAYE
  • 1,247
  • 2
  • 20
  • 47