DEV Community

Cover image for [Idea] Screen Sharing application using electronjs and pusher
Akshat
Akshat

Posted on

[Idea] Screen Sharing application using electronjs and pusher

My idea?

To create a realtime screen sharing application like Teamviewer / Chrome remote desktop but without any realtime controlling system.

Tech Stack

  1. ElectronJS (get native OS APIs support specifically desktopCapture)
  2. NodeJS (Routes to generate userId for sharing session and maybe for up/down data streams)
  3. Pusher Channel API (the power provider these gods need)

Challenges I know I'm going to face?

MediaRecorder, FileReader, Buffer, ElectronJS (all these are going to be my first try) but I know this is going to be interesting and an exciting journey for me and my learning 😁

Doubts I have regarding pusher:

  • How do I start a stream from one client to another? For example, I send a request to backend route that generates a id, I make a pusher channel with that id. Now how do I send video data as stream on that channel via pusher api from client? Any help would be appreciated.

This was my first article so pardon me for bad markup and thanks for reading.

Top comments (5)

Collapse
 
kayis profile image
K • Edited

You can either send data to your server via HTTP and broadcast it to other clients in a room with Pusher.

Or.

Use client events, that get transmitted directly to Pusher and broadcasted to other clients in a room.

pusher.com/docs/client_api_guide/c...

But I don't know if either way would be fast enough

Collapse
 
akshatbhargava123 profile image
Akshat

Thank you, will there be high delays if both parties are at good internet?

Collapse
 
kayis profile image
K

It's one TCP package to the Pushe servers and one back to your other client.

If both have a ping of 50, which I'd consider good, the delay would at least be 100, but Pusher says you should only send 10 client events per second, so this should fit.

But I guess you're stuck with max 10fps, most of the time even less.

Thread Thread
 
defman profile image
Sergey Kislyakov

You don't have to send frames, you can send chunks. That, of course, will add a delay = time length of a chunk.

Collapse
 
rdshehzad profile image
RDShehzad

Give me github link in which Screen Sharing application using electronjs code in avaliable