|
|
@ -19056,7 +19056,8 @@ const getOffset = (el) => {
|
|
|
|
const isVideoFullScreen = (_this) => {
|
|
|
|
const isVideoFullScreen = (_this) => {
|
|
|
|
const videoPlayer = _this.getElementsByClassName('videoPlayer')[0];
|
|
|
|
const videoPlayer = _this.getElementsByClassName('videoPlayer')[0];
|
|
|
|
const video = videoPlayer.children[0];
|
|
|
|
const video = videoPlayer.children[0];
|
|
|
|
return (video.offsetWidth > _this.getElementsByClassName('searchContainer')[0].offsetWidth ||
|
|
|
|
const body = document.getElementsByTagName('body')[0];
|
|
|
|
|
|
|
|
return ((video.offsetWidth === body.offsetHeight && video.offsetHeight === body.offsetHeight) ||
|
|
|
|
(_this.videoElem && _this.videoElem.classList.contains('simulatedFullScreen')));
|
|
|
|
(_this.videoElem && _this.videoElem.classList.contains('simulatedFullScreen')));
|
|
|
|
};
|
|
|
|
};
|
|
|
|
const findTrailerURL = (movieData) => {
|
|
|
|
const findTrailerURL = (movieData) => {
|
|
|
@ -19841,34 +19842,36 @@ class PlexMeetsHomeAssistant extends HTMLElement {
|
|
|
|
this.previousPositions = [];
|
|
|
|
this.previousPositions = [];
|
|
|
|
// todo: find a better way to detect resize...
|
|
|
|
// todo: find a better way to detect resize...
|
|
|
|
setInterval(() => {
|
|
|
|
setInterval(() => {
|
|
|
|
const videoPlayer = this.getElementsByClassName('videoPlayer')[0];
|
|
|
|
if (!this.detailsShown) {
|
|
|
|
let isFullScreen = false;
|
|
|
|
const videoPlayer = this.getElementsByClassName('videoPlayer')[0];
|
|
|
|
if (videoPlayer.children.length > 0) {
|
|
|
|
let isFullScreen = false;
|
|
|
|
isFullScreen = isVideoFullScreen(this);
|
|
|
|
if (videoPlayer.children.length > 0) {
|
|
|
|
}
|
|
|
|
isFullScreen = isVideoFullScreen(this);
|
|
|
|
if (this.movieElems.length > 0 && !isFullScreen) {
|
|
|
|
}
|
|
|
|
let renderNeeded = false;
|
|
|
|
if (this.movieElems.length > 0 && !isFullScreen) {
|
|
|
|
if (this.previousPositions.length === 0) {
|
|
|
|
let renderNeeded = false;
|
|
|
|
|
|
|
|
if (this.previousPositions.length === 0) {
|
|
|
|
|
|
|
|
for (let i = 0; i < this.movieElems.length; i += 1) {
|
|
|
|
|
|
|
|
this.previousPositions[i] = {};
|
|
|
|
|
|
|
|
this.previousPositions[i].top = this.movieElems[i].parentElement.offsetTop;
|
|
|
|
|
|
|
|
this.previousPositions[i].left = this.movieElems[i].parentElement.offsetLeft;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
for (let i = 0; i < this.movieElems.length; i += 1) {
|
|
|
|
for (let i = 0; i < this.movieElems.length; i += 1) {
|
|
|
|
this.previousPositions[i] = {};
|
|
|
|
if (this.previousPositions[i] &&
|
|
|
|
this.previousPositions[i].top = this.movieElems[i].parentElement.offsetTop;
|
|
|
|
this.movieElems[i].dataset.clicked !== 'true' &&
|
|
|
|
this.previousPositions[i].left = this.movieElems[i].parentElement.offsetLeft;
|
|
|
|
(this.previousPositions[i].top !== this.movieElems[i].parentElement.offsetTop ||
|
|
|
|
|
|
|
|
this.previousPositions[i].left !== this.movieElems[i].parentElement.offsetLeft)) {
|
|
|
|
|
|
|
|
renderNeeded = true;
|
|
|
|
|
|
|
|
this.previousPositions = [];
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (renderNeeded) {
|
|
|
|
for (let i = 0; i < this.movieElems.length; i += 1) {
|
|
|
|
this.renderPage();
|
|
|
|
if (this.previousPositions[i] &&
|
|
|
|
const contentbg = this.getElementsByClassName('contentbg');
|
|
|
|
this.movieElems[i].dataset.clicked !== 'true' &&
|
|
|
|
this.contentBGHeight = getHeight(contentbg[0]);
|
|
|
|
(this.previousPositions[i].top !== this.movieElems[i].parentElement.offsetTop ||
|
|
|
|
|
|
|
|
this.previousPositions[i].left !== this.movieElems[i].parentElement.offsetLeft)) {
|
|
|
|
|
|
|
|
renderNeeded = true;
|
|
|
|
|
|
|
|
this.previousPositions = [];
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (renderNeeded) {
|
|
|
|
|
|
|
|
this.renderPage();
|
|
|
|
|
|
|
|
const contentbg = this.getElementsByClassName('contentbg');
|
|
|
|
|
|
|
|
this.contentBGHeight = getHeight(contentbg[0]);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}, 250);
|
|
|
|
}, 250);
|
|
|
|
this.renderPage();
|
|
|
|
this.renderPage();
|
|
|
|