@@ -181,7 +181,11 @@ export class MediaStreamFactory {
181
181
} ;
182
182
}
183
183
} 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
+ }
185
189
}
186
190
if ( typeof constraints . audio === 'object' &&
187
191
constraints . audio . source ===
@@ -198,12 +202,21 @@ export class MediaStreamFactory {
198
202
if ( constraints . video . resolution &&
199
203
constraints . video . resolution . width &&
200
204
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
+ }
207
220
}
208
221
if ( typeof constraints . video . deviceId === 'string' ) {
209
222
mediaConstraints . video . deviceId = { exact : constraints . video . deviceId } ;
0 commit comments