benashby
1/12/2018 - 11:59 PM

ExoPlayerAdaperExample.java

public class MainActivity extends AppCompatActivity {

    private SimpleExoPlayerView playerView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        
        // ...
        // ... Source agnostic ExoPlayer setup
        // ...
        
        HlsMediaSource mediaSource = new HlsMediaSource
            .Factory(dataSourceFactory)
            .setPlaylistParser(new ExoPlayerAdapter())
            .createMediaSource(Uri.parse("https://video-dev.github.io/streams/x36xhzz/x36xhzz.m3u8"), mainHandler, null);
        
        player.prepare(mediaSource);

        player.setPlayWhenReady(true);

    }



}