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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T14:45:23+00:00 2026-06-12T14:45:23+00:00

I am completely stumped on something that I thought would be the easiest thing

  • 0

I am completely stumped on something that I thought would be the easiest thing ever. I am trying to play a video inside a frame in a relative layout.

Note that the application is meant to run on a very specific device (Archos 101 internet tab) in landscape mode, and the videos are pre-encoded with a very specific size of 480×360, which is why the layout has some fixed sizes.

Here is the layout

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent" >

<!-- Background -->
<ImageView
    android:layout_width="980dp"
    android:layout_height="568dp"
    android:src="@drawable/bg_video" />

<TextView
    android:id="@+id/video_headtext"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_marginTop="73dp"
    android:layout_marginLeft="255dp"
    android:textColor="#FFFFFF"
    android:textSize="16dp" />

<TextView
    android:id="@+id/video_title"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:textColor="#FFFFFF"
    android:layout_centerHorizontal="true"
    android:layout_marginTop="112dp" />

<VideoView 
    android:id="@+id/video_videocontainer"
    android:layout_width="480dp"
    android:layout_height="360dp"
    android:layout_below="@id/video_title"
    android:layout_marginTop="10dp"
    android:layout_centerHorizontal="true" />

</RelativeLayout>

I load the video using this code

player = (VideoPlayer) findViewById(R.id.video_videocontainer);
player.setVideoURI(videoUri);

The code works, but while the videoView is correctly inside the frame, the video itself plays somewhere in the top of the screen, and only part of it is shown in the VideoView.

Example of what happens here (This is only a temp video for debugging).
Screenshot of the video at the same moment here.

As you can see, the VideoView only shows part of the video, filling the rest with black.

I’m pretty sure I’m missing something really simple, but I can’t figure out what at all.

Thanks in advance.

EDIT : I have tried writing a VideoPlayer class that extends VideoView and overrides onMeasure like this

@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec)
{
    setMeasuredDimension(480, 360);
} 

public void changeVideoSize()
{
    getHolder().setFixedSize(480, 360); 

    requestLayout();
    invalidate();
}

But it doesn’t help a single bit.

EDIT 2 : Tried with a SurfaceView and MediaPlayer, same result. I have the feeling I haven’t understood the principle of playing a video on Android. Getting quite stuck here.

EDIT 3 : I have tried on a Samsung Galaxy HD and the video shows correctly inside the frame. I wonder if this is a problem with the tablet, or with 2.2?

EDIT 4 : AVD running under 2.2 doesn’t render the video properly. AVD running 4.1 does. I guess that narrows it down a tad.

  • 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-12T14:45:24+00:00Added an answer on June 12, 2026 at 2:45 pm

    I had similar problem with a video that had a high too profile for that particular device (2.1) to be handled and it worked fine for android 4.0.

    Other than that, I am using SurfaceView and the trick was to add listeners to the events for the MediaPlayer (setOnVideoSizeChangedListener in particular) and the callback to the surface linked to the mediaplayer events.

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

Sidebar

Related Questions

The first thing i would like to say is that this is not exactly
This has me completely stumped so I figured I would ask around and see
I'm stumped: a landing page that I built works perfectly locally, but completely breaks
I am completely stumped at the nature of this problem. We export data from
I am completely stumped. Here is my php (CodeIgniter) code: function mod() { $uid
I am completely stumped with how to use .htaccess and I have an issue
I'm working on a school assignment and I've been completely stumped with this step.
After browsing for several hours, I'm completely stumped on how to prevent Windows 7
I've been staring at this one for a while and I'm completely stumped. You'll
I am new to WiX and I have become completely stumped as to how

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.