cleanup
This commit is contained in:
parent
ae461822a8
commit
0834116083
2 changed files with 14 additions and 22 deletions
|
@ -1,8 +1,8 @@
|
||||||
use iced::{
|
use iced::{
|
||||||
widget::{image::Handle, Button, Column, Container, Image, Row, Slider, Space, Text},
|
widget::{Button, Column, Container, Row, Slider, Text},
|
||||||
Element,
|
Element,
|
||||||
};
|
};
|
||||||
use iced_video_player::{Position, Video, VideoPlayer};
|
use iced_video_player::{Video, VideoPlayer};
|
||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
|
|
||||||
fn main() -> iced::Result {
|
fn main() -> iced::Result {
|
||||||
|
@ -23,12 +23,12 @@ struct App {
|
||||||
video: Video,
|
video: Video,
|
||||||
position: f64,
|
position: f64,
|
||||||
dragging: bool,
|
dragging: bool,
|
||||||
thumb: Handle,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for App {
|
impl Default for App {
|
||||||
fn default() -> Self {
|
fn default() -> Self {
|
||||||
let mut video = Video::new(
|
App {
|
||||||
|
video: Video::new(
|
||||||
&url::Url::from_file_path(
|
&url::Url::from_file_path(
|
||||||
std::path::PathBuf::from(file!())
|
std::path::PathBuf::from(file!())
|
||||||
.parent()
|
.parent()
|
||||||
|
@ -39,17 +39,9 @@ impl Default for App {
|
||||||
)
|
)
|
||||||
.unwrap(),
|
.unwrap(),
|
||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap(),
|
||||||
let thumb = video
|
|
||||||
.thumbnails(&[Position::Frame(0)])
|
|
||||||
.unwrap()
|
|
||||||
.pop()
|
|
||||||
.unwrap();
|
|
||||||
App {
|
|
||||||
video,
|
|
||||||
position: 0.0,
|
position: 0.0,
|
||||||
dragging: false,
|
dragging: false,
|
||||||
thumb,
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@ use crate::{pipeline::VideoPrimitive, video::Video};
|
||||||
use gstreamer as gst;
|
use gstreamer as gst;
|
||||||
use iced::{
|
use iced::{
|
||||||
advanced::{self, graphics::core::event::Status, layout, widget, Widget},
|
advanced::{self, graphics::core::event::Status, layout, widget, Widget},
|
||||||
Element, Size,
|
Element,
|
||||||
};
|
};
|
||||||
use iced_wgpu::primitive::Renderer as PrimitiveRenderer;
|
use iced_wgpu::primitive::Renderer as PrimitiveRenderer;
|
||||||
use log::error;
|
use log::error;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue