I am working on simple application which is based on animation and video. I am using andEngine to build the game app. I am able to manage animations and music in my app but I don't know how I can play video using AndEngine in my app.
Is there any in-built class for video in AndEngine or I should use another library for that or I have to simply use native android VideoView?
I tried using Android's VideoView using SimpleLayoutGameActivity of AndEngine. But the problem is: I want to play the video in the background and my rendrer should be in foreground with all sprite with animation. Thus, my rendrer overlaps VideoView and doesn't change its background from black to transparent.
Here is my XML:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.techd.andenginedemo.GameActivity">
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="fitXY"
android:src="@mipmap/background" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<VideoView
android:id="@+id/videoBG"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:visibility="gone" />
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="visible">
<org.andengine.opengl.view.RenderSurfaceView
android:id="@+id/xmllayoutexample_rendersurfaceview"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
</RelativeLayout>
Here, I want to show the background image when the user launches the app. Then, when the user clicks on particular sprite background the image should be gone and the video view should start playing the video from the raw folder. But RenderSurfaceView takes background as black and my background image is not showing in my app. And thus, it will not show my videoview too.
How can I fix this?