title: VideoView don’t play m3u8-files
body: <p>I cannot get the player to play all of the m3u8 playlists. Without any problems, direct links to mp4 files are played. There are only 1-2 m3u8 files I managed to find which could be played (one of them is: <a href="http://qthttp.apple.com.edgesuite.net/1010qwoeiuryfg/sl.m3u8" rel="nofollow noreferrer">http://qthttp.apple.com.edgesuite.net/1010qwoeiuryfg/sl.m3u8</a>). But all the other m3u8 playlists  do not work. For example: this playlist <a href="http://62.6.220.50:8000/playlist.m3u8" rel="nofollow noreferrer">http://62.6.220.50:8000/playlist.m3u8</a> plays without problems in the browser, but in Android Studio it produces an error: </p>
  
  <pre><code>«Can’t play this video»
  </code></pre>
  
  <p>and in the logs the following errors:</p>
  
  <pre><code>«E/MediaPlayer: error (1, -1007)   D/VideoView: Error: 1,-1007». 
  </code></pre>
  
  <p>What am I doing wrong? How can I make it so that player can play m3u8 files without problems. Maybe I must pre-parse this playlist and only then play it. Tell me, please, how can I solve this problem. Here is my code:</p>
  
  <p>MANIFEST:</p>
  
  <pre><code>&lt;uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/&gt;
  &lt;uses-permission android:name="android.permission.INTERNET"/&gt;
  
  &lt;application
      android:allowBackup="true"
      android:icon="@mipmap/ic_launcher"
      android:label="@string/app_name"
      android:roundIcon="@mipmap/ic_launcher_round"
      android:supportsRtl="true"
      android:theme="@style/AppTheme"&gt;
      &lt;activity android:name=".MainActivity"&gt;
          &lt;intent-filter&gt;
              &lt;action android:name="android.intent.action.MAIN" /&gt;
  
              &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
          &lt;/intent-filter&gt;
      &lt;/activity&gt;
  &lt;/application&gt;
  </code></pre>
  
  <p>ACTIVITY_MAIN:</p>
  
  <pre><code>&lt;VideoView
      android:id="@+id/myVideoView"
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      android:visibility="visible"
      tools:layout_editor_absoluteY="0dp"
      tools:layout_editor_absoluteX="-315dp" /&gt;
  </code></pre>
  
  <p>MAINACTIVITY:</p>
  
  <pre><code>import android.support.v7.app.AppCompatActivity;
  import android.os.Bundle;
  import java.net.URL;
  import android.net.Uri;
  import android.os.Bundle;
  import android.widget.MediaController;
  import android.widget.VideoView;
  
  public class MainActivity extends AppCompatActivity {
      private String urlStream;
      private VideoView myVideoView;
      private URL url;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
  
          myVideoView = (VideoView)this.findViewById(R.id.myVideoView);
          MediaController mc = new MediaController(this);
          myVideoView.setMediaController(mc);
          urlStream = "http://62.6.220.50:8000/playlist.m3u8";
          //urlStream = "http://qthttp.apple.com.edgesuite.net/1010qwoeiuryfg/sl.m3u8";
          //urlStream = "https://archive.org/download/ksnn_compilation_master_the_internet/ksnn_compilation_master_the_internet_512kb.mp4";
  
          runOnUiThread(new Runnable() {
              @Override
              public void run() {
                  myVideoView.setVideoURI(Uri.parse(urlStream));
              }
          });
      }
  }
  </code></pre>