Skip to content

Commit

Permalink
Merge pull request #2909 from vector-im/dbkr/enable_screen_sharing
Browse files Browse the repository at this point in the history
Enable screen sharing easter-egg in desktop app
  • Loading branch information
dbkr committed Jan 11, 2017
2 parents 6a1af89 + c5459a2 commit 278de13
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
2 changes: 2 additions & 0 deletions electron/src/electron-main.js
Expand Up @@ -148,6 +148,8 @@ process.on('uncaughtException', function (error) {

electron.ipcMain.on('install_update', installUpdate);

electron.app.commandLine.appendSwitch('--enable-usermedia-screen-capturing');

electron.app.on('ready', () => {
if (vectorConfig.update_base_url) {
console.log("Starting auto update with base URL: " + vectorConfig.update_base_url);
Expand Down
4 changes: 4 additions & 0 deletions src/vector/platform/ElectronPlatform.js
Expand Up @@ -127,4 +127,8 @@ export default class ElectronPlatform extends VectorBasePlatform {
getDefaultDeviceDisplayName() {
return "Riot Desktop on " + platformFriendlyName();
}

screenCaptureErrorString() {
return null;
}
}
8 changes: 8 additions & 0 deletions src/vector/platform/WebPlatform.js
Expand Up @@ -196,4 +196,12 @@ export default class WebPlatform extends VectorBasePlatform {
return app_name + " via " + ua.getBrowser().name +
" on " + ua.getOS().name;
}

screenCaptureErrorString() {
// it won't work at all if you're not on HTTPS so whine whine whine
if (!global.window || global.window.location.protocol !== "https:") {
return "You need to be using HTTPS to place a screen-sharing call.";
}
return null;
}
}

0 comments on commit 278de13

Please sign in to comment.