docs update

This commit is contained in:
Harvey Zack committed 2018-11-14 17:18:17 +08:00
1 parent d26826401a
commit 53cbde0ff0
4 files changed
+43 -16

No files matched your search

+14 -3
View File
@@ -83,8 +83,8 @@ class Artplayer extends Emitter {
style: {}
},
moreVideoAttr: {
'controls': false,
'preload': 'auto'
controls: false,
preload: 'auto'
},
lang: navigator.language.toLowerCase()
};
@@ -113,6 +113,14 @@ class Artplayer extends Emitter {
this.refs.$container = document.querySelector(this.option.container);
}
if (
Artplayer.instances.some(
art => art.refs.$container === this.refs.$container
)
) {
utils.errorHandle(false, 'Cannot mount multiple instances on the same dom element');
}
this.template = new Template(this);
this.storage = new Storage(this);
this.i18n = new I18n(this);
@@ -145,6 +153,9 @@ class Artplayer extends Emitter {
}
}
Artplayer.instances = [];
Object.defineProperty(Artplayer, 'instances', {
value: []
});
window.Artplayer = Artplayer;
export default Artplayer;