title: Video view over camera preview
body: <p>I am trying to play a video and want to show it on camera preview. The video is played with transparent background and video controls are also shown but no video is visible. I do get the sound of the video being played. </p>
  
  <p><strong>Here is my code:</strong></p>
  
  <pre><code>// CameraSampleActivity.java, OnCreate Method
  
   View layout_Initialization= (View)findViewById(R.id.layout_Initialization);
   layout_Initialization.setVisibility(View.VISIBLE);
  
  View custom_Video_Dialog=(View)findViewById(R.id.videoLayout);
  custom_Video_Dialog.setVisibility(View.GONE);
  
  //Code related to camera and camera preview here in the OnCreate method
  
  
  // CameraSampleActivity.java This code is executed when video needs to be played
  
  View custom_Video_Dialog=(View)findViewById(R.id.videoLayout);
  custom_Video_Dialog.setVisibility(View.VISIBLE);
  
  VideoView mVideoView = (VideoView) findViewById(R.id.myvideoview);
  mVideoView.setMediaController(new MediaController(CameraSampleActivity.this));
  mVideoView.setVideoURI(Uri.parse(firstVideo.getUrl()));
  
   mVideoView.setOnPreparedListener(new OnPreparedListener() {
  
                      public void onPrepared(MediaPlayer arg0) {
                          mVideoView.setFocusable(true);
                          mVideoView.requestFocus();
                          mVideoView.start();
                      }
                  });
  </code></pre>
  
  <p><strong>// Here is main.xml</strong></p>
  
  <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:id="@+id/main_layout" android:layout_width="fill_parent"
      android:layout_height="fill_parent" android:background="@drawable/transparent"
      android:orientation="vertical" xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"&gt;
      &lt;FrameLayout android:layout_width="fill_parent"
          android:layout_height="0px" android:layout_weight="1"&gt;
          &lt;FrameLayout android:id="@+id/cameraPreview"
              android:layout_width="fill_parent" android:layout_height="fill_parent" /&gt;
  
          &lt;RelativeLayout android:id="@+id/layout_Initialization"
              android:layout_width="fill_parent" android:layout_height="fill_parent"
              android:background="@drawable/transparent" android:orientation="horizontal"&gt;
  .................................
  .................................
  ....................... .........        
          &lt;/RelativeLayout&gt;
          &lt;RelativeLayout
                  android:id="@+id/videoLayout"
                  android:layout_width="fill_parent"
                  android:layout_height="280dp" &gt;
  
              &lt;VideoView android:id="@+id/myvideoview"
                  android:layout_width="fill_parent" android:layout_height="180dp"
                  android:layout_alignParentTop="true" /&gt;
              &lt;Button android:id="@+id/videoListButton" android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:layout_alignParentBottom="true"
                  android:layout_alignParentLeft="true" android:text="List" /&gt;
          &lt;/RelativeLayout&gt;
  
      &lt;/FrameLayout&gt;
  
  
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>I think the context being passed to mediaController is incorrect. Note that if i take the videoLayout outside the frameLayout the video is visible but not transparent. Placing it inside the Framelayout gives my transparency and video is shown with camera preview on the back visible which is what i want. Any help?</p>