1
0
mirror of https://github.com/videojs/video.js.git synced 2025-07-15 01:34:23 +02:00

fix(shadow-dom): prevent warning 'element supplied is not included' (#8192)

Co-authored-by: Giuseppe Piscopo <g.piscopo@braincrumbz.com>
This commit is contained in:
BrainCrumbz
2023-06-06 23:24:30 +02:00
committed by GitHub
parent 3dece507bc
commit dc1e2bb42a
5 changed files with 137 additions and 2 deletions

View File

@ -0,0 +1,26 @@
/* eslint-env browser */
import videojs from '../../../src/js/video.js';
export class TestCustomElement extends HTMLElement {
constructor() {
super();
const shadowRoot = this.attachShadow({ mode: 'closed' });
const containerElem = document.createElement('div');
containerElem.setAttribute('data-vjs-player', '');
shadowRoot.appendChild(containerElem);
const videoElem = document.createElement('video');
videoElem.setAttribute('width', 640);
videoElem.setAttribute('height', 260);
containerElem.appendChild(videoElem);
this.innerPlayer = videojs(videoElem);
}
}
window.customElements.define('test-custom-element', TestCustomElement);