mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-25 08:01:20 -08:00
添加字幕url的getter和setter
This commit is contained in:
1 parent
8d6dcdf6aa
commit
31d1949da0
5 files changed
+98
-23
No files matched your search
@@ -7,12 +7,23 @@ export default class Subtitle {
|
||||
this.state = true;
|
||||
this.isInit = false;
|
||||
const { url } = this.art.option.subtitle;
|
||||
this.switch = this.init.bind(this);
|
||||
if (url) {
|
||||
this.init(url);
|
||||
}
|
||||
}
|
||||
|
||||
get url() {
|
||||
const { $track } = this.art.template;
|
||||
if ($track) {
|
||||
return $track.src;
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
set url(url) {
|
||||
this.init(url);
|
||||
}
|
||||
|
||||
init(url) {
|
||||
const {
|
||||
events: { proxy },
|
||||
|
||||
Reference in new issue
Block a user