yew-aplayer

Crates.ioyew-aplayer
lib.rsyew-aplayer
version0.1.0
sourcesrc
created_at2020-10-22 08:10:23.96547
updated_at2020-10-22 08:10:23.96547
descriptionUse APlayer in Yew!
homepage
repositoryhttps://github.com/GalAster/yew-aplayer
max_upload_size
id304198
size3,927
SasakiSaki (oovm)

documentation

README

APlayer for Yew

How to use

  1. It's only do the wasm bind, so load cdn first
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/aplayer/1.10.1/APlayer.min.css">
  1. Easily used by <APlayer/>
use yew_aplayer::{APlayer, APlayerAudio};
let songs = vec![
    APlayerAudio::new(
        "前前前世",
        "RADWIMPS",
        "https://cn-south-17-aplayer-46154810.oss.dogecdn.com/yourname.mp3",
        "https://cn-south-17-aplayer-46154810.oss.dogecdn.com/yourname.jpg",
        Some("https://cn-south-17-aplayer-46154810.oss.dogecdn.com/yourname.lrc"),
    ),
    APlayerAudio::new(
        "回レ!雪月花",
        "小倉唯",
        "https://cn-east-17-aplayer-35525609.oss.dogecdn.com/snowmoonflowers.mp3",
        "https://cn-east-17-aplayer-35525609.oss.dogecdn.com/snowmoonflowers.jpg",
        Some("https://cn-east-17-aplayer-35525609.oss.dogecdn.com/snowmoonflowers.lrc"),
    ),
];

html! {
    <APlayer audios=songs/>
}

Todo

  • Automatically import css cdn when the first component is loaded
Commit count: 3

cargo fmt