@@ -181,7 +181,11 @@ export class MediaStreamFactory {
181181 } ;
182182 }
183183 } else {
184- mediaConstraints . audio = constraints . audio ;
184+ if ( constraints . audio . source === MediaFormatModule . AudioSourceInfo . SCREENCAST ) {
185+ mediaConstraints . audio = true ;
186+ } else {
187+ mediaConstraints . audio = constraints . audio ;
188+ }
185189 }
186190 if ( typeof constraints . audio === 'object' &&
187191 constraints . audio . source ===
@@ -198,12 +202,21 @@ export class MediaStreamFactory {
198202 if ( constraints . video . resolution &&
199203 constraints . video . resolution . width &&
200204 constraints . video . resolution . height ) {
201- mediaConstraints . video . width = Object . create ( { } ) ;
202- mediaConstraints . video . width . exact =
203- constraints . video . resolution . width ;
204- mediaConstraints . video . height = Object . create ( { } ) ;
205- mediaConstraints . video . height . exact =
206- constraints . video . resolution . height ;
205+ if ( constraints . video . source ===
206+ MediaFormatModule . VideoSourceInfo . SCREENCAST ) {
207+ mediaConstraints . video . width =
208+ constraints . video . resolution . width ;
209+ mediaConstraints . video . height =
210+ constraints . video . resolution . height ;
211+ } else {
212+ mediaConstraints . video . width = Object . create ( { } ) ;
213+ mediaConstraints . video . width . exact =
214+ constraints . video . resolution . width ;
215+ mediaConstraints . video . height = Object . create ( { } ) ;
216+ mediaConstraints . video . height . exact =
217+ constraints . video . resolution . height ;
218+
219+ }
207220 }
208221 if ( typeof constraints . video . deviceId === 'string' ) {
209222 mediaConstraints . video . deviceId = { exact : constraints . video . deviceId } ;
0 commit comments