This is my xml .
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:id="@+id/firstLayout"
android:layout_weight="1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@+id/secondView"
android:orientation="vertical">
<FrameLayout
android:id="@+id/videoFrame"
android:layout_width="match_parent"
android:layout_height="match_parent">
<org.videolan.libvlc.util.VLCVideoLayout
android:id="@+id/videoLayout"
android:fitsSystemWindows="false"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</FrameLayout>
</LinearLayout>
<LinearLayout
android:id="@+id/thirdLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/secondView"
android:layout_weight="1"
android:background="@android:color/holo_orange_light"
android:orientation="vertical">
</LinearLayout>
This is my class :
public class WifiActivity extends AppCompatActivity {
private BroadcastReceiver MyReceiver = null;
private static final String url = " rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mp4";
private LibVLC libVlc;
private MediaPlayer mediaPlayer;
private VLCVideoLayout videoLayout;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_video);
if (getSupportActionBar() != null) {
getSupportActionBar().hide();
}
libVlc = new LibVLC(this);
mediaPlayer = new MediaPlayer(libVlc);
videoLayout = findViewById(R.id.videoLayout);
}
@Override
protected void onStart() {
super.onStart();
mediaPlayer.attachViews(videoLayout, null, false, false);
Media media = new Media(libVlc, Uri.parse(url));
media.setHWDecoderEnabled(true, false);
media.addOption(":network-caching=600");
mediaPlayer.setMedia(media);
media.release();
mediaPlayer.play();
}
}
after running this code I am able to show live streaming using the given URL look like this.
I am trying to remove the black bar which is showing in the given image I want to keep it full screen please help me how to achieve this I am unable to find any solution for this.