From d955551cd25bfa4d6ef7837e9bb947efc77612d2 Mon Sep 17 00:00:00 2001 From: Chris Cochrun Date: Thu, 9 Apr 2026 11:40:26 -0500 Subject: [PATCH] [fix]: play pause not working in presenter --- src/main.rs | 4 ++-- src/ui/presenter.rs | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 5ca72bd..fd468c2 100755 --- a/src/main.rs +++ b/src/main.rs @@ -1576,7 +1576,7 @@ impl cosmic::Application for App { button::icon(icon::from_name("media-play")) .tooltip("Play") .on_press(Message::Present( - presenter::Message::StartVideo, + presenter::Message::PlayPauseVideo, )) }, |video| { @@ -1588,7 +1588,7 @@ impl cosmic::Application for App { button::icon(icon::from_name(icon_name)) .tooltip(tooltip) .on_press(Message::Present( - presenter::Message::StartVideo, + presenter::Message::PlayPauseVideo, )) }, ); diff --git a/src/ui/presenter.rs b/src/ui/presenter.rs index b38d8fb..f7df8f5 100644 --- a/src/ui/presenter.rs +++ b/src/ui/presenter.rs @@ -100,6 +100,7 @@ pub(crate) enum Message { #[debug("AddObsClient")] AddObsClient(Arc), AssignSlideAction(slide_actions::Action), + PlayPauseVideo, } #[allow(clippy::enum_variant_names)] @@ -509,6 +510,13 @@ impl Presenter { .set_looping(self.current_slide.video_loop()); } } + Message::PlayPauseVideo => { + if let Some(video) = &mut self.video { + video.set_paused(!video.paused()); + video + .set_looping(self.current_slide.video_loop()); + } + } Message::VideoPos(position) => { if let Some(video) = &mut self.video { let position = Position::Time(