Skip to content

Commit

Permalink
remove enableBackupCodec for VideoPublishOptions.
Browse files Browse the repository at this point in the history
  • Loading branch information
cloudwebrtc committed Dec 12, 2023
1 parent 7114399 commit e1be6af
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 13 deletions.
4 changes: 2 additions & 2 deletions example/lib/pages/connect.dart
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ class _ConnectPageState extends State<ConnectPage> {
preferredCodec = _preferredCodec;
}

bool enableBackUpCodec = ['VP9', 'AV1'].contains(preferredCodec);
bool enableBackupVideoCodec = ['VP9', 'AV1'].contains(preferredCodec);

// create new room
final room = Room(
Expand All @@ -155,7 +155,7 @@ class _ConnectPageState extends State<ConnectPage> {
defaultVideoPublishOptions: VideoPublishOptions(
simulcast: _simulcast,
videoCodec: preferredCodec,
enableBackupCodec: enableBackUpCodec,
backupVideoCodec: enableBackupVideoCodec ? BackupVideoCodec() : null,
),
defaultScreenShareCaptureOptions: const ScreenShareCaptureOptions(
useiOSBroadcastExtension: true,
Expand Down
5 changes: 0 additions & 5 deletions lib/src/options.dart
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,6 @@ class VideoPublishOptions {

final String? scalabilityMode;

final bool enableBackupCodec;

final BackupVideoCodec? backupVideoCodec;

const VideoPublishOptions({
Expand All @@ -212,7 +210,6 @@ class VideoPublishOptions {
this.videoSimulcastLayers = const [],
this.screenShareSimulcastLayers = const [],
this.name,
this.enableBackupCodec = true,
this.backupVideoCodec,
this.scalabilityMode,
});
Expand All @@ -223,7 +220,6 @@ class VideoPublishOptions {
List<VideoParameters>? videoSimulcastLayers,
List<VideoParameters>? screenShareSimulcastLayers,
String? videoCodec,
bool? enableBackupCodec,
BackupVideoCodec? backupVideoCodec,
String? scalabilityMode,
}) =>
Expand All @@ -234,7 +230,6 @@ class VideoPublishOptions {
screenShareSimulcastLayers:
screenShareSimulcastLayers ?? this.screenShareSimulcastLayers,
videoCodec: videoCodec ?? this.videoCodec,
enableBackupCodec: enableBackupCodec ?? this.enableBackupCodec,
backupVideoCodec: backupVideoCodec ?? this.backupVideoCodec,
scalabilityMode: scalabilityMode ?? this.scalabilityMode,
);
Expand Down
7 changes: 1 addition & 6 deletions lib/src/participant/local.dart
Original file line number Diff line number Diff line change
Expand Up @@ -210,12 +210,7 @@ class LocalParticipant extends Participant<LocalTrackPublication> {
),
];

if (publishOptions.enableBackupCodec == true &&
publishOptions.backupVideoCodec == null) {
publishOptions.copyWith(backupVideoCodec: BackupVideoCodec());
}

if (publishOptions.enableBackupCodec == true &&
if (publishOptions.backupVideoCodec != null &&
publishOptions.backupVideoCodec!.codec != publishOptions.videoCodec) {
simulcastCodecs.add(lk_rtc.SimulcastCodec(
codec: publishOptions.backupVideoCodec!.codec.toLowerCase(),
Expand Down

0 comments on commit e1be6af

Please sign in to comment.