lyric-resolver
A plugin to resolve lyric
6,853
11
| Install | |
|---|---|
npm install lyric-resolver |
|
| Latest Version: | 0.1.6 |
| Vue: | 3 |
| License: | MIT |
| Last Updated: | Apr 16, 2022 |
| Links: | GitHub · npm |
Maintainer: snowingfox
LyricParser
Description
A JavaScript plugin for parser Lyric
📦 Install
npm install lyric-resolver
🔋 Features
- ⚡ Easy to use: Just
play()togglePlay()stop()seek() - 🦾 Type Strong: Written in Typescript, with TS Docs
🎄 Example
🦄 Usage
import Lyric, { HandlerParams } from 'lyric-resolver'
import { getLyric } from '../api/lyric.js'
export async function useLyric(): any {
const lrc = await getLyric()
const currentLyric = new Lyric(lrc, handleLyric)
/*
* @params curLineNum [number] Current line of lyric
* @params txt [string] Current line's txt
*
* @return void
* */
function handleLyric(payload: HandlerParams): void {
const { curLineNum, txt } = payload
// You can also get curLineNum like this
// 你也可以向下面这样操作得到curLineNum
const curLine: number = currentLyric.curLine
}
function play(): void {
// Start playing
currentLyric.play()
}
function stop(): void {
// Stop playing
currentLyric.stop()
}
function togglePlay(): void {
// Auto set play state
currentLyric.togglePlay()
}
function seek(time): void {
// Reset start time
currentLyric.seek(time)
}
}
Version History
| Version | Released | Vue | License |
|---|---|---|---|
| 0.1.6 | ^3.2.23 | MIT | |
| 0.1.5 | ^3.2.23 | MIT | |
| 0.1.4 | ^3.2.23 | MIT | |
| 0.1.3 | ^3.2.23 | MIT | |
| 0.1.2 | ^3.2.23 | MIT | |
| 0.1.1 | ^3.2.23 | MIT | |
| 0.1.0 | ^3.2.23 | MIT | |
| 0.0.9 | ^3.2.23 | MIT | |
| 0.0.8 | ^3.2.23 | MIT | |
| 0.0.7 | ^3.2.23 | MIT | |
| 0.0.6 | ^3.2.23 | MIT | |
| 0.0.5 | ^3.2.23 | MIT | |
| 0.0.4 | ^3.2.23 | MIT | |
| 0.0.3 | ^3.2.23 | MIT | |
| 0.0.2 | ^3.2.23 | MIT | |
| 0.0.1 | ^3.2.23 | MIT |