Code Monkey home page Code Monkey logo

screenareashare's Introduction

Github All Releases Build Github All Releases Github All Releases

ScreenAreaShare

ScreenAreaShare allows sharing selected area of the screen in applications that do not natively support this feature such as Teams.

How It Works

ScreenAreaShare creates 2 windows. The capture window is a click-through, transparent window indicating the recording area via a red border. The rendering window displays the content of that area. In applications such as Teams, you can then share the rendering window.

How To Run

Via Release

You can download the executable for windows from the Releases page.

Via Source Code

  1. Clone or download the source code.
  2. Run npm install
  3. Either run directly or build an executable.
    1. Source: run npm start.
    2. Build executable: run npm run make.
      Execute the built .exe file in the out/ folder.

Usage

  1. Two windows should open: One border-window and one rendering window. These two windows can be moved via a drag-drop. The red borders can be resized.
  2. With both windows open, start the sharing function of the application of your choice (e.g. Teams) by selecting the option to share a window. Select this application.

Command Line Parameters

If you run from source: npm start -- -- --cx=0 --cy=0 ... (note the additional -- required by electron-forge)
If you run a prebuilt executable: path/to/screen-area-share.exe --cx=0 --cy=0 ...

Parameter Description
--freeze Hide capturing window
--consider-scale Considers scale settings of the screen
--maxfps=<fps> Set maximum frames per second during capture
--cx=<x>, --cy=<y> Initial top left coordinate of the capturing window
--cw=<w>, --ch=<h> Initial width and height of the capturing window
--rx=<x>, --ry=<y> Initial top left coordinate of the rendering window

screenareashare's People

Contributors

jamiejames45 avatar joeskeen avatar mpyken avatar nnako 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

Screen recording permissions request loop on MacBook (M1) with Sonoma 14.4.1

Hi,

I am stuck in a screen recording permissions request loop.

Installed screen-area-share version 1.4.1 (screen-area-share-1.4.1-universal.dmg) on a MacBook (M1) running Sonoma 14.4.1

When I launch it, I get the prompt:

image

I click open settings and toggle screen-area-share to allow and it asks me to restart it (quit & reopen):

image

image

But then when it reopens (or if I launch it manually) it just prompts for missing permissions again.

Even a reboot does not help.

Any idea?

Thanks!

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?

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.

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).

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

capture window without border respective to location settings

Hi,

great tool!!!

I have problems fixing the capture screen at a desired location on a secondary monitor. My configuration looks like this with a ~17 inch internal laptop monitor and an external 55 inch monitor connected via dockingstation to the laptop:

                              x=0
                               |
                               |
 
     -  +----------------------+
     ^  |                      |
     |  |                      +----------------+ --- y=0
     |  |       55 inch        |     17 inch    |  ^
2160 |  |   secondary screen   |  main screen   |  |  1080
 px  |  |   external monitor   | laptop monitor |  v   px
     |  |                      +----------------+  -
     v  |                      |
     -  +----------------------+

        |<-------------------->|<-------------->|
                 3840 px             1280 px

Without any changes in configuration, the tool works very well when starting via npm start:

  • the render window appears in the middle of the main screen (with 1280x720 size)
  • the capture window appears in the middle of the main screen (on top of the render window)
  • the thick red border of the capture window is visible
  • draging and re-sizing the capture window works fine (e.g. drag to secondary screen)
  • the render window stays always centered on the main screen. adjusting its size accordingly.
  • the capture window is always on top of all other windows (e.g. on the secondary screen)

Now, I want to statically set the location of the capture screen to cover a certain area on the secondary screen (at startup of the tool). So, I adjust the following elements within src/index.js:

const initCapRect = {
  x: app.commandLine.hasSwitch("cx")
    ? parseInt(app.commandLine.getSwitchValue("cx"))
    : null,
  y: app.commandLine.hasSwitch("cy")
    ? parseInt(app.commandLine.getSwitchValue("cy"))
    : null,
  width: app.commandLine.hasSwitch("cw")
    ? parseInt(app.commandLine.getSwitchValue("cw"))
    : 1280,
  height: app.commandLine.hasSwitch("ch")
    ? parseInt(app.commandLine.getSwitchValue("ch"))
    : 720,
};
const initRenderRect = {
  x: app.commandLine.hasSwitch("rx")
    ? parseInt(app.commandLine.getSwitchValue("rx"))
    : null,
  y: app.commandLine.hasSwitch("ry")
    ? parseInt(app.commandLine.getSwitchValue("ry"))
    : null,
  width: app.commandLine.hasSwitch("rw")
    ? parseInt(app.commandLine.getSwitchValue("rw"))
    : 1280,
  height: app.commandLine.hasSwitch("rh")
    ? parseInt(app.commandLine.getSwitchValue("rh"))
    : 720,
};

The shown default elements for x, y, width and height for both windows (except for x and y of the render window, as they should be set automatically) are changed to:

for capture

  • x=-2000 (in order to appear on the secondary screen)
  • y=0
  • width=1920
  • height=1080

for render

  • width=1920
  • height=1080

After doing so, and restarting the tool via npm start, the following effect shows:

  • the render window appears in the middle of the main screen (with 1920x1080 size)
  • the capture window seems to be placed on the secondary monitor (on the secondary screen)
  • NO thick red border of the capture window is visible
  • NO draging and re-sizing of the capture window possible (as the border is missing)
  • the render window still stays always centered on the main screen
  • the capture window does not seem to stay on top of all other windows (border not visible)

question

Is there a way to locate the capture window on a defined position of the secondary screen with a size of 1920x1080 without loosing the border of the capture window?

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.

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 ?

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 .

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!

manually minimize render window

When starting ScreenAreaShare, both windows (for capture and for render) open at their user-desired locations on any screen, respective to their starting coordinates and size. Both screens will always be fully visible (as long as they are not bigger than the hosting screen). Both windows open on top of all other windows (which is standard for new applications on Windows OS).

Now, the capure window is identified by a thick red border, so I don't need to see the render window in order to know e.g. what is being shown to other people looking at my shared screen. And for me, hosting the render window in my monitors reduces the available window space to work on things while presenting to the folks.

Why not minimizing the render window in those cases? Although I love the borderless rendering, I would like to be able to see a small icon (as standard at least on Windows application windows) on the top right of the render window to be able to minimize the render window. While it's content is still being transferred to people on the other side of the share.

Would it be possible to operate a small "minimize" icon to be able to put the render window out of local sight?

If this is a bad idea, please tell me. Otherwise I might be able to implement this, myself.

icon for closing the application

When starting ScreenAreaShare, both windows (for capture and for render) open at their user-desired locations on any screen, respective to their starting coordinates and size. Both screens will always be fully visible (as long as they are not bigger than the hosting screen). Both windows open on top of all other windows (which is standard for new applications on Windows OS).

Now, after presenting, I'd like to easily close the entire application (including the capture and the render window). As far as I know, there is no icon to do so. Neither on the capture window nor on the render window. So, I have to do the following in order to quit the application:

  • scan the task row for a fitting console which I used to start the ScreenAreaShare application
  • bring that console to the front by clicking that icon
  • pressing <CTRL> + <C> to send a sigint signal
    -> this closes capture and render windows
  • press <Y> + <RETURN> to end the batch process and close the console

Would it be possible to operate a small "close" icon on the top right of each window (capture and render windows) to be able to terminate the application?

If this is a bad idea, please tell me. Or is there already a way to comfortably quit the application's operation without fiddling with the console window (somewhere behind some other windows)? Maybe a hidden hotkey?

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?

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

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.

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.