Reputation: 372
I am using video view, MediaPlayer and seek bar to control the volume of MediaPlayer but my question is how to give volume in percentage 1 to 100%?
Upvotes: 0
Views: 965
Reputation: 2568
Use the MediaPlayer setVolume method. It gets 2 float values for left and right speakers and you can set the value for each between 0 to 1.0. This means that if you want the volume to be 70% just call:
mediaPlayer.setVolume(0.7, 0.7);
Upvotes: 1