0
votes

How to Mute volume on Button Clicked in MediaManager Plugin xamarin forms

Below is my function

private void MuteClicked(object sender, EventArgs e) {

        if (CrossMediaManager.Current.VolumeManager.Mute)
        {
            CrossMediaManager.Current.VolumeManager.Mute = false;
            muteBtn.Text = "Mute";
        }
        else
        {
            CrossMediaManager.Current.VolumeManager.Mute = true;
            muteBtn.Text = "Unmute";
        }

}

Button name is Changing but not affecting Volume

2

2 Answers

1
votes

The current version (0.4.5) available via Nuget only contains placeholders for the volume controls.

Either your download the last version from the GIT repository ( https://github.com/martijn00/XamarinMediaManager ) or you wait for the next release.

0
votes

I know it's an old thread but since there were no new release for the MediaPlayer and this is still the top result for this problem, you can use the unofficial nuget (https://www.nuget.org/packages/MediaManager.Unofficial/) witch is just a fork of the version 0.4.5 with some adjustments. I just tried it and the Mute (which is now Muted) works, like the volume too.

Regards