views:

436

answers:

3

It is possible to put any view over a VideoView? (I.e. put the control buttons over the video, like in vimeo). I'm trying to do it using FrameLayout, but I have not found the way, and I'm still not sure if what I'm trying to do something that's is simply not possible.

+1  A: 

It should work just fine, though I would use a RelativeLayout. You can see a similar set of layouts here, albeit for a SurfaceView using MediaPlayer for video playback instead of VideoView. There should be no difference, though.

CommonsWare
A: 

I do this sort of thing with FrameLayout. What you need to do is make sure that the controls are below the VideoView in the Layout Editor.

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

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

    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:id="@+id/ControlLayout"
        android:layout_gravity="bottom|center_horizontal">

        <Button
            android:text="@+id/Button01"
            android:id="@+id/Button01"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content" />
        <Button
            android:text="@+id/Button02"
            android:id="@+id/Button02"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content" />
        <Button
            android:text="@+id/Button03"
            android:id="@+id/Button03"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content" />
        <Button
            android:text="@+id/Button04"
            android:id="@+id/Button04"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content" />
    </LinearLayout>
</FrameLayout>
CaseyB
A: 

Thanks, CommonsWare link was very useful.

ygneo