Migrate callers of ExoPlayer.Builder#build() to buildExoPlayer()

An upcoming change will update build() to return Player.

PiperOrigin-RevId: 399981901
This commit is contained in:
ibaker 2021-09-30 19:30:45 +01:00 committed by bachinger
parent d5ef11aaf3
commit ce0cf23a7f
2 changed files with 2 additions and 2 deletions

View File

@ -90,7 +90,7 @@ import java.util.ArrayList;
currentItemIndex = C.INDEX_UNSET;
trackSelector = new DefaultTrackSelector(context);
exoPlayer = new ExoPlayer.Builder(context).setTrackSelector(trackSelector).build();
exoPlayer = new ExoPlayer.Builder(context).setTrackSelector(trackSelector).buildExoPlayer();
exoPlayer.addListener(this);
localPlayerView.setPlayer(exoPlayer);

View File

@ -278,7 +278,7 @@ public class PlayerActivity extends AppCompatActivity
new ExoPlayer.Builder(/* context= */ this, renderersFactory)
.setMediaSourceFactory(mediaSourceFactory)
.setTrackSelector(trackSelector)
.build();
.buildExoPlayer();
player.addListener(new PlayerEventListener());
player.addAnalyticsListener(new EventLogger(trackSelector));
player.setAudioAttributes(AudioAttributes.DEFAULT, /* handleAudioFocus= */ true);