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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T02:30:51+00:00 2026-05-31T02:30:51+00:00

I want to create a simple video player using mediaPlayer.. So I did the

  • 0

I want to create a simple video player using mediaPlayer.. So I did the code which I have given below. But I’m having a problem here because the video is not visible, but the audio is playing.
In my XML file I used a simple VideoView.

    package com.Android.Simple;

    import android.app.Activity;
    import android.media.MediaPlayer;
    import android.os.Bundle;
    import android.view.SurfaceHolder;
    import android.widget.VideoView;

    public class SimpleVideoPlayerActivity extends Activity {

        private VideoView _UIVideo;
        SurfaceHolder _videoHolder;

        public void onCreate(Bundle icicle) {
            super.onCreate(icicle);
            setContentView(R.layout.simple_video_view);

            _UIVideo = (VideoView) findViewById(R.id.VVSimpleVideo);
            MediaPlayer _mediaPlayer;
            String _path = "/sdcard/abc.3gp";
            _videoHolder = _UIVideo.getHolder();

             try {
                _mediaPlayer = new MediaPlayer();
                _mediaPlayer.setDataSource(_path);
                _mediaPlayer.setDisplay(_videoHolder);
                _mediaPlayer.prepare();
                _mediaPlayer.start();

            } catch (Exception e) {
             }
    }

and the manifest file:

    <?xml version="1.0" encoding="utf-8"?>
    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.Android.Simple"
    android:versionCode="1"
    android:versionName="1.0" >
    <uses-sdk android:minSdkVersion="8" />

    <application
            android:icon="@drawable/ic_launcher"
            android:label="@string/app_name" >
            <activity
                android:name=".SimpleVideoPlayerActivity"
                android:label="@string/app_name" >
                <intent-filter>
                    <action android:name="android.intent.action.MAIN" />

                    <category android:name="android.intent.category.LAUNCHER" />
                </intent-filter>
            </activity>
        </application>

    </manifest>





    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:orientation="vertical" >

        <VideoView
            android:id="@+id/VVSimpleVideo"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent" />

      </LinearLayout>
  • 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-31T02:30:52+00:00Added an answer on May 31, 2026 at 2:30 am
    Try this Code
    
            VideoView videoView = (VideoView)this.findViewById(R.id.videoView);
            MediaController mc = new MediaController(this);
            mc.setAnchorView(videoView);
            mc.setMediaPlayer(videoView);
            videoView.setMediaController(mc);
    
            videoView.setVideoPath(path);
    
    
            videoView.requestFocus();
            videoView.start();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In short, I want to create a simple video player which can play some
I want to create a simple bit of JS code that creates an image
I want to create a simple menu function which can call it example get_menu()
I want to create a simple video renderer to play around, and do stuff
Hi i want to create an uploading video program using youtube api I think
I am trying to create a video player in Adobe AIR. I want to
hi i have create one simple media player.... now its working fine. i retrieve
I am new to android... I want to create simple android game using Andengine.
I want to create a simple app which shows infos on the global quick
I want to create a simple audio player for Windows Phone 7. How can

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.