Stylish MediaMTX wrapper and chatbox with freehand drawings
| config | ||
| font | ||
| img | ||
| inc | ||
| sound | ||
| .gitignore | ||
| ___FALLBACK.jpg | ||
| base.js | ||
| checkAdmin.php | ||
| checkName.php | ||
| hsluv.min.js | ||
| markOnline.php | ||
| README.md | ||
| sendChatMessage.php | ||
| setStreamInfo.php | ||
| stream.js | ||
| streamInfo.php | ||
| streamList.php | ||
| watch.css | ||
| watch.php | ||
ikasti
ikasti is a stylish wrapper around a WebRTC-only MediaMTX installation, that adds basic stream management, viewer numbers and discovery, and rich chat with both messages and freehand drawings (à la PictoChat).
ikasti is a hobby project written in a "stream of consciousness" style and not meant as a production product, so please use it with caution. It may cast your lunch money into the deep sea, where it will be spent on colorful squid-shaped cushions.
Setup
- Make sure you have the PHP extensions
mbstringandyaml. - Make sure you already have a working, reachable MediaMTX WebRTC installation.
- Place ikasti somewhere where you are able to serve it.
- Move
/config/config.example.phpto/config/config.php. Seedefault-config.phpto see what you can change, but the most important ones aremediamtx_endpoint,mediamtx_configandstaff_key. - Set up nginx or whatever server you like. It should redirect requests like /beans/ to /watch.php?id=beans
Example
My MediaMTX setup lives in /var/mediamtx, and the ikasti setup lives in /var/mediamtx/viewer. MediaMTX is at mtx.ikg.sh, and ikasti at s.ikg.sh.
Here's my nginx setup to match it:
# mtx.ikg.sh -> mediamtx
server {
server_name mtx.ikg.sh;
listen 443 ssl;
ssl_certificate /etc/letsencrypt/live/ikg.sh/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/ikg.sh/privkey.pem;
location / {
proxy_pass http://127.0.0.1:24152/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto http;
proxy_set_header X-Nginx-Proxy true;
proxy_redirect off;
client_max_body_size 1G;
}
}
# s.ikg.sh
server {
listen 443 ssl;
root /var/mediamtx/viewer;
ssl_certificate /etc/letsencrypt/live/ikg.sh/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/ikg.sh/privkey.pem;
index index.php index.html;
server_name s.ikg.sh;
error_page 404 /___FALLBACK.jpg;
rewrite ^/streamshots/([^\/.]+)(\..+)?$ /snapshots/$1.jpg? last;
rewrite ^/([^\/.]+)/?$ /watch.php?id=$1? last;
location ~ /\. { internal; }
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php8.3-fpm.sock;
}
}