mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-08 19:06:15 -08:00
artplayer-plugin-multiple-subtitles
Multiple subtitles plugin for ArtPlayer
Demo
TypeScript
The root and /legacy type entries preserve historical parameter and return-type extraction.
Registration has always been asynchronous. For accurate Promise and selection-method types,
use the additive runtime entry, which loads the same implementation:
import multipleSubtitles from 'artplayer-plugin-multiple-subtitles/runtime'
const register = multipleSubtitles({
subtitles: [{ url: '/subtitles/en.vtt', name: 'en' }],
})
// With an existing ArtPlayer instance:
const result = await register(art)
result.tracks(['en'])
result.reset()
The option object is required; {} means no tracks. tracks() clears the selection;
reset() restores all original tracks. Both methods return void. The existing onParser
field remains declared for compatibility but is not invoked by the implementation.
See maintenance notes for module responsibilities and validation commands.
License
MIT © Harvey Zhao