mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-22 21:31:20 -08:00
添加白名单功能
This commit is contained in:
1 parent
970e7e3b89
commit
02c45caa38
11 files changed
+253
-43
No files matched your search
@@ -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 = '';
|
||||
|
||||
Reference in new issue
Block a user