mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-31 04:31:20 -08:00
fix(multiple-subtitles): repair old ASS conversion line breaks [PKG-MULTI-SUB-11]
This commit is contained in:
1 parent
8ae2762a23
commit
318de37e8a
22 files changed
+3268
-27
No files matched your search
@@ -1,4 +1,5 @@
|
||||
import type { Converters, Lifetime, TrackOption } from './types'
|
||||
import convertAss from './ass-conversion'
|
||||
|
||||
export default async function loadVtt(option: TrackOption, { getExt, srtToVtt, assToVtt }: Converters, lifetime: Lifetime): Promise<string | void> {
|
||||
if (lifetime.closed)
|
||||
@@ -21,7 +22,7 @@ export default async function loadVtt(option: TrackOption, { getExt, srtToVtt, a
|
||||
const text = new TextDecoder(option.encoding || 'utf-8').decode(buffer!)
|
||||
switch (option.type || getExt(option.url!)) {
|
||||
case 'srt': return srtToVtt(text)
|
||||
case 'ass': return assToVtt(text)
|
||||
case 'ass': return convertAss(text, assToVtt)
|
||||
case 'vtt': return text
|
||||
default: return ''
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user