mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-29 11:11:20 -08:00
feat: update subtitle properties and events to enhance cue management and retrieval
This commit is contained in:
1 parent
8ea85476e0
commit
c0c5a12010
20 files changed
+4319
-2276
No files matched your search
@@ -315,6 +315,9 @@ art.on('ready', () => {
|
||||
- `url` 属性设置和返回当前字幕地址
|
||||
- `style` 方法设置当前字幕的样式
|
||||
- `switch` 方法设置当前字幕地址和选项
|
||||
- `textTrack` 获取当前字幕轨
|
||||
- `activeCues` 获取当前活跃的字幕列表
|
||||
- `cues` 获取整体的字幕列表
|
||||
|
||||
<div className="run-code">▶ Run Code</div>
|
||||
|
||||
|
||||
@@ -595,8 +595,8 @@ var art = new Artplayer({
|
||||
},
|
||||
});
|
||||
|
||||
art.on('subtitleBeforeUpdate', (cue) => {
|
||||
console.info('subtitleBeforeUpdate', cue);
|
||||
art.on('subtitleBeforeUpdate', (cues) => {
|
||||
console.info('subtitleBeforeUpdate', cues);
|
||||
});
|
||||
```
|
||||
|
||||
@@ -615,8 +615,8 @@ var art = new Artplayer({
|
||||
},
|
||||
});
|
||||
|
||||
art.on('subtitleAfterUpdate', (cue) => {
|
||||
console.info('subtitleAfterUpdate', cue);
|
||||
art.on('subtitleAfterUpdate', (cues) => {
|
||||
console.info('subtitleAfterUpdate', cues);
|
||||
});
|
||||
```
|
||||
|
||||
@@ -636,7 +636,7 @@ var art = new Artplayer({
|
||||
});
|
||||
|
||||
art.on('subtitleLoad', (option, cues) => {
|
||||
console.info('subtitleLoad', option, cues);
|
||||
console.info('subtitleLoad', cues, option);
|
||||
});
|
||||
```
|
||||
|
||||
|
||||
Reference in new issue
Block a user