title: How to use YouTubePlayer api in fragments?
body: <p>I am using youtube player api in my application,I have used the following code</p>
  
  <p>xml:</p>
  
  <pre><code>&lt;RelativeLayout 
      xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:id="@+id/rel1"
      android:background="#edeae5"&gt;
     &lt;com.google.android.youtube.player.YouTubePlayerView
          android:id="@+id/youtubeplayerview"
          android:layout_width="match_parent"
          android:layout_height="200dp"/&gt;
     &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>my Activity:</p>
  
  <pre><code>  public class EditBloop extends YouTubeBaseActivity implements
  YouTubePlayer.OnInitializedListener{
  
  
      public void onCreate(Bundle savedInstanceState) 
          {
              super.onCreate(savedInstanceState);
              setContentView(R.layout.edit_bloop);
        youTubePlayerView = (YouTubePlayerView)findViewById(R.id.youtubeplayerview);
                  youTubePlayerView.initialize(API_KEY, this);
  
      }
  </code></pre>
  
  <p>But here I am using YouTubeBaseActivity,but in my application I want youTubePlayer in a Fragment.
  How can I achieve this? I have seen some of the links using YouTubePlayerSupportfragment but I didnt understand them.</p>
  
  <p>Please suggest.</p>