@@ -96,22 +96,21 @@ private AudioTrack createAudioTrack(ReadableMap constraints) {
96
96
MediaConstraints peerConstraints = webRTCModule .constraintsForOptions (audioConstraintsMap );
97
97
98
98
// Convert given constraints into the internal webrtc media constraints.
99
- // Default to on if not specified.
100
99
peerConstraints .optional .add (new MediaConstraints .KeyValuePair ("googAutoGainControl" ,
101
- audioConstraintsMap .hasKey ("audioGainControl " )
102
- ? audioConstraintsMap . getDynamic ( "autoGainControl" ). asString ( )
100
+ audioConstraintsMap .hasKey ("autoGainControl " )
101
+ ? ReactBridgeUtil . getMapStrValue ( audioConstraintsMap , "autoGainControl" )
103
102
: "true" ));
104
103
peerConstraints .optional .add (new MediaConstraints .KeyValuePair ("googNoiseSuppression" ,
105
104
audioConstraintsMap .hasKey ("noiseSuppression" )
106
- ? audioConstraintsMap . getDynamic ( "noiseSuppression" ). asString ( )
105
+ ? ReactBridgeUtil . getMapStrValue ( audioConstraintsMap , "noiseSuppression" )
107
106
: "true" ));
108
107
peerConstraints .optional .add (new MediaConstraints .KeyValuePair ("googEchoCancellation" ,
109
108
audioConstraintsMap .hasKey ("echoCancellation" )
110
- ? audioConstraintsMap . getDynamic ( "echoCancellation" ). asString ( )
109
+ ? ReactBridgeUtil . getMapStrValue ( audioConstraintsMap , "echoCancellation" )
111
110
: "true" ));
112
111
peerConstraints .optional .add (new MediaConstraints .KeyValuePair ("googHighpassFilter" ,
113
112
audioConstraintsMap .hasKey ("highpassFilter" )
114
- ? audioConstraintsMap . getDynamic ( "highpassFilter" ). asString ( )
113
+ ? ReactBridgeUtil . getMapStrValue ( audioConstraintsMap , "highpassFilter" )
115
114
: "true" ));
116
115
117
116
// PeerConnectionFactory.createAudioSource will throw an error when mandatory constraints contain nulls.
0 commit comments