Plyr-rs
Rust binding for Plyr.Please check the official plyr page for more details.
Installation
Specify it as a dependency in Cargo.toml
[]
= { = "https://github.com/deepgreenAN/plyr-rs"}
Usage
Html or Rsx and CSS
See the official page or simple example for how to write in html or rsx and css.
Rust
Give the css selector as an argument as follows,
use Plyr;
let player = new;
or web_sys::HtmlElement.
use document;
use Plyr;
use JsCast;
use HtmlElement;
let player_element = document.query_selector.unwrap.unwrap;
let player = new_with_html_element;
If you want to pass options to the constructor, modify the features.
[]
= { = "https://github.com/deepgreenAN/plyr-rs", = ["options"]}
use PlyrOptions;
use Plyr;
let _player = new_with_options;
CDN
You can use the cdn for reducing the bundle size of js snippets.
[]
= { = "https://github.com/deepgreenAN/plyr-rs", = ["cdn"]}
Examples
Check examples directory for other examples.