public void TogglePlayPause() { IPlayer player = GetCurrentPlayer(); if (player == null) { NextItem(); return; } IMediaPlaybackControl mpc = player as IMediaPlaybackControl; if (mpc == null) { return; } if (player.State == PlayerState.Active) { if (mpc.IsPaused) { mpc.Resume(); } else { mpc.Pause(); } } else { mpc.Restart(); } }
public void Restart() { IPlayer player = GetCurrentPlayer(); if (player == null) { NextItem(); return; } IMediaPlaybackControl mpc = player as IMediaPlaybackControl; if (mpc != null) { mpc.Restart(); } }