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]]
|
||||
name = "iced_video_player"
|
||||
version = "0.3.0"
|
||||
version = "0.4.0"
|
||||
dependencies = [
|
||||
"glib",
|
||||
"gstreamer",
|
||||
|
|
19
README.md
19
README.md
|
@ -27,32 +27,25 @@ See the "minimal" example for a demonstration on how you could implement pausing
|
|||
|
||||
```rust
|
||||
use iced_video_player::{Video, VideoPlayer};
|
||||
use iced::{Sandbox, Element};
|
||||
|
||||
fn main() {
|
||||
App::run(Default::default());
|
||||
fn main() -> iced::Result {
|
||||
iced::run("Video Player", (), App::view)
|
||||
}
|
||||
|
||||
struct App {
|
||||
video: Video,
|
||||
}
|
||||
|
||||
impl Sandbox for App {
|
||||
type Message = ();
|
||||
|
||||
fn new() -> Self {
|
||||
impl Default for App {
|
||||
fn default() -> Self {
|
||||
App {
|
||||
video: Video::new(&url::Url::parse("file:///C:/my_video.mp4").unwrap()).unwrap(),
|
||||
}
|
||||
}
|
||||
|
||||
fn title(&self) -> String {
|
||||
String::from("Video Player")
|
||||
}
|
||||
|
||||
fn update(&mut self, _message: ()) {}
|
||||
|
||||
fn view(&mut self) -> Element<()> {
|
||||
impl App {
|
||||
fn view(&self) -> iced::Element<()> {
|
||||
VideoPlayer::new(&self.video).into()
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue