36

I want to create a WebRTC peer that's a simple listener/recorder with no "presentation" component (i.e., no HTML/CSS).

If this is possible, (with the WebRTC JavaScript APIs), please tell me what standalone JavaScript engine I can use (I'm thinking of installing a standalone V8 engine).

Thank you.

9
  • 3
    that would be a capability added by the browser DOM, not by javascript. Commented May 7, 2013 at 22:50
  • The peer I want to build has no interaction with the DOM. It does not "present" anything. Commented May 7, 2013 at 23:05
  • 3
    What are you trying to accomplish? Are you looking to run WebRTC APIs with something like Phantom.js or Rhino? If you want to build a native app, take a look at the WebRTC code package (webrtc.org/reference/getting-started) and the various attempts to use Qt to build WebRTC apps. Commented May 24, 2013 at 14:35
  • Thanks, Sam Dutton. It now clear to me I have to use the native APIs. I was hoping that, if I had a stand-alone V8 (or any other JS engine) running on my machine, I could use the WebRTC JS APIs directly. My app doesn't decode audio/video and doesn't need any controls; so I don't need the web-browser's DoM. If you have any ideas on how to do this, please share. Commented May 28, 2013 at 6:00
  • 4
    Have you looked into the webrtc.io libraries for node.js? npmjs.org/package/webrtc.io Commented Dec 6, 2013 at 21:00

6 Answers 6

14

Very late answer, but I think it's good to re-evaluate this question, because a lot has changed since this question was asked.

I assume this question was asked because there was no native support for webrtc yet at the time. But there is now. Android, iOS, Windows, Linux and OSX all support native webrtc libraries now.

The native libraries can be used to create a peerconnection and setup a stream to another client (cross-platform). If you want to create any webrtc-based client application without using a browser, the native libraries are the way to go. No silly standalone javascript engine necessary.

Read more here

Sign up to request clarification or add additional context in comments.

2 Comments

I couldn't find any links for Linux. Could you help me with that? Thanks!
4

You could do this with headless chrome. Chrome of course has full WebRTC support, but can be started in "headless" mode, and then interacted with via the command line or their control interface.

1 Comment

old post but gold response, sill relevant. thank you
3

I think you could use a node.js server to do so. There's a npm package bringing webrtc capabilites to nodejs : node-webrtc.

2 Comments

That does look like the serverside part of WebRTC as well - the demo peer is still running in the browser.
"MediaStream APIs are not supported", so you can't build a listener/recorder with this library
1

The best way to do this right now is to create a node-webkit application. The unified node + browser context gives you the best of all worlds.

2 Comments

Yes, node is versatile enough to fit the bill. Why do we need a browser context? Please elaborate your thoughts if you have any. I'll accept the answer any way.
The browser context is pre-setup with the webrtc connection primitives, so you don't have to do all the work
0

I wanted to have a permanently running server-side "Robot" where public peers could connect to and test their connection (peer-to-peer vs relay). I was successful with the headless browser Puppeteer. The "Robot" uses basically the same code as the public peers. It runs on Windows and Unix and connected to the signaling and STUN/TURN server and the individual peer without any code changes.

2 Comments

That's great. Do you mind sharing the puppeteer setup/files to make it work?
I don't have access to the code any more. But it's not much more than the project readme says. Just load your client code URL. You have to write your code in a way the robot accepts incoming calls automatically. But that's not in the scope of Puppeteer, but your WebRTC app.
-1

If I got you right that you want to make WebRTC - aka primarily browser targeted feature to be used without browser:-)

I could imagine that "emulating" the browser behaviour can be done simply by implementing the necessary api via your own code, either directly inside the rhino or similar or by actually controlling the interface that handles the media streams in native code.

Thus what has to be done is implement the WebRTC api which controls capturing the A/V from input devices and sending it to the other side. As I understood it shall be no UI node, like embedded ethernet camera with mic that servers as capture A/V in conference room.

I am affraid that it could be a piece of work as the main part is the media a connection handling.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.