From b88e2f4d9371b414f493c179322e86ae126985f7 Mon Sep 17 00:00:00 2001 From: Juliusz Chroboczek Date: Wed, 30 Jul 2025 14:18:44 +0200 Subject: [PATCH] Implement /sharescreen. Also rename /stopshare to /unsharescreen. --- static/galene.js | 11 ++++++++++- static/protocol.js | 1 + 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/static/galene.js b/static/galene.js index f1e995b..b81525a 100644 --- a/static/galene.js +++ b/static/galene.js @@ -1030,6 +1030,8 @@ async function setMediaChoices(done) { * @param {string} [localId] */ function newUpStream(localId) { + if(!serverConnection) + throw new Error("Not connected"); let c = serverConnection.newUpStream(localId); c.onstatus = function(status) { setMediaStatus(c); @@ -3796,7 +3798,14 @@ commands.replace = { } }; -commands.stopshare = { +commands.sharescreen = { + description: 'start a screen share', + f: (c, r) => { + addShareMedia(); + } +} + +commands.unsharescreen = { description: 'stop screen share', f: (c, r) => { closeUpMedia('screenshare'); diff --git a/static/protocol.js b/static/protocol.js index eff16d0..a40fb19 100644 --- a/static/protocol.js +++ b/static/protocol.js @@ -1499,6 +1499,7 @@ Stream.prototype.updateStats = async function() { if(report) { for(let r of report.values()) { if(stid && r.type === 'outbound-rtp') { + console.log(r); let id = stid; // Firefox doesn't implement rid, use ssrc // to discriminate simulcast tracks.