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:
26
test/unit/utils/custom-element.test.js
Normal file
26
test/unit/utils/custom-element.test.js
Normal 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);
|
Reference in New Issue
Block a user