vlc-example-streamplayer
vlc-example-streamplayer copied to clipboard
mute/unmute audio
Is there a way to toggle audio level (mute/unmute) while its playing?
Thanks!
Try modify this class: https://github.com/pedroSG94/vlc-example-streamplayer/blob/master/pedrovlc/src/main/java/com/pedro/vlc/VlcVideoLibrary.java
I think the range is 0-100. Example (not tested):
public void mute() {
if (player != null && player.isPlaying()) {
player.setVolume(0);
}
}
Works for me when called from onComplete(). Thanks!
@Override
public void onComplete() {
vlcVideoLibrary.mute();
Log.d(TAG, "Muting audio");
Toast.makeText(this, "Playing", Toast.LENGTH_SHORT).show();
}