Skip to content

Commit

Permalink
Merge pull request #15 from Azure/khaines/chromium-fix-4.26
Browse files Browse the repository at this point in the history
Adding header fixes for chromium browsers when using Unreal 4.26
  • Loading branch information
microsoftman authored Nov 8, 2021
2 parents a15535b + 5ba05b5 commit 5cfc8d8
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,14 +118,17 @@
};

handleCreateOffer = function (pc) {
pc.createOffer(self.sdpConstraints).then(function (offer) {
pc.createOffer(self.sdpConstraints).then(function (offer) {
offer.sdp = offer.sdp.replace("useinbandfec=1", "useinbandfec=1;stereo=1;maxaveragebitrate=128000");
pc.setLocalDescription(offer);
if (self.onWebRtcOffer) {
// (andriy): increase start bitrate from 300 kbps to 20 mbps and max bitrate from 2.5 mbps to 100 mbps
// (100 mbps means we don't restrict encoder at all)
// after we `setLocalDescription` because other browsers are not c happy to see google-specific config
offer.sdp = offer.sdp.replace(/(a=fmtp:\d+ .*level-asymmetry-allowed=.*)\r\n/gm, "$1;x-google-start-bitrate=15000;x-google-max-bitrate=100000\r\n");
self.onWebRtcOffer(offer);
offer.sdp = offer.sdp.replace(/(a=fmtp:\d+ .*level-asymmetry-allowed=.*)\r\n/gm, "$1;x-google-start-bitrate=15000;x-google-max-bitrate=100000\r\n");
// a=extmap-allow-mixed is passed by default from Chrome 94 onwards, for Pixel Streaming pre 4.27 this must be stripped out as those versions use M70, which has no idea what extmap-allow-mixed means.
offer.sdp = offer.sdp.replace(/(a=extmap-allow-mixed)\r\n/gm, "");
self.onWebRtcOffer(offer);
}
},
function () { console.warn("Couldn't create offer") });
Expand Down

0 comments on commit 5cfc8d8

Please sign in to comment.