Fix: clamp native tile height so shared screen never covers the controls

The CSS-only stage sizing wasn't enough — the shared screen still overlapped
the meeting controls. Since the native video is drawn ON TOP of the WebView,
now clamp each tile's height in bzNativeSyncTiles so it can never extend past
the top of the .meet-bar (control bar) — regardless of how the web lays out
the stage. Robust and web-only.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-08-07 10:51:32 +05:30
parent b35c95a5be
commit 5a140e45a1
+11 -1
View File
@@ -5391,14 +5391,24 @@ function bzNativeSyncTiles(){
if(!meetNative) return;
const NC=nativeCallPlugin(); if(!NC||!NC.syncVideoTiles) return;
const tiles=[];
// Native views draw ON TOP of the WebView, so a full-height tile would cover the control bar. Never let a
// tile's native video extend past the top of the meeting controls (or, in normal grid mode, below the grid).
const bar=document.querySelector('#meetGrid ~ .meet-bar') || document.querySelector('.meet-bar');
const gridEl=document.getElementById('meetGrid');
let maxBottom=Infinity;
if(bar){ const br=bar.getBoundingClientRect(); if(br.height>0) maxBottom=br.top; }
else if(gridEl){ const gr=gridEl.getBoundingClientRect(); if(gr.height>0) maxBottom=gr.bottom; }
document.querySelectorAll('#meetGrid .meet-tile').forEach(el=>{
const id=el.id ? el.id.replace('meet-tile-','') : ''; if(!id || id==='__waiting') return;
const r=el.getBoundingClientRect(); if(r.width<2||r.height<2) return;
let h=r.height;
if(r.top < maxBottom && (r.top + h) > maxBottom) h = maxBottom - r.top; // clamp so it never covers the controls
if(h<2) return;
let uid, local=false, name='', muted=false, screen=false;
if(id==='__local'){ uid=(ME&&ME.id)||''; local=true; name=(ME&&ME.name)||'You'; muted=!meetMic; }
else { uid=meetPeerUids.get(id)||''; name=meetNames.get(id)||'Guest'; muted=!!meetMuted.get(id); screen=meetSharers.has(id); } // sharer's tile → render their screen, not camera
if(!uid) return;
tiles.push({ uid, local, name, muted, screen, x:r.left, y:r.top, w:r.width, h:r.height });
tiles.push({ uid, local, name, muted, screen, x:r.left, y:r.top, w:r.width, h });
});
try{ NC.syncVideoTiles({ tiles }); }catch(_){}
}