Fix video modal stacking and playback readiness

This commit is contained in:
thePR0M3TH3AN committed 2025-10-07 21:51:12 -04:00
1 parent 6ecbef207f
commit ad0713b4cb
6 files changed
+1024 -679

No files matched your search

+7 -2
View File
@@ -151,9 +151,14 @@ export class VideoModal {
const wrapper = this.document.createElement("div");
wrapper.innerHTML = html;
this.removeTrackingScripts(wrapper);
container.appendChild(wrapper);
const playerModal = wrapper.querySelector("#playerModal");
const fragment = this.document.createDocumentFragment();
while (wrapper.firstChild) {
fragment.appendChild(wrapper.firstChild);
}
container.appendChild(fragment);
const playerModal = container.querySelector("#playerModal");
if (!playerModal) {
throw new Error("Player modal root not found in markup.");
}