1
0
mirror of https://github.com/videojs/video.js.git synced 2025-01-23 11:04:59 +02:00
video.js/test/unit/utils/custom-element.test.js
BrainCrumbz dc1e2bb42a
fix(shadow-dom): prevent warning 'element supplied is not included' (#8192)
Co-authored-by: Giuseppe Piscopo <g.piscopo@braincrumbz.com>
2023-06-06 17:24:30 -04:00

27 lines
686 B
JavaScript

/* 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);