Hide share button on browsers that lack getDisplayMedia

Mobile browsers typically don't support screen sharing. Hide the
start-sharing button entirely when navigator.mediaDevices.getDisplayMedia
is not available.

https://claude.ai/code/session_01ALSwS4S8EHiP81i2KMsb9Y
This commit is contained in:
Claude 2026-02-09 09:33:48 +00:00
parent 6ca45de838
commit 9bfb66de86
No known key found for this signature in database

View file

@ -1004,8 +1004,9 @@
// Update peer count // Update peer count
peerCount.textContent = state.peers.size; peerCount.textContent = state.peers.size;
// Update sharing buttons // Update sharing buttons (hide entirely if browser lacks getDisplayMedia)
startShareBtn.classList.toggle('hidden', state.isSharing); const canShare = !!navigator.mediaDevices?.getDisplayMedia;
startShareBtn.classList.toggle('hidden', state.isSharing || !canShare);
stopShareBtn.classList.toggle('hidden', !state.isSharing); stopShareBtn.classList.toggle('hidden', !state.isSharing);
// Update screen list // Update screen list