[fix]: play pause not working in presenter
This commit is contained in:
parent
9fa26e41cd
commit
d955551cd2
2 changed files with 10 additions and 2 deletions
|
|
@ -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,
|
||||
))
|
||||
},
|
||||
);
|
||||
|
|
|
|||
|
|
@ -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(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue