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([
|
static Future<LocalAudioTrack> create([
|
||||||
AudioCaptureOptions? options,
|
AudioCaptureOptions? options,
|
||||||
]) async {
|
]) async {
|
||||||
options = const AudioCaptureOptions();
|
options ??= const AudioCaptureOptions();
|
||||||
final stream = await LocalTrack.createStream(options);
|
final stream = await LocalTrack.createStream(options);
|
||||||
|
|
||||||
return LocalAudioTrack(
|
return LocalAudioTrack(
|
||||||
|
|||||||
@@ -128,7 +128,7 @@ class LocalVideoTrack extends LocalTrack with VideoTrack {
|
|||||||
static Future<LocalVideoTrack> createCameraTrack([
|
static Future<LocalVideoTrack> createCameraTrack([
|
||||||
CameraCaptureOptions? options,
|
CameraCaptureOptions? options,
|
||||||
]) async {
|
]) async {
|
||||||
options = const CameraCaptureOptions();
|
options ??= const CameraCaptureOptions();
|
||||||
|
|
||||||
final stream = await LocalTrack.createStream(options);
|
final stream = await LocalTrack.createStream(options);
|
||||||
return LocalVideoTrack._(
|
return LocalVideoTrack._(
|
||||||
@@ -165,8 +165,11 @@ class LocalVideoTrack extends LocalTrack with VideoTrack {
|
|||||||
static Future<List<LocalTrack>> createScreenShareTracksWithAudio([
|
static Future<List<LocalTrack>> createScreenShareTracksWithAudio([
|
||||||
ScreenShareCaptureOptions? options,
|
ScreenShareCaptureOptions? options,
|
||||||
]) async {
|
]) 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);
|
final stream = await LocalTrack.createStream(options);
|
||||||
|
|
||||||
List<LocalTrack> tracks = [
|
List<LocalTrack> tracks = [
|
||||||
|
|||||||
Reference in New Issue
Block a user