codelab-exoplayer-intro icon indicating copy to clipboard operation
codelab-exoplayer-intro copied to clipboard

Specify AudioAttributes for all playback scenarios

Open dturner opened this issue 6 years ago • 1 comments

From Andrew:

With audio focus handling, it's now possible for the player to have playWhenReady true and player state READY, but not actually to be playing: https://github.com/google/ExoPlayer/blob/r2.10.5/library/core/src/main/java/com/google/android/exoplayer2/Player.java#L623

I think it's okay to leave this as it is because audio focus handling isn't enabled in this tutorial, but on the other hand the new method is quite easy to use so I wonder if we should be directing people to that. (Side note: I think it's also good practice to specify AudioAttributes for all playbacks, but the tutorial doesn't do that at the moment; if it did, then we'd also need to pass a boolean setting whether to enable/disable audio focus handling as ExoPlayer has a combined setter for both.)

dturner avatar Oct 18 '19 10:10 dturner

Need to use ExoPlayer's AudioAttributes class rather than the media API.

dturner avatar Jul 14 '20 14:07 dturner