0

Does anyone use electron + simplewebrtc successfully?

I used simplewebrtc to build a web app. It works fine in browsers.

When I migrated it into electron, something weird happened.

At first I used two copies of my electron app to make them connect each other, but failed.

Then, I made a web browser version and a electron version connect each other. First, only when the electron version joined the room first, and then made the web version join the room, they can connect each other. otherwise, if the order changes, they cannot get the event peer.pc.iceConnectionState to "connected".

Second, even if them are connected, data channel only works on one way. Only web version can send message to electron version. If I try to let electron version send a message to web version, nothing happened.

During the whole time, no any error was thrown.

Thank you in advance.

simplewebrtc 2.2.3 - 3.0.1

Electron: 1.7.6

Web browsers: Chrome 62, Opera 49, Chromium 58

Daniel
  • 1
  • 1
  • 1
    show some codes, then only we can offer help. – Mathews Sunny Nov 20 '17 at 03:12
  • The codes are pretty simple and standard. And I don't think it is about my codes. Because same codes work perfectly in browsers even in chromium 58 but not in electron 1.7.6. Do you know any difference between electron renderer side and browsers for webrtc? I think that make simplewebrtc fail. Thank you. – Daniel Nov 20 '17 at 03:26
  • keep in mind that your webcam can most likely not be shared between processes. That will mean simplewebrtc can not get the camera and will not join the room. – Philipp Hancke Nov 20 '17 at 07:40
  • @PhilippHancke Thank you. I didn't turn on the video, so joining room is always successful. Have you ever tried electron + simplewebrtc before? – Daniel Nov 20 '17 at 17:09
  • works fine here using the demo pages. – Philipp Hancke Nov 20 '17 at 18:06
  • 1
    @PhilippHancke Thank you. I just found the solution. It's a simplewebrtc's dependency webrtcsupport. in electron, it considers the environment is node, so returns everything is false. So I just made it always load index-browser.js. And it's resolved. – Daniel Nov 20 '17 at 19:17
  • can you file a simplewebrtc issue [here](http://github.com/andyet/simplewebrtc) please, that should not happen. – Philipp Hancke Nov 20 '17 at 19:30

0 Answers0