Skip to content

Commit 7b6cbce

Browse files
committed
Conditionally specify fake in capture constraints for media capture
1 parent b0e6c33 commit 7b6cbce

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

index.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,12 @@ function Media(opts) {
165165
mandatory: {},
166166
optional: []
167167
},
168-
audio: true
168+
audio: true,
169+
170+
// specify the fake flag if we detect we are running in the test
171+
// environment, on chrome this will do nothing but in firefox it will
172+
// use a fake video device
173+
fake: typeof __testlingConsole != 'undefined'
169174
}
170175
}, opts);
171176

0 commit comments

Comments
 (0)