How to switch between Play / Pause in MPRemoteCommandCenter

I do not know how to switch the play and pause button. I tried TogglePlayPauseCommand. But that does not work.

+4
source share
1 answer

Could you post your code on how you tried to implement TogglePlayPauseCommand? I think it will be done like this:

public override void ViewDidLoad()
{
    base.ViewDidLoad ();
    var commandCenter = MPRemoteCommandCenter.Shared;
    commandCenter.TogglePlayPauseCommand.AddTarget (ToggledPlayPauseButton);
}

public MPRemoteCommandHandlerStatus ToggledPlayPauseButton(MPRemoteCommandEvent commandEvent)
{
     Console.WriteLine ("Toggled");
    return MPRemoteCommandHandlerStatus.Success;
}
+2
source

All Articles