feat: add read-only mode to API and UI, disable write actions

This commit is contained in:
Sergey Krashevich
2026-02-01 04:13:43 +03:00
parent 6085c8aabe
commit cc453dd9ed
24 changed files with 438 additions and 8 deletions
+15
View File
@@ -152,6 +152,21 @@ Telegram: rtmps://xxx-x.rtmp.t.me/s/xxxxxxxxxx:xxxxxxxxxxxxxxxxxxxxxx</pre>
fetch(url, {method: 'POST'});
});
</script>
<script>
const applyReadOnly = () => {
const ids = ['play-send', 'play-url', 'pub-send', 'pub-url'];
ids.forEach(id => {
const el = document.getElementById(id);
if (el) el.disabled = true;
});
};
if (window.go2rtcReady) {
window.go2rtcReady.then(data => {
if (data && data.read_only) applyReadOnly();
});
}
</script>
<div id="webrtc">
<h2>WebRTC Magic</h2>