mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-10 12:46:15 -08:00
24 lines
642 B
JavaScript
24 lines
642 B
JavaScript
import { append, setStyle } from './utils';
|
|
import Component from './utils/component';
|
|
|
|
export default class Mask extends Component {
|
|
constructor(art) {
|
|
super(art);
|
|
|
|
this.name = 'mask';
|
|
const { template, icons, events } = art;
|
|
|
|
const $state = append(template.$state, icons.state);
|
|
const $error = append(template.$state, icons.error);
|
|
|
|
setStyle($error, 'display', 'none');
|
|
|
|
art.on('destroy', () => {
|
|
setStyle($state, 'display', 'none');
|
|
setStyle($error, 'display', null);
|
|
});
|
|
|
|
events.proxy(template.$state, 'click', () => art.play());
|
|
}
|
|
}
|