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

Commit

Permalink
Add the rest of the browsers supported codecs after setting the prefe…
Browse files Browse the repository at this point in the history
…rred codec (#83) (#84)

Co-authored-by: William Belcher <william.belcher@xa.epicgames.com>
  • Loading branch information
lukehb and Belchy06 authored Feb 9, 2023
1 parent d010d83 commit 239e7fb
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 8 deletions.
4 changes: 2 additions & 2 deletions Frontend/implementations/EpicGames/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions Frontend/library/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -343,11 +343,27 @@ export class PeerConnectionController {
sdpFmtpLine: preferredRTPCodec[1] /* sdpFmtpLine */ ? preferredRTPCodec[1] : ''
}];

if(codecs[0].sdpFmtpLine === '') {
// We can't dynamically add members to the codec, so instead remove the field if it's empty
delete codecs[0].sdpFmtpLine;
this.config.getSettingOption(OptionParameters.PreferredCodec).options
.filter((option) => {
// Remove the preferred codec from the list of possible codecs as we've set it already
return option != this.preferredCodec;
}).forEach((option) => {
// Ammend the rest of the browsers supported codecs
const altCodec = option.split(" ");
codecs.push({
mimeType: 'video/' + altCodec[0] /* Name */,
clockRate: 90000,
sdpFmtpLine: altCodec[1] /* sdpFmtpLine */ ? altCodec[1] : ''
})
})

for(const codec of codecs) {
if(codec.sdpFmtpLine === '') {
// We can't dynamically add members to the codec, so instead remove the field if it's empty
delete codec.sdpFmtpLine;
}
}

transceiver.setCodecPreferences(codecs);
}
}
Expand Down

0 comments on commit 239e7fb

Please sign in to comment.