Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Jitsi Meet startWithAudioMuted/startWithVideoMuted temporary fix
# …
# Allow access to /etc/jitsi/meet/start_muted.html
<Directory "/etc/jitsi/meet">
<FilesMatch "start_muted.html">
Require all granted
</FilesMatch>
</Directory>
RewriteEngine on
# Rewrite all room URLs that don't contain a query parameter named 'start_muted_fix'
RewriteCond %{QUERY_STRING} !start_muted_fix
RewriteRule ^/([a-zA-Z0-9]+)$ /etc/jitsi/meet/start_muted.html [L]
RewriteRule ^/([a-zA-Z0-9]+)$ /index.html
# …
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<script>
const url = new URL(window.location.href);
const extraHash = 'config.startWithAudioMuted=true&config.startWithVideoMuted=true';
const extraQueryParam = 'start_muted_fix';
url.search = url.search == '' ? '?' + extraQueryParam : url.search + '&' + extraQueryParam;
url.hash = url.hash == '' ? '#' + extraHash : url.hash + '&' + extraHash;
window.location.replace(url.toString());
</script>
</body>
</html>
@cketti

This comment has been minimized.

Copy link
Owner Author

@cketti cketti commented Jan 27, 2021

Work-around for the following bug in Jitsi Meet: jitsi/jitsi-meet#8144

  1. Save start_muted.html as /etc/jitsi/meet/start_muted.html
  2. Edit the Apache config for the Jitsi virtual host to include the contents of jitsi-meet-apache.conf
  3. Reload Apache
@agross

This comment has been minimized.

Copy link

@agross agross commented Feb 15, 2021

For docker-based setups the following seems to work.

${CONFIG}/web/nginx/meet.config

--- meet-orig.conf      2021-02-16 00:12:40.195587205 +0100
+++ meet.conf   2021-02-16 00:06:59.231998470 +0100
@@ -66,6 +66,18 @@
     tcp_nodelay on;
 }

+location = /start_muted.html {
+    alias /config/start_muted.html;
+}
+
+location ~ ^/([a-zA-Z0-9-]+)$ {
+    if ($arg_start_muted_fix = '') {
+        rewrite ^/(.*)$ /start_muted.html last;
+    }
+
+    try_files $uri @root_path;
+}
+
 location ~ ^/([^/?&:'"]+)$ {
     try_files $uri @root_path;
 }

I placed start_muted.html in ${CONFIG}/web and needed to add a value to start_muted_fix to make the if above work.

-- start_muted-orig.html        2021-02-16 00:10:43.466935109 +0100
+++ start_muted.html    2021-02-15 23:48:25.304599530 +0100
@@ -8,7 +8,7 @@
       const url = new URL(window.location.href);

       const extraHash = 'config.startWithAudioMuted=true&config.startWithVideoMuted=true';
-      const extraQueryParam = 'start_muted_fix';
+      const extraQueryParam = 'start_muted_fix=42';

       url.search = url.search == '' ? '?' +  extraQueryParam : url.search + '&' + extraQueryParam;
       url.hash = url.hash == '' ? '#' + extraHash : url.hash + '&' + extraHash;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment