优化字幕传参

This commit is contained in:
Harvey committed 2020-09-04 12:44:50 +08:00
1 parent 92686dfcb6
commit deaa4fa13d
7 files changed
+56 -47

No files matched your search

@@ -12,8 +12,10 @@ export default function localSubtitle(art) {
if (file) {
const type = getExt(file.name);
if (['ass', 'vtt', 'srt'].includes(type)) {
const url = URL.createObjectURL(file);
subtitle.switch(url, file.name, type);
subtitle.switch(URL.createObjectURL(file), {
name: file.name,
ext: type,
});
art.emit('localSubtitle', file);
} else {
errorHandle(false, 'Only supports subtitle files in .ass, .vtt and .srt format');