Hasmukh
Hasmukh

Reputation: 4670

How to Hide Video view's Seekbar or Progressbar in android

i am doing live streaming and play video in video view. i want to hide default progress bar of video view . so i kindly request for my problem if anybody have good solution for my problem please send me. Thanx in advance.......

Upvotes: 5

Views: 7186

Answers (5)

Dyno Cris
Dyno Cris

Reputation: 2414

Just remove MediaController, no need to add these lines below

MediaController mediaController=new MediaController(this);
mediaController.setAnchorView(videoView);
videoView.setMediaController(mediaController);

Just comment it

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

Upvotes: 0

WannaBeGeek
WannaBeGeek

Reputation: 989

I was able to get the SeekBar hidden with the help of following :

 public void hidingSeekBar() {

        final int topContainerId1 = getResources().getIdentifier("mediacontroller_progress", "id", "android");
        final SeekBar seekbar = (SeekBar) mediaController.findViewById(topContainerId1);
        seekbar.setVisibility(View.INVISIBLE);

        final int topContainerId2 = getResources().getIdentifier("time", "id", "android");
        final TextView mEndTime = (TextView) mediaController.findViewById(topContainerId2);
        mEndTime.setVisibility(View.INVISIBLE);


        final int topContainerId3 = getResources().getIdentifier("time_current", "id", "android");
        final TextView mCurrentTime = (TextView) mediaController.findViewById(topContainerId3);
        mCurrentTime.setVisibility(View.INVISIBLE);
        // mEndTime, mCurrentTime;
    }

P.S: I got the reference to the MediaController controls here.

Upvotes: 2

Drin
Drin

Reputation: 67

You have to set the media controller as null like this:

videoView.setMediaController(null);

Upvotes: 6

Phillip
Phillip

Reputation: 279

videoView.setMediaController(null);

Upvotes: 2

Himanshu Virmani
Himanshu Virmani

Reputation: 2460

Below is the code which adds the seek bar when using videoview So if you have used the code below please comment it and then check whether you still have a seekbar while viewing the video

 MediaController mediaController=new MediaController(this);
 mediaController.setAnchorView(videoView);
 videoView.setMediaController(mediaController)

Cheers!!!

Upvotes: 6

Related Questions