From 08341160839ee5f10b253de3edc26c7a5d654099 Mon Sep 17 00:00:00 2001 From: jazzfool Date: Tue, 1 Oct 2024 11:41:34 +1000 Subject: [PATCH] cleanup --- examples/minimal.rs | 34 +++++++++++++--------------------- src/video_player.rs | 2 +- 2 files changed, 14 insertions(+), 22 deletions(-) diff --git a/examples/minimal.rs b/examples/minimal.rs index 308ea1f..dd49280 100644 --- a/examples/minimal.rs +++ b/examples/minimal.rs @@ -1,8 +1,8 @@ use iced::{ - widget::{image::Handle, Button, Column, Container, Image, Row, Slider, Space, Text}, + widget::{Button, Column, Container, Row, Slider, Text}, Element, }; -use iced_video_player::{Position, Video, VideoPlayer}; +use iced_video_player::{Video, VideoPlayer}; use std::time::Duration; fn main() -> iced::Result { @@ -23,33 +23,25 @@ struct App { video: Video, position: f64, dragging: bool, - thumb: Handle, } impl Default for App { fn default() -> Self { - let mut video = Video::new( - &url::Url::from_file_path( - std::path::PathBuf::from(file!()) - .parent() - .unwrap() - .join("../.media/test.mp4") - .canonicalize() - .unwrap(), + App { + video: Video::new( + &url::Url::from_file_path( + std::path::PathBuf::from(file!()) + .parent() + .unwrap() + .join("../.media/test.mp4") + .canonicalize() + .unwrap(), + ) + .unwrap(), ) .unwrap(), - ) - .unwrap(); - let thumb = video - .thumbnails(&[Position::Frame(0)]) - .unwrap() - .pop() - .unwrap(); - App { - video, position: 0.0, dragging: false, - thumb, } } } diff --git a/src/video_player.rs b/src/video_player.rs index ed7045f..d492bd1 100644 --- a/src/video_player.rs +++ b/src/video_player.rs @@ -2,7 +2,7 @@ use crate::{pipeline::VideoPrimitive, video::Video}; use gstreamer as gst; use iced::{ advanced::{self, graphics::core::event::Status, layout, widget, Widget}, - Element, Size, + Element, }; use iced_wgpu::primitive::Renderer as PrimitiveRenderer; use log::error;