changing how each slide in the song_editor gets its video background
This commit is contained in:
parent
6fa08c1fec
commit
53791162b1
4 changed files with 49 additions and 13 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue