fix: audio player interface issues

the video player doesn't draw when playing audio, so the logic for emitting new frame messages is broken.
This commit is contained in:
Ashley Wulber 2026-04-06 12:40:34 -04:00
parent 6f5040a953
commit 2c6f8599ee
4 changed files with 312 additions and 406 deletions

View file

@ -1572,6 +1572,7 @@ impl Application for App {
&self.key_binds,
&self.projects,
&self.ab_repeat,
self.video_opt.as_ref().is_some_and(|v| v.has_video()),
)]
}
@ -1639,7 +1640,7 @@ impl Application for App {
background_color = theme.cosmic().bg_component_color().into();
text_color_opt = Some(Color::from(theme.cosmic().on_bg_component_color()));
let mut col = widget::column();
let mut col = widget::column::with_capacity(10);
col = col.push(widget::space::vertical());
if let Some(album_art) = &self.album_art_opt {
col = col.push(
@ -1967,6 +1968,13 @@ impl Application for App {
Message::SystemThemeModeChange(update.config)
}),
];
if self.video_opt.as_ref().is_some_and(|v| {
((!v.eos() && !v.paused()) || self.ab_repeat.is_some()) && !v.has_video()
}) {
subscriptions.push(
cosmic::iced::time::every(Duration::from_millis(64)).map(|_| Message::NewFrame),
);
}
#[cfg(feature = "mpris-server")]
{