zebra-spaces: log clicks on share/stop buttons + their state

Diagnostic-only: logLine fires on every share/stop button click with
the current sfuXPC/sfuXStream truthiness so the telemetry channel
shows whether (a) the click reached the JS at all, (b) the unpublish
function bailed at its 'nothing to do' early return, or (c) it
actually entered the close path. Helps diagnose the 'stop sharing
doesn't work' report without copy-pasting.
This commit is contained in:
Russell Ballestrini 2026-06-03 11:19:04 -04:00
parent ce6242fff7
commit 27fea30680
No known key found for this signature in database

View file

@ -3470,10 +3470,19 @@ function renderRoom(){
* ================================================================== */
$('btn-raise').addEventListener('click', () => { send({ type:'raise-hand' }); });
$('btn-lower').addEventListener('click', () => { send({ type:'lower-hand' }); });
$('btn-screen-share').addEventListener('click', () => { sfuPublishScreen().catch(e => logLine('err','screen share: '+e.message)); });
$('btn-screen-stop').addEventListener('click', () => { sfuUnpublishScreen(); });
$('btn-camera-share').addEventListener('click', () => { sfuPublishCamera().catch(e => logLine('err','camera share: '+e.message)); });
$('btn-camera-stop').addEventListener('click', () => { sfuUnpublishCamera(); });
$('btn-screen-share').addEventListener('click', () => { logLine('', 'click: btn-screen-share'); sfuPublishScreen().catch(e => logLine('err','screen share: '+e.message)); });
$('btn-screen-stop').addEventListener('click', () => {
/* click telemetry — the 'screen share stopped' line lower in
* sfuUnpublishScreen only fires AFTER the early-return, so logging
* here lets us see whether the click reached the handler at all. */
logLine('', 'click: btn-screen-stop (sfuScreenPC='+(!!sfuScreenPC)+' sfuScreenStream='+(!!sfuScreenStream)+')');
sfuUnpublishScreen();
});
$('btn-camera-share').addEventListener('click', () => { logLine('', 'click: btn-camera-share'); sfuPublishCamera().catch(e => logLine('err','camera share: '+e.message)); });
$('btn-camera-stop').addEventListener('click', () => {
logLine('', 'click: btn-camera-stop (sfuCameraPC='+(!!sfuCameraPC)+' sfuCameraStream='+(!!sfuCameraStream)+')');
sfuUnpublishCamera();
});
$('camera-select').addEventListener('change', async (e) => {
cameraDeviceId = e.target.value;
try { localStorage.setItem(CAM_DEV_KEY, cameraDeviceId); } catch(_){}
@ -3880,8 +3889,8 @@ logLine('', 'ready — pick a handle, type a rendezvous code, enter the space');
<footer style="margin:2.2rem auto 0;font-size:0.65rem;color:#999;line-height:1.7;word-break:break-all;font-family:monospace">
<span id="pi-seal" style="color:#777;cursor:default;user-select:none" title="">page integrity</span> &nbsp;·&nbsp; built <span class="stamp-date">2026-06-03</span><br>
md5 <span class="stamp-md5">ab5aa8608600fdb0053316b3480fb052</span><br>
sha256 <span class="stamp-sha">59e42360b6165481c9d4151d40206a03fe2086edf6637945af051704bed7bc75</span><br>
md5 <span class="stamp-md5">e5d7d386ae1ed988094498aa9e352e29</span><br>
sha256 <span class="stamp-sha">260d3562b39b72d508f00041f6e3dc9772a2fc747fc3e585c302c89c79140d9d</span><br>
<span style="color:#bbb">hashes are of this page with these two fields zeroed — to verify, blank them and re-hash</span><br>
<span style="color:#bbb">one self-contained file — <strong>save a copy</strong> and verify against these hashes; point at your own servers with ?signal= and ?turncred=, or <a href="host-your-own.html" style="color:#999">host your own community</a></span>
</footer>