update readme
This commit is contained in:
parent
61b083929e
commit
f649ec93da
2 changed files with 8 additions and 15 deletions
2
Cargo.lock
generated
2
Cargo.lock
generated
|
@ -1784,7 +1784,7 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "iced_video_player"
|
name = "iced_video_player"
|
||||||
version = "0.3.0"
|
version = "0.4.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"glib",
|
"glib",
|
||||||
"gstreamer",
|
"gstreamer",
|
||||||
|
|
21
README.md
21
README.md
|
@ -27,32 +27,25 @@ See the "minimal" example for a demonstration on how you could implement pausing
|
||||||
|
|
||||||
```rust
|
```rust
|
||||||
use iced_video_player::{Video, VideoPlayer};
|
use iced_video_player::{Video, VideoPlayer};
|
||||||
use iced::{Sandbox, Element};
|
|
||||||
|
|
||||||
fn main() {
|
fn main() -> iced::Result {
|
||||||
App::run(Default::default());
|
iced::run("Video Player", (), App::view)
|
||||||
}
|
}
|
||||||
|
|
||||||
struct App {
|
struct App {
|
||||||
video: Video,
|
video: Video,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Sandbox for App {
|
impl Default for App {
|
||||||
type Message = ();
|
fn default() -> Self {
|
||||||
|
|
||||||
fn new() -> Self {
|
|
||||||
App {
|
App {
|
||||||
video: Video::new(&url::Url::parse("file:///C:/my_video.mp4").unwrap()).unwrap(),
|
video: Video::new(&url::Url::parse("file:///C:/my_video.mp4").unwrap()).unwrap(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fn title(&self) -> String {
|
impl App {
|
||||||
String::from("Video Player")
|
fn view(&self) -> iced::Element<()> {
|
||||||
}
|
|
||||||
|
|
||||||
fn update(&mut self, _message: ()) {}
|
|
||||||
|
|
||||||
fn view(&mut self) -> Element<()> {
|
|
||||||
VideoPlayer::new(&self.video).into()
|
VideoPlayer::new(&self.video).into()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue