mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-23 13:51:20 -08:00
Refactor Artplayer class to update import path for Component
This commit is contained in:
1 parent
c526b45820
commit
2db49bdede
4 files changed
+17
-144
No files matched your search
@@ -19,7 +19,7 @@ export default class Subtitle extends Component {
|
||||
super(art);
|
||||
this.name = 'subtitle';
|
||||
this.option = null;
|
||||
this.eventDestroy = () => null;
|
||||
this.destroyEvent = () => null;
|
||||
this.init(art.option.subtitle);
|
||||
|
||||
let lastState = false;
|
||||
@@ -115,12 +115,12 @@ export default class Subtitle extends Component {
|
||||
this.art.emit('subtitleLoad', this.cues, this.option);
|
||||
};
|
||||
|
||||
this.eventDestroy();
|
||||
this.art.events.remove(this.destroyEvent);
|
||||
$track.onload = null;
|
||||
remove($track);
|
||||
append($video, $newTrack);
|
||||
template.$track = $newTrack;
|
||||
this.eventDestroy = proxy(this.textTrack, 'cuechange', () => this.update());
|
||||
this.destroyEvent = proxy(this.textTrack, 'cuechange', () => this.update());
|
||||
}
|
||||
|
||||
async init(subtitleOption) {
|
||||
|
||||
Reference in new issue
Block a user