chrizonline
chrizonline

Reputation: 4979

Android: How to add play button on YouTubeThumbnailView

I have implemented youtubeThumnailView without any problem.

Currently my thumbnail view looks like this on an android phone: enter image description here

But how do i add a play button on the thumbnail view like this https://lh4.googleusercontent.com/-c06CilFxXA8/TW3qUN4WTBI/AAAAAAAAAIU/6UaNpVuAt5w/s1600/webView+with+play+button.png

Upvotes: 2

Views: 2118

Answers (1)

Sruit A.Suk
Sruit A.Suk

Reputation: 7273

You need to:

  1. put your youtubeThumnailView in Layout (ex. RelativeLayout)

  2. add Button or ImageView over your youtubeThumnailView

example:

    <RelativeLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" >

        <!-- ImageView or your youtubeThumnailView -->
        <ImageView
            android:id="@+id/iv_youtube_view"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:scaleType="fitCenter"
            android:src="@drawable/profile_img_default" />

        <!-- ImageView of your button -->
        <ImageView
            android:id="@+id/iv_button"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:src="@drawable/profile_img_capture" />

    </RelativeLayout>

Upvotes: 5

Related Questions