Skip to content

hanxiaoxin/little

Repository files navigation

LittlePlayer 音乐播放器

示例地址demo

npm地址

demo

API

Install

npm i @nankle/little

Options

import LittlePlayer from '@nankle/little';

var player = new LittlePlayer(
    {
        container: document.getElementById("littleBox"),
        autoPlay: false // 自动播放受到最近浏览器限制,开启暂时不生效
    }
)

Load target:

// The target can be the url address of media or a mediaElement
player.load(
    [
        {
            url: "./audios/break-out.mp3",
            title: "break-out.mp3",
            cover: 'https://blog-1251618686.cos.ap-guangzhou.myqcloud.com/abouts/covers/break-out.png'
        },
        {
            url: "./audios/break-out.mp3",
            title: "break-out.mp3",
            cover: 'https://blog-1251618686.cos.ap-guangzhou.myqcloud.com/abouts/covers/break-out.png'
        }
    ]
);

Destroy instance:

player.destroy();

About

little is a music player, but more

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published