change fullscreen element to player rootnode (#2204)

Co-authored-by: Walter van den Houten <63712489+wdfvdhouten@users.noreply.github.com>
This commit is contained in:
Sam Potts
2021-09-29 21:10:54 +10:00
committed by GitHub
parent 9d751f4265
commit d41a90f0dd

View File

@ -124,7 +124,7 @@ class Fullscreen {
return hasClass(this.target, this.player.config.classNames.fullscreen.fallback);
}
const element = !this.prefix ? document.fullscreenElement : document[`${this.prefix}${this.property}Element`];
const element = !this.prefix ? this.target.getRootNode().fullscreenElement : this.target.getRootNode()[`${this.prefix}${this.property}Element`];
return element && element.shadowRoot ? element === this.target.getRootNode().host : element === this.target;
}