update lib docs
This commit is contained in:
parent
f649ec93da
commit
5d87dbdf88
1 changed files with 7 additions and 15 deletions
20
src/lib.rs
20
src/lib.rs
|
@ -8,33 +8,25 @@
|
|||
//! Example:
|
||||
//! ```rust
|
||||
//! use iced_video_player::{Video, VideoPlayer};
|
||||
//! use iced::{Sandbox, Element};
|
||||
//!
|
||||
//! # #![allow(clippy::needless_doctest_main)]
|
||||
//! 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