Add audioBitrate option for publishAudioTrack. (#124)

This commit is contained in:
CloudWebRTC
2022-06-06 10:37:24 +08:00
committed by GitHub
parent 9ed0c534be
commit f092e2eecd
2 changed files with 14 additions and 0 deletions
+4
View File
@@ -64,6 +64,10 @@ class LocalParticipant extends Participant<LocalTrackPublication> {
final transceiverInit = rtc.RTCRtpTransceiverInit(
direction: rtc.TransceiverDirection.SendOnly,
sendEncodings: [
if (publishOptions.audioBitrate > 0)
rtc.RTCRtpEncoding(maxBitrate: publishOptions.audioBitrate),
],
);
// addTransceiver cannot pass in a kind parameter due to a bug in flutter-webrtc (web)
track.transceiver = await room.engine.publisher?.pc.addTransceiver(