This commit is contained in:
Harvey committed 2021-12-10 08:36:46 +08:00
1 parent dc2345306c
commit a6917400c3
10 files changed
+110 -17

No files matched your search

-1
View File
@@ -12,7 +12,6 @@ export default class Events {
this.proxy = this.proxy.bind(this);
this.hover = this.hover.bind(this);
this.loadImg = this.loadImg.bind(this);
art.proxy = this.proxy;
if (art.whitelist.state) {
art.once('ready', () => {
+13 -1
View File
@@ -31,7 +31,10 @@ export default class Artplayer extends Emitter {
super();
this.id = ++id;
this.option = validator(utils.mergeDeep(Artplayer.option, option), scheme);
const mergeOption = utils.mergeDeep(Artplayer.option, option);
this.option = validator(mergeOption, scheme);
this.isFocus = false;
this.isDestroy = false;
this.userAgent = utils.userAgent;
@@ -40,6 +43,7 @@ export default class Artplayer extends Emitter {
this.whitelist = new Whitelist(this);
this.template = new Template(this);
this.events = new Events(this);
if (this.whitelist.state) {
this.storage = new Storage(this);
this.icons = new Icons(this);
@@ -171,6 +175,14 @@ export default class Artplayer extends Emitter {
};
}
get proxy() {
return this.events.proxy;
}
get query() {
return this.template.query;
}
destroy(removeHtml = true) {
this.events.destroy();
this.template.destroy(removeHtml);
+2 -1
View File
@@ -3,7 +3,8 @@ import { errorHandle, query, addClass, replaceElement } from './utils';
export default class Template {
constructor(art) {
this.art = art;
this.art.query = this.query.bind(this);
this.query = this.query.bind(this);
if (art.option.container instanceof Element) {
this.$container = art.option.container;