add subtitle

This commit is contained in:
Harvey Zack committed 2018-10-26 11:23:54 +08:00
1 parent 5d48d3a437
commit 76c43742b3
10 files changed
+84 -40

No files matched your search

+3
View File
@@ -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);
}