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 8696155
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T01:12:49+00:00 2026-06-13T01:12:49+00:00

I tried playing a Video from a remote URL & it works fine ,

  • 0

I tried playing a Video from a remote URL & it works fine , the problem now is that the video starts playing automatically, I want the video to show up like a YouTube video with a play button in center & on clicking that the video should play .

public class Tabs extends Activity {
TabHost th;
VideoView video;
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    //Create tabs using XML 

    video=(VideoView) findViewById(R.id.VideoView);
    String path1="http://www.w3schools.com/html5/movie.mp4";
    MediaController mc = new MediaController(this);
    mc.setAnchorView(video);
    mc.setMediaPlayer(video);
    Uri uri=Uri.parse(path1);
    video.setMediaController(mc);
    video.setVideoURI(uri);
    video.start();
}
}

Here is my code which works perfectly fine , but the video automatically starts playing , i need it to just show the first scene like YouTube video with a play button in center & on clicking that the video should start playing. Also it should show a thumbnail of the video

  • 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-06-13T01:12:50+00:00Added an answer on June 13, 2026 at 1:12 am

    Setup the video player and URLs in the onCreate and do the actual playing by implementing onClickListener.

    In your example (remember to import missing packages and create a button with ID of buttonStart):

    public class Test extends Activity {
        TabHost th;
        VideoView video;
    
        @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.main);
            // Create tabs using XML
    
            video = (VideoView) findViewById(R.id.VideoView);
            String path1 = "http://www.w3schools.com/html5/movie.mp4";
            MediaController mc = new MediaController(this);
            mc.setAnchorView(video);
            mc.setMediaPlayer(video);
            Uri uri = Uri.parse(path1);
            video.setMediaController(mc);
            video.setVideoURI(uri);
            Button buttonStart = (Button) findViewById(R.id.buttonStart);
            buttonStart.setOnClickListener(new OnClickListener() {
    
                public void onClick(View v) {
                    video.start();
                }
    
            });
    
        }
    }
    

    As for displaying the thumbnail, if you have its URL, you can start an Async task that will retrieve the remote image and overlay it over the video player (use FrameLayout to achieve overlaying Views). Then setup an onClickListener on the overlaying image (see the code on how it’s done for a button, the same logic can be followed for an ImageView). Just make sure you set the ImageView to be clickable.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a webview that's playing a video, and I want it to appear
I'm playing a youtube video from a specific view (not the view that appears
Did anyone tried to customize the window in which the quicktime is playing video?
So from playing around with it so far, I gather that GLSL geometry shaders
I have an old video player software that works happily on XP but refuses
I'm playing video via MediPlayer in my android application and have SeekBar displayed. Now
I'm pausing a video using its pause() method.. the problem is that the audio
I have a project that involves playing back a video clip within my swf
I am implementing some video into my iPad app and its works fine. But
In my project, I used MPMoviePlayerController to stream video from an http url. It

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.