Skip to content
This repository has been archived by the owner on Mar 1, 2024. It is now read-only.

Indicate to the signalling server when the browser intends to send the offer #75

Merged
merged 2 commits into from
Feb 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Frontend/library/src/WebRtcPlayer/WebRtcPlayerController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -978,6 +978,11 @@ export class WebRtcPlayerController {
signallingServerUrl += '?' + Flags.PreferSFU + '=true';
}

// If we are sending the offer add a special url parameter to the url, making sure we append correctly
if (this.config.isFlagEnabled(Flags.BrowserSendOffer)) {
signallingServerUrl += (signallingServerUrl.includes('?') ? '&' : '?') + Flags.BrowserSendOffer + '=true';
}

return signallingServerUrl;
}

Expand Down
3 changes: 2 additions & 1 deletion SignallingWebServer/cirrus.js
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,7 @@ playerServer.on('connection', function (ws, req) {
const parsedUrl = url.parse(req.url);
const urlParams = new URLSearchParams(parsedUrl.search);
const preferSFU = urlParams.has('preferSFU') && urlParams.get('preferSFU') !== 'false';
const browserSendOffer = urlParams.has('OfferToReceive') && urlParams.get('OfferToReceive') !== 'false';
const skipSFU = !preferSFU;
const skipStreamer = preferSFU && sfu;

Expand Down Expand Up @@ -628,7 +629,7 @@ playerServer.on('connection', function (ws, req) {

ws.send(JSON.stringify(clientConfig));

sendMessageToController({ type: "playerConnected", playerId: playerId, dataChannel: true, sfu: false }, skipSFU, skipStreamer);
sendMessageToController({ type: "playerConnected", playerId: playerId, dataChannel: true, sfu: false, sendOffer: !browserSendOffer }, skipSFU, skipStreamer);
sendPlayersCount();
});

Expand Down