mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-14 08:26:16 -08:00
优化字幕传参
This commit is contained in:
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');
|
||||
|
||||
Reference in new issue
Block a user