From 3d807677a728e024cde52b9676c326f8d3fba788 Mon Sep 17 00:00:00 2001 From: Juliusz Chroboczek Date: Thu, 19 May 2022 13:24:44 +0200 Subject: [PATCH] Make warning against Safari screensharing stronger. --- static/galene.js | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/static/galene.js b/static/galene.js index 77e1548..e9258bc 100644 --- a/static/galene.js +++ b/static/galene.js @@ -1418,6 +1418,20 @@ async function addLocalMedia(localId) { let safariScreenshareDone = false; async function addShareMedia() { + if(!safariScreenshareDone) { + if(isSafari()) { + let ok = confirm( + 'Screen sharing in Safari is very broken. ' + + 'It will work at first, ' + + 'but then your video will randomly freeze. ' + + 'Are you sure that you wish to enable screensharing?' + ); + if(!ok) + return + } + safariScreenshareDone = true; + } + /** @type {MediaStream} */ let stream = null; try { @@ -1433,13 +1447,6 @@ async function addShareMedia() { return; } - if(!safariScreenshareDone) { - if(isSafari()) - displayWarning('Screen sharing under Safari is experimental. ' + - 'Please use a different browser if possible.'); - safariScreenshareDone = true; - } - let c = newUpStream(); c.label = 'screenshare'; setUpStream(c, stream);