feat(widgets): VideoPlayer data-aksrt-video shared player shell

Route non-embed videos through video-player.js with poster/type/autoplay
loop/muted attrs; keep platform iframe embeds; admin empty warning.
This commit is contained in:
kate522 committed 2026-07-21 08:35:59 +08:00
1 parent 769976e54a
commit 08e63c07f4
2 files changed
+35 -19

No files matched your search

+5 -1
View File
@@ -65,6 +65,8 @@
this.poster = this.el.dataset.poster || '';
this.type = this.el.dataset.type || detectType(this.src);
this.autoplay = this.el.dataset.autoplay === 'true';
this.loop = this.el.dataset.loop === 'true';
this.muted = this.el.dataset.muted === 'true' || this.autoplay;
this.init();
}
@@ -76,8 +78,10 @@
this.video.controls = true;
this.video.playsInline = true;
this.video.preload = this.autoplay ? 'auto' : 'metadata';
if (this.loop) this.video.loop = true;
if (this.muted) this.video.muted = true;
if (this.poster) this.video.poster = this.poster;
this.video.style.cssText = 'display:block;width:100%;height:auto;max-height:70vh;';
this.video.style.cssText = 'display:block;width:100%;height:100%;object-fit:contain;max-height:none;';
// Play overlay
this.overlay = document.createElement('div');