title: How to record HLS in streaming?
body: <p>I have created android application in which I have <code>m3u8</code> streaming links. Now I want the user to record the video at any stage during
  video play and can stop also where I want. yet  I googled it and no solution is available on stack overflow, and other android helping
   sites. I am New in this section Please help me as soon as
   possible. Now I am Stuck in this section. One Link I get but not helpful</p>
  
  <p><a href="https://stackoverflow.com/questions/12110522/how-to-record-the-http-live-streaming-from-an-ip-cam">How to record the http live streaming from an IP Cam</a></p>
  
  <p>I made it a custom mediaplayer which is following and I just give <code>m3u8</code> link to that media player and it play using default media player of android</p>
  
  <pre><code>  &lt;FrameLayout
              android:id="@+id/videoSurfaceContainer"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:layout_below="@+id/videoplayer_title"&gt;
  
              &lt;SurfaceView
                  android:id="@+id/videoSurface"
                  android:background="@android:color/transparent"
                  android:layout_width="match_parent"
                  android:layout_below="@+id/videoplayer_title"
                  android:layout_height="200dp"
                  /&gt;
  
              &lt;ImageView
                  android:id="@+id/videoplayer_icon"
                  android:layout_width="match_parent"
                  android:layout_height="200dp"
                  android:background="@android:color/transparent"
                  android:visibility="gone"
                  /&gt;
  
              &lt;ProgressBar
                  android:id="@+id/progressbar"
                  android:layout_width="100dp"
                  android:layout_height="100dp"
                  android:layout_gravity="center"
                  android:layout_below="@+id/videoplayer_title"
                  android:background="@android:color/transparent"
                  android:visibility="gone"
                  /&gt;
              &lt;LinearLayout
  
                  android:id="@+id/ll_controls_layout"
                  android:layout_width="match_parent"
                  android:layout_height="40dp"
                  android:background="@drawable/media_controls_bg"
                  android:orientation="vertical"
                  android:layout_gravity="bottom"
                  android:visibility="visible"&gt;
  
                  &lt;RelativeLayout
  
                      android:layout_width="match_parent"
                      android:layout_height="40dp"
  
  
                      &gt;
  
                      &lt;ImageButton
                          android:id="@+id/pause"
                          android:layout_width="35dp"
                          android:layout_height="35dp"
                          android:layout_centerVertical="true"
                          android:layout_marginLeft="5dp"
                          android:background="@android:color/transparent"
                          android:src="@drawable/pause_btn" /&gt;
  
  
                      &lt;SeekBar
                          android:id="@+id/mediacontroller_progress"
                          android:layout_width="match_parent"
                          android:minHeight="6dip"
                          android:layout_toRightOf="@+id/pause"
                          android:maxHeight="6dip"
                          android:thumb="@drawable/abc_switch_thumb_material"
                          android:layout_height="wrap_content"
                          android:layout_centerVertical="true"
                          android:progressDrawable="@drawable/styled_progress"
                          android:paddingLeft="15dp"
                          android:paddingRight="15dp"
                          android:layout_toLeftOf="@+id/time_current"
                          android:layout_marginLeft="3dp"
                          android:indeterminate="false"
                          android:visibility="visible"/&gt;
  
                      &lt;TextView
                          android:id="@+id/time_current"
                          android:layout_width="40dp"
                          android:layout_height="wrap_content"
                          android:layout_centerHorizontal="true"
                          android:textColor="@android:color/white"
                          android:layout_centerVertical="true"
                          android:layout_toLeftOf="@+id/time"
                          android:paddingRight="3dp"
                          android:gravity="right"
                          android:textSize="10dp"
                          android:visibility="gone" /&gt;
  
                      &lt;TextView
                          android:id="@+id/time"
                          android:layout_width="40dp"
                          android:layout_height="wrap_content"
                          android:textColor="@android:color/white"
                          android:gravity="left"
                          android:layout_toLeftOf="@+id/recording_btn"
                          android:layout_centerVertical="true"
                          android:textSize="10dp"
                          android:visibility="gone" /&gt;
  
                      &lt;ImageButton
                          android:id="@+id/recording_btn"
                          android:layout_width="35dp"
                          android:layout_height="35dp"
                          android:layout_centerVertical="true"
                          android:background="@android:color/transparent"
                          android:layout_toLeftOf="@+id/fullscreen"
                          android:src="@drawable/startrecording_btn" /&gt;
  
                      &lt;ImageButton
                          android:id="@+id/fullscreen"
                          android:layout_width="35dp"
                          android:layout_height="35dp"
                          android:layout_centerVertical="true"
                          android:layout_marginLeft="4dp"
                          android:layout_marginRight="5dp"
                          android:layout_alignParentRight="true"
                          android:background="@android:color/transparent"
                          android:src="@drawable/ic_media_fullscreen_stretch" /&gt;
  
                  &lt;/RelativeLayout&gt;
              &lt;/LinearLayout&gt;
          &lt;/FrameLayout&gt;
  </code></pre>