I have a VideoView playing a video whose shape is not rectangular, (i.e. a rotating cylinder with rounded corners). The videoview is displayed within a LinearLayout that has a background colour. I would like the background of the videoview to be transparent in order to give the effect that the cylinder is rotating on top of the background colour without any black corners. This is what I get:
and this is what I want to get:
Of course, you could ask, why don't I just set the background colour of the video to match the background colour of the container, but the reason I want to achieve this is because my next step is to have an image or a pattern as the background of the container. My layout xml is the following:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#00aaff"
android:orientation="vertical" >
<VideoView
android:id="@+id/surface_view"
android:layout_width="254dp"
android:layout_height="200px" />
</LinearLayout>
While experimenting, I tried to set a background to the videoview, but that had as a result to obscure the videoview entirely.
Thank you.