Search code examples
androidexoplayerexoplayer2.x

How to set volume in ExoPlayer? SimpleExoPlayer had setVolume() api but SimpleExoPlayer is deprecated now


I'm using two ExoPlayer instances. I need to set custom volume to one of the ExoPlayer instances.

Previously, I was using SimpleExoPlayers. Now I want to use ExoPlayer because SimpleExoPlayer is deprecated now. But ExoPlayer does not provide the setVolume() api nor any other similar api.

How can I set custom volume now with ExoPlayer?


Solution

  • But ExoPlayer does not provide the setVolume() api

    Yes, it does. ExoPlayer implements Player, and Player has setVolume().