Skip to content

Commit

Permalink
Detect initial audio session ID from ExoPlayer.
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanheise committed Feb 21, 2021
1 parent dcced3f commit fe9702c
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ public void onAudioSessionIdChanged(int audioSessionId) {
} else {
this.audioSessionId = audioSessionId;
}
broadcastPlaybackEvent();
}

@Override
Expand Down Expand Up @@ -530,6 +531,7 @@ private void load(final MediaSource mediaSource, final long initialPosition, fin
private void ensurePlayerInitialized() {
if (player == null) {
player = new SimpleExoPlayer.Builder(context).build();
onAudioSessionIdChanged(player.getAudioSessionId());
player.addMetadataOutput(this);
player.addListener(this);
player.addAudioListener(this);
Expand Down

0 comments on commit fe9702c

Please sign in to comment.