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

Add the rest of the browsers supported codecs after setting the preferred codec (#83) #84

Merged
merged 1 commit into from
Feb 9, 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
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