Giter Site home page Giter Site logo

mpyken / screenareashare Goto Github PK

View Code? Open in Web Editor NEW
135.0 9.0 15.0 240 KB

Share selected area of the screen in applications that do not support this, e.g. Teams.

License: MIT License

CSS 9.53% HTML 6.83% JavaScript 83.64%
desktop-app electron meeting screen-sharing screensharing teams video-call

screenareashare's Introduction

screenareashare's People

Contributors

jamiejames45 avatar joeskeen avatar mpyken avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

screenareashare's Issues

App doesn't work on latest Linux Mint

I've used the app on Windows where it works great, but I also wanted to use it on my Linux box. After installing the latest release, I launch it and find it doesn't work. The capture window has a black background.

image

After taking a look, it seems that the version of Electron being used in this project currently doesn't support transparency on my OS. But I did find this project that I was able to quickly run to verify that Electron can do transparency in later versions.

image

So I pulled down the source and started playing around with the Electron version. Currently the version in package.json is 12, and trying all the major versions after 12 I found that version 15 is the minimum version that works with my setup. At the time of writing, the latest version of Electron is 25.

Having solved the transparency issue, I tested the render window, only to find that it isn't getting the capture data from the capture window. Uncommenting the line mainWindow.webContents.openDevTools(); I was able to discover a runtime error:

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'id')
    at selectSource (render.js:37)
    at getVideoSources (render.js:25)
    at async EventEmitter.<anonymous> (render.js:65)

After enabling more logging, I was able to determine that the objects returned from desktopCapturer.getSources({types:["screen"]}) did not have a populated display_id property; thus the matching display isn't found in the first parameter of this call:

await selectSource(
    inputSources.filter((is) => is.display_id === display.id.toString())[0],
    display
  );

Investigating further, I tried looking at the documentation for desktopCapturer and it seems that in the latest Electron version, it is only accessible from the main thread (index.js), not from the browser (render.js). Looking at how it is used in the render.js file, it ultimately only needs to know the source.id for the selectSource function. Moving some of the code from render.js to index.js, I was able to finally see the source display ids, detect and handle the error all in the main thread:

find display 1881264395124802 @ {"x":0,"y":546,"width":1920,"height":1080}
  screen:430:0, Screen 1: 3803340867
  screen:429:0, Screen 2: 66
(node:33974) UnhandledPromiseRejectionWarning: Error: Cannot find source matching display 1881264395124802. Candidates: [
  {
    "name": "Screen 1",
    "id": "screen:430:0",
    "thumbnail": {
      "isMacTemplateImage": false
    },
    "display_id": "3803340867",
    "appIcon": null
  },
  {
    "name": "Screen 2",
    "id": "screen:429:0",
    "thumbnail": {
      "isMacTemplateImage": false
    },
    "display_id": "66",
    "appIcon": null
  }
]

Drat. Looks like the display.id and source.display_id don't match. This appears to be an Electron bug? (see https://stackoverflow.com/a/66772210). Yup, and here it is (opened way back in 2018, still open) electron/electron#15111 (comment). Specifically, one user had a clever workaround to fall back on screen name instead of display id. Added that to my changes in index.js and suddenly I am getting some capture! But it's capturing the wrong screen. I had to go into my display settings and make Screen 1 be my primary monitor (screen 2 was previously set to that) and now it works!

image

I'm going to clean up my changes and submit a PR after I have tested it on Windows and Mac as well (to make sure I haven't broken anything).

Can't install because the .exe is not signed

Is there any way that you can link the .exe file to a publisher?

Microsoft Defender SmartScreen prevented an unrecognized app from starting. We have a alot of security is place (Security Baseline for Defender, Endpoint in Intune.) were we can't overwrite to run the .exe

Publisher: | Unknown publisher

No luck with the tool on VDI :-(

Awesome app, thanks for coming up with this!

Unfortunately it's not working as expected when used in a remote desktop session (VMware Horizon). I can somehow define the capture and remoting areas, but I don't see any red border, nor do I see the the window as a selection when sharing in MS Teams.

Given the way these remoting protocols work, is this something that can be fixed at all?

Cheers!

Move the red border outside the visible area

Is it possible to move out the red border outside the visible area so that the partisipants of ms teams dont see it?
and it can also a litte bit smaller too :>

but great work so far :D

FancyZones

Is this expected to work with FancyZones ?
when I try to drag the capture area with Shift pressed, I don't see FancyZones highlighting the zone area.

command line options does not work

.\screen-area-share-1.3.2.Setup.exe --cw=1920 --ch=1080 --cx=0 --cy=0 --rx=3100 --ry=0 --freeze

For example , none of this commands are working.

White Streaming window without controls

Hey there,

I downloaded and started version 1.3.1 (with and without admin priv.). I get the mentioned two windows and can drag them both.
But the streaming window is always empty (completely white). I do not even get any control panels like a close button.
Do I need to start a Teams Call for showing the content?

The shared area is darker than the real screen.

This is an odd one, hope you'll be able to help. I noticed that the "Main Window" screen was darker than the original one.

How I view it with my eyes :
IMG_20211231_105900433

Surprisingly when I do a screenshot both rectangles are similar (and darker):
image

Do you have any idea on what can cause this and how to fix it ?

Click Through

Would be fantastic to have a click through feature like https://github.com/LorenzCK/OnTopReplica.

If a user is allowed on "Conference Tool" to interact with the shared window with mouse clicks, ScreenAreaShare does not reflect the input to target area.

Cpu Usage , no framerate limiter

Really a nice tool to use ! , But an parameter to add like max fps 60, 30 , 15 would be nice , while sharing code it would prevent fan to ramp up , just need 15 fps when sharing visual studio .

multi screen support

I'm using the app with a wide screen (1) and an 4K HDMI dummy dongle (2). Screens are arranged as per below:
image

The resolution of the main screen is 3440x1440 and the dummy dongle is set to 1720x1166, exactly the area I want to share.

Once I use below command line, the rendering window is pushed to the dongle screen, but remains white.
screen-area-share.exe --cw=1720 --ch=1166 --cx=1720 --cy=0 --rw=1720 --rh=1166 --rx=3440 --ry=0

With below command line, the rendering window will be on the main screen and working. But once moved to the dongle screen, it shows the whole content of the main screen squeezed together.
screen-area-share.exe --cw=1720 --ch=1166 --cx=1720 --cy=0 --rw=1720 --rh=1166 --rx=0 --ry=0

It seems that multi screens are not supported, could you check?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.