Merge pull request #139 from lamaland/master

fix(progress): better mp3 progress support
This commit is contained in:
jeromewu 2021-01-14 18:41:51 +08:00 committed by GitHub
commit d2800aaf66
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -13,7 +13,7 @@ module.exports = (message, progress) => {
if (duration === 0 || duration > d) { if (duration === 0 || duration > d) {
duration = d; duration = d;
} }
} else if (message.startsWith('frame')) { } else if (message.startsWith('frame') || message.startsWith('size')) {
const ts = message.split('time=')[1].split(' ')[0]; const ts = message.split('time=')[1].split(' ')[0];
const t = ts2sec(ts); const t = ts2sec(ts);
progress({ ratio: t / duration }); progress({ ratio: t / duration });