mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-26 00:31:20 -08:00
refactor(multiple-subtitles): [PKG-MULTI-SUB-04] expose compatible runtime type entry
This commit is contained in:
1 parent
7f226ff822
commit
d44e81ce22
34 files changed
+3346
-60
No files matched your search
@@ -1,4 +1,5 @@
|
||||
import type Artplayer from 'artplayer'
|
||||
import type { RuntimeFactory } from '../types/artplayer-plugin-multiple-subtitles'
|
||||
import type { Option, Result, Track } from './types'
|
||||
import installCaptionView from './caption'
|
||||
import createLifetime from './lifetime'
|
||||
@@ -6,7 +7,7 @@ import { parseTracks, serializeTracks } from './merge'
|
||||
import createRenderer from './render'
|
||||
import loadVtt from './request'
|
||||
|
||||
export default function artplayerPluginMultipleSubtitles({ subtitles = [] }: Option) {
|
||||
function artplayerPluginMultipleSubtitles({ subtitles = [] }: Option) {
|
||||
return async (art: Artplayer): Promise<Result> => {
|
||||
const { unescape, getExt, srtToVtt, assToVtt } = (art.constructor as typeof Artplayer).utils
|
||||
const lifetime = createLifetime(art)
|
||||
@@ -44,3 +45,5 @@ export default function artplayerPluginMultipleSubtitles({ subtitles = [] }: Opt
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export default Object.assign(artplayerPluginMultipleSubtitles, { default: artplayerPluginMultipleSubtitles }) as RuntimeFactory
|
||||
Reference in new issue
Block a user