[fix]: play pause not working in presenter

This commit is contained in:
Chris Cochrun 2026-04-09 11:40:26 -05:00
parent 9fa26e41cd
commit d955551cd2
2 changed files with 10 additions and 2 deletions

View file

@ -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,
))
},
);

View file

@ -100,6 +100,7 @@ pub(crate) enum Message {
#[debug("AddObsClient")]
AddObsClient(Arc<Client>),
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(