diff --git a/src/browser.rs b/src/browser.rs index fbfc56c..c69dfc6 100644 --- a/src/browser.rs +++ b/src/browser.rs @@ -11,7 +11,8 @@ pub struct FF2MpvMessage { } pub fn send_reply() -> Result<(), io::Error> { - send_message("ok") + // "ok" formatted as a JSON string + send_message("\"ok\"") } pub fn get_mpv_message() -> Result { diff --git a/src/command.rs b/src/command.rs index c255711..042e9ae 100644 --- a/src/command.rs +++ b/src/command.rs @@ -64,12 +64,15 @@ impl Command { let config = Config::build(); let ff2mpv_message = browser::get_mpv_message()?; Command::launch_mpv(config.player_command, config.player_args, &ff2mpv_message.url)?; + browser::send_reply()?; Ok(()) } fn launch_mpv(command: String, args: Vec, url: &str) -> Result<(), io::Error> { process::Command::new(command) + .stdout(process::Stdio::null()) + .stderr(process::Stdio::null()) .args(args) .arg(url) .spawn()?;