3

hope this meets you well

I'm working on a nativescript project and i would like to add video call functionality to the app, i have searched online, i found https://market.nativescript.org/plugins/nativescript-webrtc-plugin, but i really don't understand the example there.

there's a part in the docs

iceServers: [
    // Optional defaults to google stun servers
    {
      url: 'stun:stun.l.google.com:19302'
    },
    {
      url: 'serverRequiresAuth',
      username: 'username',
      password: 'password'
    }
  ]

Question 1: Where do i get the username/password or is it "username" and "password"

Question 2: How do i connect a call from one device to another

if you have worked with this plugin before or you know another alternative, i would really appreciate and explanation

kunlee
  • 591
  • 1
  • 4
  • 15

2 Answers2

1

I didn't work on this particular plugin, however, I think that you may be interested in studying WebRTC for understanding its behavior.

[Q2] In WebRTC and in order to establish a call between your clients, they will have to exchange specific information (video and audio codecs, ICE Candidates, media types and so on..), this is known as SDP (Session Description Protocol). The caller will send an SDP offer, and the callee will receive it and response by an SDP answer. Usually, a specific signaling server is needed for those exchanges.

For networking purposes, ICEServers are needed to be sure that your clients will be able to reach each other (through their ICECandidates). Once* the caller gathers all its ICECandidates (IP address, ports, etc.), it will then try to reach the callee (and vice-versa) through the callee's ICE Candidates retrieved by the signalling callbacks. This is the purpose of the ICE protocol.

Two types of ICEservers exist:

  • STUN servers allow a client to retrieve its "public" IP (behind a NAT for example)
  • [Q1] TURN servers (which require an authentication phase, username/credential) allow a client to relay its media flows even if it is behind a restrict firewall, or a specific NAT. You can deploy your own TURN server (coturn, rfc5766-turn-server, etc.) or you can rely on companies (Xirsys, Twilio, etc.). More information: https://webrtc.org/getting-started/turn-server

* Actually this is done asynchronously, it can happen "almost" any time before and during the call

Antonin M.
  • 1,744
  • 1
  • 18
  • 29
1

I have found a plugin in the NativeScript Marketplace.

I have not used this before.

On the connectycube website it says they have a free tier with a cap.

https://market.nativescript.org/plugins/connectycube/

Bryant
  • 421
  • 2
  • 10