Merge pull request #458 from amowu/patch-4

fix: parse webVTT time NaN
This commit is contained in:
Sam Potts 2017-01-04 08:45:06 +11:00 committed by GitHub
commit 047fc43f8f

View File

@ -1340,10 +1340,14 @@
} else {
var tc1 = [],
tc2 = [],
seconds;
seconds = 0;
tc1 = tc.split(',');
tc2 = tc1[0].split(':');
seconds = Math.floor(tc2[0]*60*60) + Math.floor(tc2[1]*60) + Math.floor(tc2[2]);
for (var i = 0, len = tc2.length; i < len; i++) {
seconds += Math.floor(tc2[i]*(Math.pow(60, len-(i+1))));
}
return seconds;
}
}