0

I'm trying to include a video or two after images in a HorizontalScrollView.

Here's the code I have that works for the images, but I don't know how to include the video as part of the scrolled images.

<?xml version="1.0" encoding="utf-8"?>

<HorizontalScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:orientation="horizontal"
    android:background="@drawable/a">

    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="fill_parent"
        android:orientation="horizontal"
        android:gravity="center">
            <ImageView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:src="@drawable/a" />
            <ImageView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:src="@drawable/b" />
            <ImageView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:src="@drawable/c" />
            <VideoView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:src="@raw/fw1"
                />

The images and videos will all be in a local directory.

Hermes
  • 11
  • 2

1 Answers1

1

For displaying videos you can use VideoView. This solution however is not well documented and it may be better to use MediaPlayer class. There is a nice tutorial explaining how to use it. You can find it here

fragon
  • 3,391
  • 10
  • 39
  • 76