From 96c3e4f830bfc21e7f437e32c42aa84e108ce383 Mon Sep 17 00:00:00 2001 From: Juliusz Chroboczek Date: Sat, 31 Oct 2020 22:31:14 +0100 Subject: [PATCH] Add warning about screen sharing under Safari. --- static/sfu.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/static/sfu.js b/static/sfu.js index ec9702a..741a6cb 100644 --- a/static/sfu.js +++ b/static/sfu.js @@ -818,6 +818,8 @@ async function addLocalMedia(id) { setButtonsVisibility(); } +let safariWarningDone = false; + async function addShareMedia() { if(!getUserPass()) return; @@ -835,6 +837,15 @@ async function addShareMedia() { return; } + if(!safariWarningDone) { + let ua = navigator.userAgent.toLowerCase(); + if(ua.indexOf('safari') >= 0 && ua.indexOf('chrome') < 0) { + displayWarning('Screen sharing under Safari is experimental. ' + + 'Please use a different browser if possible.'); + } + safariWarningDone = true; + } + let c = newUpStream(); c.kind = 'screenshare'; c.stream = stream;