2.4.1 • Published 2 years ago

lrc-file-parser v2.4.1

Weekly downloads
147
License
MIT
Repository
github
Last release
2 years ago

lrc-file-parser

A lrc file parser based javascript

demo

Installation

  • Use npm install
# install
npm install lrc-file-parser
// import
import Lyric from 'lrc-file-parser'
  • Use script link
<script src="./lrc-file-parser.min.js"></script>

How to use

var lrc = new Lyric({
  onPlay: function (line, text) { // Listening play event
    console.log(line, text) // line is line number of current play
                            // text is lyric text of current play line
  },
  onSetLyric: function (lines) { // listening lyrics seting event
    console.log(lines) // lines is array of all lyric text
  },
  offset: 150, // offset time(ms), default is 150 ms
  playbackRate: 1, // playback rate, default is 1
  isRemoveBlankLine: true // is remove blank line, default is true
})

var extendedLyricStrs = [translationLyricStr]
lrc.setLyric(lyricStr, extendedLyricStrs) // set lyric, lyricStr is lyric file text, extendedLyricStrs is extended lyric file text array (optional)
                      // note: Setting the lyrics will automatically pause the lyrics playback
lrc.play(30000) // play lyric, 30000 is curent play time, unit: ms
lrc.pause() // pause lyric

lrc.setPlaybackRate(1.2) // set playback rate to 1.2x

CHANGELOG

See CHANGELOG.md

LICENSE

MIT

2.4.1

2 years ago

2.4.0

2 years ago

2.3.2

2 years ago

2.3.0

2 years ago

2.3.1

2 years ago

2.2.9

2 years ago

2.2.1

3 years ago

2.2.0

3 years ago

2.2.3

3 years ago

2.2.2

3 years ago

2.2.5

3 years ago

2.2.4

3 years ago

2.2.7

3 years ago

2.2.6

3 years ago

2.2.8

3 years ago

2.1.0

3 years ago

2.0.0

3 years ago

1.2.7

3 years ago

1.2.6

3 years ago

1.2.5

3 years ago

1.2.4

4 years ago

1.2.2

4 years ago

1.2.0

4 years ago

1.1.3

4 years ago

1.2.1

4 years ago

1.1.1

4 years ago

1.1.2

4 years ago

1.1.0

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago

0.1.15

6 years ago

0.1.14

6 years ago

0.1.12

6 years ago

0.1.11

6 years ago

0.1.10

6 years ago

0.1.9

6 years ago

0.1.8

6 years ago

0.1.7

6 years ago

0.1.6

6 years ago

0.1.5

7 years ago

0.1.4

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago