mirror of
https://github.com/videojs/video.js.git
synced 2025-01-27 11:22:06 +02:00
fix: player el ingest when parent doesn't have hasAttribute
method (#3929)
For elements which parent doesn't have `hasAttribute` it needs do another check to prevent erroring out. One case of this is when video.js is created inside a documentFragment, the parent node won't have a `hasAttribute` method.
This commit is contained in:
parent
d290db1765
commit
bbe82530aa
@ -473,7 +473,7 @@ class Player extends Component {
|
||||
createEl() {
|
||||
const tag = this.tag;
|
||||
let el;
|
||||
const playerElIngest = this.playerElIngest_ = tag.parentNode && tag.parentNode.hasAttribute('data-vjs-player');
|
||||
const playerElIngest = this.playerElIngest_ = tag.parentNode && tag.parentNode.hasAttribute && tag.parentNode.hasAttribute('data-vjs-player');
|
||||
|
||||
if (playerElIngest) {
|
||||
el = this.el_ = tag.parentNode;
|
||||
|
Loading…
x
Reference in New Issue
Block a user