diff --git a/Cargo.toml b/Cargo.toml index f450031..8c4a5c9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,12 +5,12 @@ authors = ["jazzfool"] edition = "2018" [dependencies] -iced = { version = "0.1", features = ["image", "tokio"] } -iced_native = "0.2" +iced = { git = "https://github.com/hecrj/iced.git", features = ["image", "tokio"] } +iced_native = "0.3.0" gstreamer = "0.16" gstreamer-app = "0.16" # appsink glib = "0.10" # gobject traits and error type -tokio = { version = "0.2", features = ["time", "stream"] }# time subscription (every frame) +tokio = { version = "1.2.0", features = ["time"] } thiserror = "1" url = "2" # media uri num-rational = "0.3" # framerates come in rationals diff --git a/src/lib.rs b/src/lib.rs index 22070fb..9547954 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -353,36 +353,7 @@ impl VideoPlayer { // until iced 0.2 is released, which has this built-in mod time { - use iced::futures; - pub fn every(duration: std::time::Duration) -> iced::Subscription { - iced::Subscription::from_recipe(Every(duration)) - } - - struct Every(std::time::Duration); - - impl iced_native::subscription::Recipe for Every - where - H: std::hash::Hasher, - { - type Output = std::time::Instant; - - fn hash(&self, state: &mut H) { - use std::hash::Hash; - - std::any::TypeId::of::().hash(state); - self.0.hash(state); - } - - fn stream( - self: Box, - _input: futures::stream::BoxStream<'static, I>, - ) -> futures::stream::BoxStream<'static, Self::Output> { - use futures::stream::StreamExt; - - tokio::time::interval(self.0) - .map(|_| std::time::Instant::now()) - .boxed() - } + iced::time::every(duration) } }