Add screensharing behind a feature flag
This commit is contained in:
parent
7c7f7ee5a0
commit
ceffc2380c
49 changed files with 2044 additions and 164 deletions
|
@ -23,18 +23,29 @@ function _createPermissionHandler(userConfig) {
|
|||
return (webContents, permission, callback, details) => {
|
||||
// We default 'media' permission to false, but the user can override that for
|
||||
// the microphone and camera.
|
||||
if (
|
||||
permission === 'media' &&
|
||||
details.mediaTypes.includes('audio') &&
|
||||
userConfig.get('mediaPermissions')
|
||||
) {
|
||||
return callback(true);
|
||||
}
|
||||
if (
|
||||
permission === 'media' &&
|
||||
details.mediaTypes.includes('video') &&
|
||||
userConfig.get('mediaCameraPermissions')
|
||||
) {
|
||||
if (permission === 'media') {
|
||||
if (
|
||||
details.mediaTypes.includes('audio') ||
|
||||
details.mediaTypes.includes('video')
|
||||
) {
|
||||
if (
|
||||
details.mediaTypes.includes('audio') &&
|
||||
userConfig.get('mediaPermissions')
|
||||
) {
|
||||
return callback(true);
|
||||
}
|
||||
if (
|
||||
details.mediaTypes.includes('video') &&
|
||||
userConfig.get('mediaCameraPermissions')
|
||||
) {
|
||||
return callback(true);
|
||||
}
|
||||
|
||||
return callback(false);
|
||||
}
|
||||
|
||||
// If it doesn't have 'video' or 'audio', it's probably screenshare.
|
||||
// TODO: DESKTOP-1611
|
||||
return callback(true);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue