mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-19 11:21:20 -08:00
docs update
This commit is contained in:
1 parent
d26826401a
commit
53cbde0ff0
4 files changed
+43
-16
No files matched your search
@@ -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;
|
||||
Reference in new issue
Block a user