Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6673483
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T03:37:57+00:00 2026-05-26T03:37:57+00:00

I intend to write a custom media controller for my app. I was planning

  • 0

I intend to write a custom media controller for my app. I was planning to use seekbar to do both seeking and showing progress. Trying to implement this.

Does anyone have such implementation or am I on the wrong path ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T03:37:57+00:00Added an answer on May 26, 2026 at 3:37 am

    Finally I figured it out!!

    The solution that I came up with was something like this :

    First of all set the max progress for seekbar as the duration of the video

    videoView.setOnPreparedListener(new OnPreparedListener() {
    
            @Override
            public void onPrepared(MediaPlayer mp) {
    
                seekBar.setMax(videoView.getDuration());
                seekBar.postDelayed(onEverySecond, 1000);
            }
        });
    

    This runnable will keep on updating the progressbar :

    private Runnable onEverySecond=new Runnable() {
    
        @Override
        public void run() {
    
            if(seekBar != null) {
                seekBar.setProgress(videoView.getCurrentPosition());
            }
    
            if(videoView.isPlaying()) {
                seekBar.postDelayed(onEverySecond, 1000);
            }
    
        }
    };
    

    And then the setOnSeekBarChangeListener for the seekbar can be used to take the user seeks on the media. By using the fromUser boolean we can make out whether it was a call back due to user’s interaction or the

    seekBar.setOnSeekBarChangeListener(new OnSeekBarChangeListener() {
    
            @Override
            public void onStopTrackingTouch(SeekBar seekBar) {
            }
    
            @Override
            public void onStartTrackingTouch(SeekBar seekBar) {
            }
    
            @Override
            public void onProgressChanged(SeekBar seekBar, int progress,
                    boolean fromUser) {
    
                if(fromUser) {
                    // this is when actually seekbar has been seeked to a new position
                    videoView.seekTo(progress);
                }
            }
        });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm doing a platform independent PyQt application. I intend to use write a setup.py
I'm trying to write some arbitrary text to a custom control. My code works,
I intend to use RADIX / MTRIE as my preferred data-structure for a routing
I intend to write my own JIT-interpreter as part of a course on VMs.
I am trying to write several strings that contain the values of several dictionaries
I'm trying to implement a seek bar preference into my live wallpaper settings. The
I intend to write a function in TI-BASIC on my CAS calculator that takes
I intend to write a small application to scratch a personal itch and probably
I'm new to Drupal (v6) and PHP, and I'm trying to implement some content
I'm trying to write an intent-filter to select a contact from the list of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.