pub fn send_command(command: Command) -> boolExpand description
Sends a media command to the currently active media client.
This function sends a command to the media remote system, instructing the currently active media client to perform a specific action.
§Note
- The
useInfoargument is not supported by this function and is not used in the current implementation. - If no media is currently playing, this function may open iTunes (or the default media player) to handle the command.
§Arguments
command: TheCommandto be sent to the media client. This can represent various actions such as play, pause, skip, or volume control.
§Returns
bool:trueif the command was successfully sent and processed.falseif the operation failed or the command was not recognized.
§Example
use media_remote::{send_command, Command};
if send_command(Command::Play) {
println!("Command sent successfully.");
} else {
println!("Failed to send command.");
}