mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-26 08:51:20 -08:00
4.0.5
This commit is contained in:
1 parent
dc2345306c
commit
a6917400c3
10 files changed
+110
-17
No files matched your search
@@ -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', () => {
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user