Skip to content

Commit

Permalink
wip trying to fix screensharing (#195)
Browse files Browse the repository at this point in the history
* wip trying to fix screensharing

* Adding back all the other chrome stuff as otherwise the one-2-one and other video stuff doesn't work

* Catching the angular undefined and triggering the timeout again

* increasing the package version number in order to be ready for release
  • Loading branch information
IsmaelMartinez authored Aug 3, 2019
1 parent 7b7d1f7 commit 4595b87
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 16 deletions.
2 changes: 2 additions & 0 deletions app/browser/desktopShare/chromeApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ window.chrome = {
'runtime': {
'sendMessage': function (extensionId, messageName, callback) {
if (messageName == 'version') {
console.log('version');
callback({ version: '1.1.0' });
} else if (messageName == 'get-sourceId') {
console.log('get-sourceId');
selectSource(sourceId => {
callback({
type: 'success',
Expand Down
46 changes: 32 additions & 14 deletions app/browser/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,44 +15,49 @@
require('./zoom')();

require('./desktopShare/chromeApi');

const iconPath = path.join(__dirname, '../assets/icons/icon-96x96.png');

new ActivityManager(ipcRenderer, iconPath).start();

if (config.enableDesktopNotificationsHack) {
pageTitleNotifications(ipcRenderer);
}

document.addEventListener(
'DOMContentLoaded',
() => {

setTimeout(() => {
document.addEventListener('DOMContentLoaded',() => {
modifyAngularSettingsWithTimeot();
});

function modifyAngularSettingsWithTimeot() {
setTimeout(() => {
try {
let injector = angular.element(document).injector();

if(injector) {
enableChromeVideoAudioMeetings(injector);
disablePromoteStuff(injector);

injector.get('settingsService').settingsService.refreshSettings();

}
// Future tests can be done in here...
// angular.element(document).injector().get('settingsService').appConfig.replyBoxFocusAfterNewMessage = true;
//last I look is enableIncomingVideoUnsupportedUfd groing from down to up.
}, 3000);
},
);
} catch (error) {
if (error instanceof ReferenceError) {
modifyAngularSettingsWithTimeot();
}
}
}, 4000);
}

function enableChromeVideoAudioMeetings(injector) {
injector.get('callingSupportService').oneOnOneCallingEnabled = true;
injector.get('callingSupportService').isDesktopApp = true;
injector.get('callingSupportService').isChromeMeetingSingleVideoEnabled = true;
injector.get('callingSupportService').isChromeVideoOneOnOneEnabled = true;
injector.get('callingSupportService').isChromeVideoMultipartyEnabled = true;
injector.get('settingsService').appConfig.angularDebugInfoEnabled = true;
injector.get('settingsService').appConfig.enableCallingChromeOneOnOne = true;
injector.get('settingsService').appConfig.callingEnableChromeMeetingSingleVideo = true;
injector.get('settingsService').appConfig.callingEnableChromeMultipartyVideo = true;
injector.get('settingsService').appConfig.callingEnabledLinux = true;
injector.get('settingsService').appConfig.enableChromeScreenSharing = true;
injector.get('settingsService').appConfig.enableAddToChatButtonForMeetings = true;
injector.get('settingsService').appConfig.enableSharingOnlyCallChrome = true;
Expand All @@ -63,6 +68,18 @@
injector.get('settingsService').appConfig.enableMicOSUnmuteOnUnmute = true;
injector.get('settingsService').appConfig.enableModeratorsSupport = true;
injector.get('settingsService').appConfig.enableRecordPPTSharing = true;
injector.get('settingsService').appConfig.enable3x3VideoLayout = true;
injector.get('settingsService').appConfig.enableCallTranscript = true;
injector.get('settingsService').appConfig.enableCallTransferredScreen = true;
injector.get('settingsService').appConfig.enableCameraSharing = true;
injector.get('settingsService').appConfig.enableEdgeScreenSharing = true;
injector.get('settingsService').appConfig.enableSeeMyScreenshare = true;
injector.get('settingsService').appConfig.enableSmartReplies = true;
injector.get('settingsService').appConfig.enableSms = true;
injector.get('settingsService').appConfig.enableTestCallForAll = true;
injector.get('settingsService').appConfig.enableUnreadMessagesButton = true;
injector.get('settingsService').appConfig.enableVideoBackground = true;
injector.get('settingsService').appConfig.disableCallingOnlineCheck = false;
}

function disablePromoteStuff(injector) {
Expand All @@ -72,3 +89,4 @@
injector.get('settingsService').appConfig.enableMobileDownloadMailDialog = false;
}
}());

2 changes: 1 addition & 1 deletion app/config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function argv(configPath) {
describe: 'Google Chrome User Agent',
type: 'string',
default:
'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.80 Safari/537.36',
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3835.0 Safari/537.36',
},
ntlmV2enabled: {
default: 'true',
Expand Down
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": "0.4.2",
"version": "0.4.3",
"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 4595b87

Please sign in to comment.