Video Player App Rotation error in android studio

package com.livevideoshare.videosharingapp;

import android.content.res.Configuration;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
import android.util.Log;
import android.view.View;
import android.view.WindowManager;
import android.widget.MediaController;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.VideoView;
import androidx.activity.EdgeToEdge;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;

import java.util.Random;

public class LiveVideoActivity extends AppCompatActivity {

    private VideoView videoView;
    private TextView floatingTextView;
    private Handler handler;
    private final int INTERVAL = 10000;
     int currentPosition ;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_live_video);

        //if (newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE) {
            getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
                    WindowManager.LayoutParams.FLAG_FULLSCREEN);
        //}

        // Get the VideoView reference from XML layout
        videoView = findViewById(R.id.videoView);
        floatingTextView = findViewById(R.id.floatingTextView);

        // Get the video URL from the server (you should replace this with your actual server call)
        String videoUrl = "http://kolkatacoders.com/videos/vid1.mp4";

        // Set the video URI using the URL obtained from the server
        Uri videoUri = Uri.parse(videoUrl);

        // Create a MediaController
        MediaController mediaController = new MediaController(this);
        mediaController.setAnchorView(videoView);

        // Set MediaController for VideoView
        videoView.setMediaController(mediaController);

        // Set video URI
        videoView.setVideoURI(videoUri);
        videoView.requestFocus();
        if (savedInstanceState != null) {
            currentPosition = savedInstanceState.getInt("currentPosition", 0);
        }
        videoView.seekTo(currentPosition);
        // Start playing the video
        videoView.start();

        ///-------------

        // Show text at regular intervals
        handler = new Handler();
        //showFloatingText();

        //handler = new Handler();
        handler.postDelayed(new Runnable() {
            @Override
            public void run() {
                floatingTextView.setVisibility(View.VISIBLE);
                setRandomPosition();

                handler.postDelayed(new Runnable() {
                    @Override
                    public void run() {
                       // floatingTextView.setVisibility(View.INVISIBLE);
                        showFloatingText();
                    }
                }, 2000); // Hide text after 2 seconds
            }
        }, 10000); // Show text after 30 seconds

    }

    @Override
    public void onSaveInstanceState(Bundle outState) {
        super.onSaveInstanceState(outState);
        Log.d("hi soumen","done");
        outState.putInt("currentPosition", videoView.getCurrentPosition());
        Log.d("hi soumen","videoView.getCurrentPosition()"+videoView.getCurrentPosition());
    }



    // Set the VideoView to full-screen mode
        //setVideoViewFullScreen();
        private void showFloatingText() {
            floatingTextView.setVisibility(View.VISIBLE);
            //setRandomPosition();

            // Hide text after 2 seconds
            handler.postDelayed(new Runnable() {
                @Override
                public void run() {
                    floatingTextView.setVisibility(View.INVISIBLE);
                    // Show text again after 10 seconds
                    handler.postDelayed(new Runnable() {
                        @Override
                        public void run() {
                            setRandomPosition();
                            showFloatingText();
                        }
                    }, INTERVAL);
                }
            }, 2000); // Hide text after 2 seconds
        }
        private void setRandomPosition() {
            // Get the dimensions of the FrameLayout
            int parentWidth = findViewById(R.id.container).getWidth();
            int parentHeight = findViewById(R.id.container).getHeight();

            // Generate random x and y coordinates
            Random random = new Random();
            int x = random.nextInt(parentWidth - floatingTextView.getWidth());
            int y = random.nextInt(parentHeight - floatingTextView.getHeight());

            // Set the TextView's position
            floatingTextView.setX(x);
            floatingTextView.setY(y);
        }

    @Override
    public void onConfigurationChanged(Configuration newConfig) {
        super.onConfigurationChanged(newConfig);
        if (newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE) {
            getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
                    WindowManager.LayoutParams.FLAG_FULLSCREEN);
        }
    }
}

this is my code. two thing i want to add here one is rotation option and second is after rotation start video from the same position from here it runs.
Basically i want to run a video using a url. but like youtube there is no rotation icon. It has only three icon in the VideoView app. One is pause/play one is forward and one is backword.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật