ustbhuangyi / lyric-parser Goto Github PK
View Code? Open in Web Editor NEWlyric-parser base on javascript
License: MIT License
lyric-parser base on javascript
License: MIT License
点我头像在仓库里搜LyricParser即可
写法:
if (lyric){
lyric.seek(this.data.processValue);
}
processValue:整数和浮点数都不行
调用这句话的时候,handler回调还是会从0 开始,应该怎么才能继续播放呢?
求解答,谢谢
handler里面只能在播放状态下获取当前播放的,怎么在未播放前,获取到所有的歌词呢?
lyric.js
this.lines.push({
time: parseInt(result[1]) * 60 * 1000 +
parseInt(result[2]) * 1000 +
(parseInt(result[3]) || 0),
txt: txt
});
这个插件的针对网易云音乐API
的返回歌词格式的时间计算有bug,本来JS字符串遇到 *
会自动转换成数字,但是在这里自动转换会有bug,需要将源码中的上述转换 时分秒 到 毫秒 的代码,全部手动parseInt()
转换成数字
该bug可导致:
play() 函数调用后,歌词好像不会滚动
看了源码之后:
和我之前猜想的一样,内部的计时器setTimeout
,并不是没有调用,而是因为歌词间隔时间计算bug,导致delay
--间隔时间
很大,毫秒转换多了一个或几个 0 ,导致短时间内看不到滚动
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.