Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
jijojosephk committed Jul 3, 2023
1 parent 1bbf766 commit fd094a3
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
5 changes: 1 addition & 4 deletions app/browser/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,7 @@ function initializeModules(config, ipcRenderer) {

require('./tools/zoom').init(config);
require('./tools/shortcuts').init(config);
require('./tools/chromeApi');
if (config.disableAutogain) {
require('./tools/disableAutogain')();
}
require('./tools/chromeApi')(config);
require('./tools/settings').init(config, ipcRenderer);
require('./tools/customBackgrounds')(config, ipcRenderer);
}
Expand Down
15 changes: 12 additions & 3 deletions app/browser/tools/chromeApi.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
const { ipcRenderer } = require('electron');
const disableAutogain = require('./disableAutogain');
// In order to have this functionality working, contextIsolation should be disabled.
// In new versions of electron, contextIsolation is set to true by default.
// We should explicitly set it to false when creating BrowserWindow
window.addEventListener('DOMContentLoaded', ()=>{
MediaDevices.prototype.getDisplayMedia = customGetDisplayMedia;
});


function init(config) {
window.addEventListener('DOMContentLoaded', () => {
MediaDevices.prototype.getDisplayMedia = customGetDisplayMedia;
if (config.disableAutogain) {
disableAutogain();
}
});
}

function customGetDisplayMedia() {
return new Promise((resolve, reject) => {
Expand Down Expand Up @@ -41,3 +49,4 @@ function startStreaming(properties) {
}
}

module.exports = init;
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "teams-for-linux",
"version": "1.1.10",
"version": "1.1.11",
"main": "app/index.js",
"description": "Unofficial client for Microsoft Teams for Linux",
"homepage": "https://github.com/IsmaelMartinez/teams-for-linux",
Expand Down

0 comments on commit fd094a3

Please sign in to comment.