зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1422875 - Fix fake constraint to not apply to screensharing (on all platforms but android). r=pehrsons
MozReview-Commit-ID: K35vaNAolEy --HG-- extra : rebase_source : 53fae5a862320ae6386e52d4163b06bea5c644d1
This commit is contained in:
Родитель
22aabfd482
Коммит
4bed737a12
|
@ -2511,9 +2511,15 @@ MediaManager::GetUserMedia(nsPIDOMWindowInner* aWindow,
|
|||
bool fake = c.mFake.WasPassed()? c.mFake.Value() :
|
||||
Preferences::GetBool("media.navigator.streams.fake");
|
||||
|
||||
bool hasVideo = videoType != MediaSourceEnum::Other;
|
||||
bool hasAudio = audioType != MediaSourceEnum::Other;
|
||||
bool fakeCams = fake && videoType == MediaSourceEnum::Camera;
|
||||
bool fakeMics = fake && audioType == MediaSourceEnum::Microphone;
|
||||
bool realDevicesRequested = (!fakeCams && hasVideo) || (!fakeMics && hasAudio);
|
||||
|
||||
bool askPermission =
|
||||
(!privileged || Preferences::GetBool("media.navigator.permission.force")) &&
|
||||
(!fake || Preferences::GetBool("media.navigator.permission.fake"));
|
||||
(realDevicesRequested || Preferences::GetBool("media.navigator.permission.fake"));
|
||||
|
||||
RefPtr<PledgeSourceSet> p = EnumerateDevicesImpl(windowID, videoType,
|
||||
audioType, fake);
|
||||
|
|
Загрузка…
Ссылка в новой задаче