chore: thumbnails and patches

This commit is contained in:
Ashley Wulber 2026-03-20 18:06:17 -04:00
parent 6c401d7030
commit 00395d27dc
5 changed files with 786 additions and 1053 deletions

View file

@ -4,7 +4,7 @@ use iced_video_player::{
gst_app, gst_pbutils,
};
use cosmic::app::{Command, message};
use cosmic::{action, app::Task};
#[derive(Debug, Default)]
pub struct VideoSettings {
@ -14,7 +14,7 @@ pub struct VideoSettings {
pub fn new_video(
url: &url::Url,
settings: VideoSettings,
) -> Result<Video, cosmic::Command<cosmic::app::Message<super::Message>>> {
) -> Result<Video, cosmic::Task<cosmic::Action<super::Message>>> {
//TODO: this code came from iced_video_player::Video::new and has been modified to stop the pipeline on error
//TODO: remove unwraps and enable playback of files with only audio.
gst::init().unwrap();
@ -68,8 +68,8 @@ pub fn new_video(
match msg.view() {
gst::MessageView::Element(element) => {
if gst_pbutils::MissingPluginMessage::is(&element) {
commands.push(Command::perform(
async { message::app(super::Message::MissingPlugin(msg)) },
commands.push(Task::perform(
async { action::app(super::Message::MissingPlugin(msg)) },
|x| x,
));
// Do one codec install at a time
@ -80,7 +80,7 @@ pub fn new_video(
}
}
pipeline.set_state(gst::State::Null).unwrap();
Err(Command::batch(commands))
Err(Task::batch(commands))
}
}
}