fix: Fix wrong override when options is not null when LocalTrack.create.
This commit is contained in:
@@ -99,7 +99,7 @@ class LocalAudioTrack extends LocalTrack
|
||||
static Future<LocalAudioTrack> create([
|
||||
AudioCaptureOptions? options,
|
||||
]) async {
|
||||
options = const AudioCaptureOptions();
|
||||
options ??= const AudioCaptureOptions();
|
||||
final stream = await LocalTrack.createStream(options);
|
||||
|
||||
return LocalAudioTrack(
|
||||
|
||||
@@ -128,7 +128,7 @@ class LocalVideoTrack extends LocalTrack with VideoTrack {
|
||||
static Future<LocalVideoTrack> createCameraTrack([
|
||||
CameraCaptureOptions? options,
|
||||
]) async {
|
||||
options = const CameraCaptureOptions();
|
||||
options ??= const CameraCaptureOptions();
|
||||
|
||||
final stream = await LocalTrack.createStream(options);
|
||||
return LocalVideoTrack._(
|
||||
@@ -165,8 +165,11 @@ class LocalVideoTrack extends LocalTrack with VideoTrack {
|
||||
static Future<List<LocalTrack>> createScreenShareTracksWithAudio([
|
||||
ScreenShareCaptureOptions? options,
|
||||
]) async {
|
||||
options = const ScreenShareCaptureOptions(captureScreenAudio: true);
|
||||
|
||||
if (options == null) {
|
||||
options = const ScreenShareCaptureOptions(captureScreenAudio: true);
|
||||
} else {
|
||||
options = options.copyWith(captureScreenAudio: true);
|
||||
}
|
||||
final stream = await LocalTrack.createStream(options);
|
||||
|
||||
List<LocalTrack> tracks = [
|
||||
|
||||
Reference in New Issue
Block a user