use of com.google.android.exoplayer2.trackselection.TrackSelector in project zype-android by zype.
the class PlayerFragment method initPlayer.
// Player
private void initPlayer() {
Logger.d("initPlayer()");
if (currentPlayer == null) {
trackSelector = new DefaultTrackSelector();
PlayerEventListener playerEventListener = new PlayerEventListener();
PlayerEventListener castPlayerEventListener = new PlayerEventListener();
player = ExoPlayerFactory.newSimpleInstance(getActivity(), trackSelector);
player.addListener(playerEventListener);
playerView.setPlayer(player);
playerView.setControlDispatcher(new PlayerControlDispatcher());
castPlayer = new CastPlayer(castContext);
castPlayer.addListener(playerEventListener);
castPlayer.setSessionAvailabilityListener(new CastSessionAvailabilityListener());
castControlView.setPlayer(castPlayer);
}
if (isPlayerControlsEnabled()) {
play();
} else {
pause();
}
}
Aggregations