@@ -602,16 +602,17 @@ export default class LocalParticipant extends Participant {
602602 */
603603 async createTracks ( options ?: CreateLocalTracksOptions ) : Promise < LocalTrack [ ] > {
604604 options ??= { } ;
605- const { audioProcessor, videoProcessor, optionsWithoutProcessor } =
606- extractProcessorsFromOptions ( options ) ;
607605
608- const mergedOptions = mergeDefaultOptions (
609- optionsWithoutProcessor ,
606+ const mergedOptionsWithProcessors = mergeDefaultOptions (
607+ options ,
610608 this . roomOptions ?. audioCaptureDefaults ,
611609 this . roomOptions ?. videoCaptureDefaults ,
612610 ) ;
613611
614- const constraints = constraintsForOptions ( mergedOptions ) ;
612+ const { audioProcessor, videoProcessor, optionsWithoutProcessor } =
613+ extractProcessorsFromOptions ( mergedOptionsWithProcessors ) ;
614+
615+ const constraints = constraintsForOptions ( optionsWithoutProcessor ) ;
615616 let stream : MediaStream | undefined ;
616617 try {
617618 stream = await navigator . mediaDevices . getUserMedia ( constraints ) ;
@@ -639,10 +640,6 @@ export default class LocalParticipant extends Participant {
639640 return Promise . all (
640641 stream . getTracks ( ) . map ( async ( mediaStreamTrack ) => {
641642 const isAudio = mediaStreamTrack . kind === 'audio' ;
642- let trackOptions = isAudio ? mergedOptions ! . audio : mergedOptions ! . video ;
643- if ( typeof trackOptions === 'boolean' || ! trackOptions ) {
644- trackOptions = { } ;
645- }
646643 let trackConstraints : MediaTrackConstraints | undefined ;
647644 const conOrBool = isAudio ? constraints . audio : constraints . video ;
648645 if ( typeof conOrBool !== 'boolean' ) {
0 commit comments