From 6a4784da44b0bf6d04dd8f3f12da77c2bc2ffb12 Mon Sep 17 00:00:00 2001 From: Juliusz Chroboczek Date: Wed, 23 Sep 2020 21:46:30 +0200 Subject: [PATCH] Hide share button if getDisplayMedia doesn't exist. --- static/sfu.css | 4 ---- static/sfu.js | 5 ++++- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/static/sfu.css b/static/sfu.css index 066af4e..e6b54ff 100644 --- a/static/sfu.css +++ b/static/sfu.css @@ -1013,10 +1013,6 @@ header .collapse { border-right: none; } - #sharebutton { - display: none; - } - .dropdown-content { margin-top: 10px; } diff --git a/static/sfu.js b/static/sfu.js index 33ec084..c93c5bd 100644 --- a/static/sfu.js +++ b/static/sfu.js @@ -376,11 +376,14 @@ function setButtonsVisibility() { let permissions = serverConnection.permissions; let local = !!findUpMedia('local'); let share = !!findUpMedia('screenshare') + // don't allow multiple presentations setVisibility('presentbutton', permissions.present && !local); setVisibility('unpresentbutton', local); + // allow multiple shared documents - setVisibility('sharebutton', permissions.present); + setVisibility('sharebutton', permissions.present && + ('getDisplayMedia' in navigator.mediaDevices)) setVisibility('unsharebutton', share); setVisibility('mediaoptions', permissions.present);