0

Is there a default way for Android's VideoView to display a playback icon along with the first frame of its video?

Right now, I'm using a layout like this.

<FrameLayout
    android:id="@+id/video_frame"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="#000">
    <VideoView
        android:id="@+id/mediaPlaybackView"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_gravity="center"
        android:layout_centerInParent="true" />
    <ImageButton
        android:id="@+id/play_button"
        android:layout_width="120dp"
        android:layout_height="120dp"
        android:adjustViewBounds="true"
        android:padding="20dp"
        android:scaleType="fitCenter"
        android:background="@android:color/transparent"
        android:layout_gravity="center_vertical|center_horizontal"
        android:src="@drawable/videoicon" />

Where clicking the ImageButton gets the video to play.

James Nguyen
  • 91
  • 1
  • 3
  • 12
  • check this out http://stackoverflow.com/questions/7037630/how-to-create-a-video-preview-in-android http://stackoverflow.com/questions/8235251/issue-displaying-thumbnail-image-in-videoview – vinv Jul 25 '14 at 19:41

1 Answers1

-1

Looks like a no,

I ended up just writing xml for it. Fullscreen videoview with a fullscreen thumbnail.

Bitmap previewThumbnail = ThumbnailUtils.CreateVideoThumbnail (videoUri.Path, Android.Provider.ThumbnailKind.MiniKind);
                    previewDrawable = new BitmapDrawable (previewThumbnail);
holder.video.Background = previewDrawable;

<RelativeLayout
    android:id="@+id/video_frame"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="#000">
    <VideoView
        android:id="@+id/mediaPlaybackView"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_alignParentRight="true"
        android:layout_alignParentLeft="true"
        android:layout_alignParentTop="true"
        android:layout_alignParentBottom="true"
        android:layout_gravity="center"
        android:layout_centerInParent="true" />
    <ImageButton
        android:id="@+id/play_button"
        android:layout_width="120dp"
        android:layout_height="120dp"
        android:adjustViewBounds="true"
        android:padding="20dp"
        android:scaleType="fitCenter"
        android:layout_centerInParent="true" 
        android:background="@android:color/transparent"
        android:layout_gravity="center_vertical|center_horizontal"
        android:src="@drawable/videoicon" />
James Nguyen
  • 91
  • 1
  • 3
  • 12