添加白名单功能

This commit is contained in:
Harvey Zack committed 2018-11-28 19:26:21 +08:00
1 parent 970e7e3b89
commit 02c45caa38
11 files changed
+253 -43

No files matched your search

+16 -2
View File
@@ -12,10 +12,14 @@ export default class Template {
errorHandle(false, 'Cannot mount multiple instances on the same dom element');
}
this.init();
if (art.whitelist.state) {
this.initDesktop();
} else {
this.initMobile();
}
}
init() {
initDesktop() {
this.$container.innerHTML = `
<div class="artplayer-video-player">
<video class="artplayer-video"></video>
@@ -76,6 +80,16 @@ export default class Template {
this.$contextmenu = this.$container.querySelector('.artplayer-contextmenu');
}
initMobile() {
this.$container.innerHTML = `
<div class="artplayer-video-player">
<video class="artplayer-video"></video>
</div>
`;
this.$player = this.$container.querySelector('.artplayer-video-player');
this.$video = this.$container.querySelector('.artplayer-video');
}
destroy(removeHtml) {
if (removeHtml) {
this.$container.innerHTML = '';