
Gsy Subtitle And Preview
外挂/内嵌字幕(SRT/VTT)、Exo 内嵌字幕轨、Seek 悬浮预览缩略图(VTT thumbnails)。
Install
npx skills add CarGuo/GSYVideoPlayer --skill gsy-subtitle-and-preview -g -a claude-code -y- Repository
- CarGuo/GSYVideoPlayer21.5k
- Category
- Engineering
- Updated
- 25d ago
- License
- Apache-2.0
- Context cost
- Lightabout 1,016 tokens
- Runs scripts
- No, instructions only
What it does
外挂/内嵌字幕(SRT/VTT)、Exo 内嵌字幕轨、Seek 悬浮预览缩略图(VTT thumbnails)。
gsy-subtitle-and-preview
字幕 API
顶层控制器:GSYSubtitleController。视图:GSYSubtitleView。
| 方法 | 说明 |
|---|---|
new GSYSubtitleController(context, subtitleView) | 绑定 UI |
setSources(List<GSYSubtitleSource>) | 一次注入多轨字幕 |
setSource(GSYSubtitleSource) | 只有一条 |
getSources() | 只读 List |
selectSubtitle(String id) | 按 id 切换字幕,"" 或 null 关闭 |
setStyle(GSYSubtitleStyle) | 字体/描边/背景/颜色 |
setOffsetMs(long) | 音画/字幕 offset |
setEnabled(boolean) | 开关 |
updatePosition(long positionMs) | 由 player 进度驱动 |
release() | 释放 |
GSYSubtitleSource 字段
| 字段 | 说明 |
|---|---|
id | 唯一 id |
label | 显示名 |
language | ISO code |
mime | 见 GSYSubtitleMime:text/vtt、application/x-subrip(srt)、text/plain |
uri | http 或 file uri |
embedded | 是否内嵌轨(Exo 场景) |
内置解析器
- SRT:GSYSrtSubtitleParser
- WebVTT:GSYWebVttSubtitleParser
- 自定义 MIME:注册到 GSYSubtitleParserFactory
