只显示一个摄像头,并自动切换到已开启用户,与共享屏幕顶部对齐

This commit is contained in:
cxc
2022-06-02 00:24:31 +08:00
parent bb44994439
commit b4deb0e053

View File

@ -297,6 +297,9 @@ const switchToVideoOn = () => {
const nextBtn = document.querySelector( const nextBtn = document.querySelector(
"#suspension-view-tabpanel-ribbon>div>div:last-child>.zmwebsdk-MuiBox-root>button:last-child" "#suspension-view-tabpanel-ribbon>div>div:last-child>.zmwebsdk-MuiBox-root>button:last-child"
); );
if (!prevBtn || !nextBtn) {
return;
}
let isNextBtnHidden = nextBtn.className.includes( let isNextBtnHidden = nextBtn.className.includes(
"zmwebsdk-makeStyles-hidePaginationIcon" "zmwebsdk-makeStyles-hidePaginationIcon"
); );
@ -333,7 +336,7 @@ const switchToVideoOn = () => {
clearInterval(timer); clearInterval(timer);
} }
}, 100); }, 100);
console.log(isNextBtnHidden); // console.log(isNextBtnHidden);
}; };
const inSharing = ref(false); // 共享屏幕是否开启 const inSharing = ref(false); // 共享屏幕是否开启
@ -369,8 +372,20 @@ setInterval(() => {
// attendeeslist.value.splice(0, attendeeslist.value.length); // attendeeslist.value.splice(0, attendeeslist.value.length);
attendeeslist.value = meetingConfig.client attendeeslist.value = meetingConfig.client
.getAttendeeslist() .getAttendeeslist()
.map((el) => JSON.stringify(el)) .map((el) => JSON.stringify({ userId: el.userId, bVideoOn: el.bVideoOn }))
.join("$"); .join("$");
// 检测共享屏幕canvas距离父元素顶部距离
// const shareScreenWrapEl =
const shareScreenCanvasEl = document.querySelector(
'div[id*="suspension-view-tabpanel"]>.zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root>div[class*="inSharing"]>div:first-child'
);
// console.log(shareScreenCanvasEl);
if (shareScreenCanvasEl) {
document.querySelector(
`div[id*="suspension-view-tabpanel"] > .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root > div[class*="inSharing"] + div`
).style.top = `${shareScreenCanvasEl.offsetTop}px`;
}
}, 500); }, 500);
// 监听共享屏幕状态 // 监听共享屏幕状态
@ -378,26 +393,19 @@ watch(inSharing, (val) => {
console.log(val); console.log(val);
if (val) { if (val) {
// setLayout(templateId.value); // setLayout(templateId.value);
makeVideoTop(); // makeVideoTop();
} else { } else {
const galleryViewButton = document.querySelector( const galleryViewButton = document.querySelector(
"#suspension-view-tab-thumbnail-gallery" "#suspension-view-tab-thumbnail-gallery"
); );
if (galleryViewButton) galleryViewButton.click(); if (galleryViewButton) galleryViewButton.click();
// const videoScreenWrapEl = document.querySelectorAll(
// ".zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root"
// )[2];
// if (!videoScreenWrapEl) return;
// const videoWrapEl = videoScreenWrapEl.lastChild;
// videoWrapEl.style.width = "";
// videoScreenWrapEl.style.flexDirection = "";
} }
}); });
watch(attendeeslist, (val) => { watch(attendeeslist, (val) => {
console.log(val); console.log(val);
if (inSharing.value) { if (inSharing.value) {
// switchToVideoOn(); switchToVideoOn();
} }
}); });
@ -412,11 +420,8 @@ const setFullScreen = async () => {
.forEach((el) => { .forEach((el) => {
el.setAttribute( el.setAttribute(
`style`, `style`,
`height: ${screen.height - screen.width * 0.08 - 42}px !important` `height: ${screen.height - screen.width * 0.08}px !important`
); );
// el.style.height = `${
// screen.height - screen.width * 0.08 - 42
// }px !important;`;
}); });
}; };
// 是否显示考试和问卷弹窗 // 是否显示考试和问卷弹窗
@ -662,11 +667,6 @@ $meetingComponentHeight: $meetingComponentWitdh * 9 / 16;
right: 0; right: 0;
bottom: 0; bottom: 0;
} }
// #video-element {
// width: $videoELementWidth;
// height: $videoElementHeight;
// background-color: indianred;
// }
:deep(.text-tag) { :deep(.text-tag) {
position: absolute; position: absolute;
z-index: 999; z-index: 999;
@ -686,11 +686,7 @@ $meetingComponentHeight: $meetingComponentWitdh * 9 / 16;
} }
.layout-template-1 { .layout-template-1 {
:deep(#suspension-view-tabpanel-ribbon :deep(div[id*="suspension-view-tabpanel"]
> .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root
> div[class*="inSharing"]
+ div),
:deep(#suspension-view-tabpanel-speaker
> .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root > .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root
> div[class*="inSharing"] > div[class*="inSharing"]
+ div) { + div) {
@ -698,11 +694,7 @@ $meetingComponentHeight: $meetingComponentWitdh * 9 / 16;
} }
} }
.layout-template-2 { .layout-template-2 {
:deep(#suspension-view-tabpanel-ribbon :deep(div[id*="suspension-view-tabpanel"]
> .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root
> div[class*="inSharing"]
+ div),
:deep(#suspension-view-tabpanel-speaker
> .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root > .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root
> div[class*="inSharing"] > div[class*="inSharing"]
+ div) { + div) {
@ -717,31 +709,25 @@ $meetingComponentHeight: $meetingComponentWitdh * 9 / 16;
} }
.layout-template-3 { .layout-template-3 {
:deep(#suspension-view-tabpanel-ribbon :deep(div[id*="suspension-view-tabpanel"]
> .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root
> div[class*="inSharing"]
+ div),
:deep(#suspension-view-tabpanel-speaker
> .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root > .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root
> div[class*="inSharing"] > div[class*="inSharing"]
+ div) { + div) {
width: $meetingComponentWitdh * 0.2; width: $meetingComponentWitdh * 0.2;
height: $meetingComponentWitdh * 0.2 * 9 / 16; height: $meetingComponentWitdh * 0.2 * 9 / 16;
align-self: center; position: relative;
// align-self: center;
} }
} }
.layout-template-4 { .layout-template-4 {
:deep(#suspension-view-tabpanel-ribbon :deep(div[id*="suspension-view-tabpanel"]
> .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root
> div[class*="inSharing"]
+ div),
:deep(#suspension-view-tabpanel-speaker
> .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root > .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root
> div[class*="inSharing"] > div[class*="inSharing"]
+ div) { + div) {
width: $meetingComponentWitdh * 0.2; width: $meetingComponentWitdh * 0.2;
height: $meetingComponentWitdh * 0.2 * 9 / 16; height: $meetingComponentWitdh * 0.2 * 9 / 16;
align-self: center; position: relative;
// align-self: center;
} }
:deep(#suspension-view-tabpanel-ribbon :deep(#suspension-view-tabpanel-ribbon
> .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root), > .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root),
@ -770,11 +756,7 @@ $meetingComponentHeight: $meetingComponentWitdh * 9 / 16;
width: 270px; width: 270px;
background: #ccc; background: #ccc;
} }
:deep(#suspension-view-tabpanel-ribbon :deep(div[id*="suspension-view-tabpanel"]
> .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root),
:deep(#suspension-view-tabpanel-gallery
> .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root),
:deep(#suspension-view-tabpanel-speaker
> .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root) { > .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root) {
height: calc(80vw * 0.9 * 9 / 16); height: calc(80vw * 0.9 * 9 / 16);
} }
@ -784,6 +766,7 @@ $meetingComponentHeight: $meetingComponentWitdh * 9 / 16;
box-shadow: 0 0; box-shadow: 0 0;
} }
// 适配移动端 屏幕宽度小于 900px
@media screen and (max-width: 900px) { @media screen and (max-width: 900px) {
$meetingComponentWitdh: 100vw * 0.9; $meetingComponentWitdh: 100vw * 0.9;
$meetingComponentHeight: $meetingComponentWitdh * 9 / 16; $meetingComponentHeight: $meetingComponentWitdh * 9 / 16;
@ -799,21 +782,13 @@ $meetingComponentHeight: $meetingComponentWitdh * 9 / 16;
> .zmwebsdk-MuiPaper-root:nth-child(1)) { > .zmwebsdk-MuiPaper-root:nth-child(1)) {
width: $meetingComponentWitdh !important; width: $meetingComponentWitdh !important;
} }
:deep(#suspension-view-tabpanel-ribbon :deep(div[id="suspension-view-tabpanel"]
> .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root),
:deep(#suspension-view-tabpanel-gallery
> .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root),
:deep(#suspension-view-tabpanel-speaker
> .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root) { > .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root) {
height: calc(100vw * 0.9 * 9 / 16) !important; height: calc(100vw * 0.9 * 9 / 16) !important;
} }
.layout-template-1 { .layout-template-1 {
:deep(#suspension-view-tabpanel-ribbon :deep(div[id*="suspension-view-tabpanel"]
> .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root
> div[class*="inSharing"]
+ div),
:deep(#suspension-view-tabpanel-speaker
> .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root > .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root
> div[class*="inSharing"] > div[class*="inSharing"]
+ div) { + div) {
@ -823,11 +798,7 @@ $meetingComponentHeight: $meetingComponentWitdh * 9 / 16;
} }
} }
.layout-template-2 { .layout-template-2 {
:deep(#suspension-view-tabpanel-ribbon :deep(div[id*="suspension-view-tabpanel"]
> .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root
> div[class*="inSharing"]
+ div),
:deep(#suspension-view-tabpanel-speaker
> .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root > .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root
> div[class*="inSharing"] > div[class*="inSharing"]
+ div) { + div) {
@ -837,35 +808,30 @@ $meetingComponentHeight: $meetingComponentWitdh * 9 / 16;
} }
} }
.layout-template-3 { .layout-template-3 {
:deep(#suspension-view-tabpanel-ribbon :deep(div[id*="suspension-view-tabpanel"]
> .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root
> div[class*="inSharing"]
+ div),
:deep(#suspension-view-tabpanel-speaker
> .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root > .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root
> div[class*="inSharing"] > div[class*="inSharing"]
+ div) { + div) {
width: $meetingComponentWitdh * 0.2; width: $meetingComponentWitdh * 0.2;
height: $meetingComponentWitdh * 0.2 * 9 / 14; height: $meetingComponentWitdh * 0.2 * 9 / 14;
align-self: center; position: relative;
// align-self: center;
} }
} }
.layout-template-4 { .layout-template-4 {
:deep(#suspension-view-tabpanel-ribbon :deep(div[id*="suspension-view-tabpanel"]
> .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root
> div[class*="inSharing"]
+ div),
:deep(#suspension-view-tabpanel-speaker
> .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root > .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root
> div[class*="inSharing"] > div[class*="inSharing"]
+ div) { + div) {
width: $meetingComponentWitdh * 0.2; width: $meetingComponentWitdh * 0.2;
height: $meetingComponentWitdh * 0.2 * 9 / 14; height: $meetingComponentWitdh * 0.2 * 9 / 14;
align-self: center; position: relative;
// align-self: center;
} }
} }
} }
// 全屏样式
#meeting-container.fullscreen { #meeting-container.fullscreen {
$meetingComponentWitdh: 100vw * 0.9; $meetingComponentWitdh: 100vw * 0.9;
$meetingComponentHeight: $meetingComponentWitdh * 9 / 16; $meetingComponentHeight: $meetingComponentWitdh * 9 / 16;
@ -873,11 +839,7 @@ $meetingComponentHeight: $meetingComponentWitdh * 9 / 16;
width: 100vw !important; width: 100vw !important;
.layout-template-1 { .layout-template-1 {
:deep(#suspension-view-tabpanel-ribbon :deep(div[id*="suspension-view-tabpanel"]
> .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root
> div[class*="inSharing"]
+ div),
:deep(#suspension-view-tabpanel-speaker
> .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root > .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root
> div[class*="inSharing"] > div[class*="inSharing"]
+ div) { + div) {
@ -885,65 +847,36 @@ $meetingComponentHeight: $meetingComponentWitdh * 9 / 16;
} }
} }
.layout-template-2 { .layout-template-2 {
:deep(#suspension-view-tabpanel-ribbon :deep(div[id*="suspension-view-tabpanel"]
> .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root
> div[class*="inSharing"]
+ div),
:deep(#suspension-view-tabpanel-speaker
> .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root > .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root
> div[class*="inSharing"] > div[class*="inSharing"]
+ div) { + div) {
width: $meetingComponentWitdh * 0.5; width: $meetingComponentWitdh * 0.5;
} }
:deep(#suspension-view-tabpanel-ribbon
> .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root),
:deep(#suspension-view-tabpanel-speaker
> .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root) {
flex-direction: row-reverse;
}
} }
.layout-template-3 { .layout-template-3 {
:deep(#suspension-view-tabpanel-ribbon :deep(div[id*="suspension-view-tabpanel"]
> .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root
> div[class*="inSharing"]
+ div),
:deep(#suspension-view-tabpanel-speaker
> .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root > .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root
> div[class*="inSharing"] > div[class*="inSharing"]
+ div) { + div) {
width: $meetingComponentWitdh * 0.2; width: $meetingComponentWitdh * 0.2;
height: $meetingComponentWitdh * 0.2 * 9 / 16; height: $meetingComponentWitdh * 0.2 * 9 / 16;
align-self: center; position: relative;
// align-self: center;
} }
} }
.layout-template-4 { .layout-template-4 {
:deep(#suspension-view-tabpanel-ribbon :deep(div[id*="suspension-view-tabpanel"]
> .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root
> div[class*="inSharing"]
+ div),
:deep(#suspension-view-tabpanel-speaker
> .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root > .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root
> div[class*="inSharing"] > div[class*="inSharing"]
+ div) { + div) {
width: $meetingComponentWitdh * 0.2; width: $meetingComponentWitdh * 0.2;
height: $meetingComponentWitdh * 0.2 * 9 / 16; height: $meetingComponentWitdh * 0.2 * 9 / 16;
align-self: center; position: relative;
} // align-self: center;
:deep(#suspension-view-tabpanel-ribbon
> .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root),
:deep(#suspension-view-tabpanel-speaker
> .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root) {
flex-direction: row-reverse;
} }
} }
:deep(.zmwebsdk-MuiToolbar-root.zmwebsdk-MuiToolbar-regular) {
display: none; // 隐藏顶部 toolbar
}
:deep(div[class*="zmwebsdk-makeStyles-singleView"]) {
padding: 0; // 去掉会议组件边距
}
:deep(#video-element :deep(#video-element
> div > div
> .zmwebsdk-MuiPaper-root > .zmwebsdk-MuiPaper-root
@ -954,14 +887,9 @@ $meetingComponentHeight: $meetingComponentWitdh * 9 / 16;
> div > div
> .zmwebsdk-MuiPaper-root > .zmwebsdk-MuiPaper-root
> .zmwebsdk-MuiPaper-root:nth-child(2)) { > .zmwebsdk-MuiPaper-root:nth-child(2)) {
width: 270px; display: none;
background: #ccc;
} }
:deep(#suspension-view-tabpanel-ribbon :deep(div[id*="suspension-view-tabpanel"]
> .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root),
:deep(#suspension-view-tabpanel-gallery
> .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root),
:deep(#suspension-view-tabpanel-speaker
> .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root) { > .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root) {
height: calc(100vw * 0.9 * 9 / 16); height: calc(100vw * 0.9 * 9 / 16);
} }