mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-23 13:51:20 -08:00
build all packages
This commit is contained in:
1 parent
6c2d5f62f6
commit
cadfa4efe5
28 files changed
+412
-382
No files matched your search
@@ -30,7 +30,7 @@ export default class Subtitle {
|
||||
this.load(url).then(url => {
|
||||
this.art.template.$track.src = url;
|
||||
this.art.emit('subtitle:load', url);
|
||||
|
||||
|
||||
if ($video.textTracks && $video.textTracks[0]) {
|
||||
const [track] = $video.textTracks;
|
||||
proxy(track, 'cuechange', () => {
|
||||
@@ -73,25 +73,20 @@ export default class Subtitle {
|
||||
});
|
||||
}
|
||||
|
||||
show() {
|
||||
set show(value) {
|
||||
const { $player } = this.art.template;
|
||||
this.state = true;
|
||||
$player.classList.remove('artplayer-subtitle-hide');
|
||||
this.art.emit('subtitle:show');
|
||||
}
|
||||
|
||||
hide() {
|
||||
const { $player } = this.art.template;
|
||||
this.state = false;
|
||||
$player.classList.add('artplayer-subtitle-hide');
|
||||
this.art.emit('subtitle:hide');
|
||||
if (value) {
|
||||
this.state = true;
|
||||
$player.classList.remove('artplayer-subtitle-hide');
|
||||
this.art.emit('subtitle:show');
|
||||
} else {
|
||||
this.state = false;
|
||||
$player.classList.add('artplayer-subtitle-hide');
|
||||
this.art.emit('subtitle:hide');
|
||||
}
|
||||
}
|
||||
|
||||
toggle() {
|
||||
if (this.state) {
|
||||
this.hide();
|
||||
} else {
|
||||
this.show();
|
||||
}
|
||||
this.show = !this.state;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user