Skip to content

Commit

Permalink
if publishOptions.videoEncoding is not specified, use the default enc…
Browse files Browse the repository at this point in the history
…oding
  • Loading branch information
cloudwebrtc committed Aug 8, 2024
1 parent 5387d76 commit 0321677
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
15 changes: 15 additions & 0 deletions lib/src/participant/local.dart
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,21 @@ class LocalParticipant extends Participant<LocalTrackPublication> {
publishOptions ??=
track.lastPublishOptions ?? room.roomOptions.defaultVideoPublishOptions;

// if no encoding is specified, use the default encoding
if (publishOptions.videoEncoding == null) {
if (track.source == TrackSource.camera) {
publishOptions = publishOptions.copyWith(
videoEncoding:
room.roomOptions.defaultCameraCaptureOptions.params.encoding,
);
} else if (track.source == TrackSource.screenShareVideo) {
publishOptions = publishOptions.copyWith(
videoEncoding:
room.roomOptions.defaultScreenShareCaptureOptions.params.encoding,
);
}
}

if (publishOptions.videoCodec.toLowerCase() != publishOptions.videoCodec) {
publishOptions = publishOptions.copyWith(
videoCodec: publishOptions.videoCodec.toLowerCase(),
Expand Down
2 changes: 1 addition & 1 deletion lib/src/widgets/screen_select_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ class ScreenSelectDialog extends Dialog {
),
SizedBox(
width: double.infinity,
child: ButtonBar(
child: OverflowBar(
children: <Widget>[
MaterialButton(
child: const Text(
Expand Down

0 comments on commit 0321677

Please sign in to comment.