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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T15:14:10+00:00 2026-05-13T15:14:10+00:00

I have tried several different examples but I cannot get any video to show.

  • 0

I have tried several different examples but I cannot get any video to show. I hear sound but no video. I thought maybe I just had a incorrect video format so I downloaded a fiat commercial in 3gp format and still no joy. I am using the Eclipse Java EE with android sdk and my app targets the 1.5 sdk (Api Level 3) without google api. Could someone please post a link to a video known to play in android or point out my problem with the code. I have tried all I could think of .. with/without prepare .. different layouts etc.

Here is my onCreate in activity

/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) 
{
    super.onCreate(savedInstanceState);

this.setContentView(R.layout.video_test);
    SurfaceView v = (SurfaceView) findViewById(R.id.surface_video); 
    SurfaceHolder holder = v.getHolder(); 
 // Set the transparency 
    //getWindow().setFormat(PixelFormat.UNKNOWN); 


    // Set a size for the video screen 
    //holder.addCallback(this); 
    holder.setFixedSize(400,300); 


    MediaPlayer mp = MediaPlayer.create(this, R.raw.fiat); 
    mp.setDisplay(holder);
    //mp.setAudioStreamType(2); 
    try {
        //mp.prepare();
        mp.start();
    } catch (IllegalStateException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }

her is the layout in video_test.xml

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:orientation="vertical" 
android:layout_width="fill_parent" 
android:layout_height="fill_parent" 
> 
<SurfaceView android:id="@+id/surface_video" 
android:layout_width="250px" 
android:layout_height="250px"> 
</SurfaceView> 
<LinearLayout 
android:orientation="horizontal" 
android:layout_height="wrap_content" 
android:layout_width="fill_parent" 
android:padding="10dip" 
> 
</LinearLayout> 
</LinearLayout> 

> Blockquote

  • 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-13T15:14:11+00:00Added an answer on May 13, 2026 at 3:14 pm

    If you are using the emulator, it may not work. The emulator lacks the hardware acceleration available in Android devices. For example, on a 2.6GHz Core 2 Duo, I sometimes can get a video to play back, but not always. On slower machines, video playback never works. On a 2.5GHz Core 2 Quad, I always get video playback. That being said, I usually test video playback on actual devices.

    I am also uncertain if video playback works from raw resources. I strongly encourage you to try using a video from a file on the SD card first.

    With respect to videos that definitely work, I know that “Documentaries and You” and “Music for our Grandchildren” from here work in their MP4 forms.

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

Sidebar

Related Questions

I have tried different examples to filter a gridview by dropdownlist, but is it
I've looked at a bunch of different examples, and tried several variations, but can't
I have tried several different ways to get a simple DataTemplate example to work.
I have tried copying several different examples, used shape layouts, tried images, etc. No
I have tried this... Dim myMatches As String() = System.Text.RegularExpressions.Regex.Split(postRow.Item(Post), \b\#\b) But it is
I have tried to integrate the Picasa API on iPhone, compiles fine, but I
I have tried to find how to create DLL-s on linux using google, but
I have tried various methods to try and get this working correctly (I am
I have tried <ul id=contact_list> <li id=phone>Local 604-555-5555</li> <li id=i18l_phone>Toll-Free 1-800-555-5555</li> </ul> with #contact_list
I have tried what seems like everything - I've done similiar things many times

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.