changing how each slide in the song_editor gets its video background

This commit is contained in:
Chris Cochrun 2025-03-16 22:49:42 -05:00
parent 6fa08c1fec
commit 53791162b1
4 changed files with 49 additions and 13 deletions

View file

@ -52,6 +52,20 @@ pub struct Background {
pub kind: BackgroundKind,
}
impl TryFrom<&Background> for Video {
type Error = ParseError;
fn try_from(
value: &Background,
) -> std::result::Result<Self, Self::Error> {
Video::new(
&url::Url::from_file_path(value.path.clone())
.map_err(|_| ParseError::BackgroundNotVideo)?,
)
.map_err(|_| ParseError::BackgroundNotVideo)
}
}
impl TryFrom<Background> for Video {
type Error = ParseError;