mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-26 00:31:20 -08:00
add subtitle
This commit is contained in:
1 parent
5d48d3a437
commit
76c43742b3
10 files changed
+84
-40
No files matched your search
@@ -3,6 +3,7 @@ import { errorHandle, getExt, setStyle } from './utils';
|
||||
export default class Subtitle {
|
||||
constructor(art) {
|
||||
this.art = art;
|
||||
this.isShow = true;
|
||||
|
||||
const { url } = this.art.option.subtitle;
|
||||
if (url) {
|
||||
@@ -92,12 +93,14 @@ export default class Subtitle {
|
||||
show() {
|
||||
const { $subtitle } = this.art.refs;
|
||||
$subtitle.style.display = 'block';
|
||||
this.isShow = true;
|
||||
this.art.emit('subtitle:show', $subtitle);
|
||||
}
|
||||
|
||||
hide() {
|
||||
const { $subtitle } = this.art.refs;
|
||||
$subtitle.style.display = 'none';
|
||||
this.isShow = false;
|
||||
this.art.emit('subtitle:hide', $subtitle);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user