Skip to content

Commit

Permalink
n-stream layout restored
Browse files Browse the repository at this point in the history
  • Loading branch information
ferserc1 committed May 27, 2024
1 parent faeb8de commit 21144b3
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/css/VideoContainer.css
Original file line number Diff line number Diff line change
Expand Up @@ -233,4 +233,8 @@
color: var(--main-fg-color);
height: 40px;
line-height: 40px;
}

.video-container .landscape-container {
gap: 7px;
}
12 changes: 12 additions & 0 deletions src/js/core/VideoContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,8 @@ async function updateLayoutDynamic() {

hideAllVideoPlayers.apply(this);

const alignGrid = layoutStructure.alignType === "grid";

this.baseVideoRect.style.width = "";
this.baseVideoRect.style.height = "";
this.baseVideoRect.style.display = "flex";
Expand Down Expand Up @@ -255,8 +257,18 @@ async function updateLayoutDynamic() {
if (isLandscape) {
const landscapeContainer = createElementWithHtmlText(`<div class="landscape-container"></div>`, this.baseVideoRect);
canvasElements.forEach(e => landscapeContainer.appendChild(e));
if (alignGrid) {
const columns = layoutStructure?.videos?.length / 2;
landscapeContainer.style.display = "grid";
landscapeContainer.style.gridTemplateColumns = `repeat(${columns}, 1fr)`;
}
}
else {
if (alignGrid) {
const columns = layoutStructure?.videos?.length / 3;
this.baseVideoRect.style.display = "grid";
this.baseVideoRect.style.gridTemplateColumns = `repeat(${columns}, 1fr)`;
}
canvasElements.forEach(e => this.baseVideoRect.appendChild(e));
}
setTimeout(() => {
Expand Down

0 comments on commit 21144b3

Please sign in to comment.