WebRTC Integration on Web & Mobile Application?

Multi-side chat solution to construct your personal build video chat app on android/iOS armed with best features. The chat answer is inbuilt with WebRTC signaling where making awesome video/audio calls to any consumer at any time is made easy. Contus Fly gives One-time-Payment choice to make video/audio calls to “N” quantity of customers regardless of the cost/minute usage.
  1. The deployment of actual-time verbal exchange over iOS and Android chat apps is possible through the combination of WebRTC.
  2. Contus Fly guarantees to determine the systems whether or not to create a video chat app on iOS or Android and the usage of Swift language is visible extra cushty than using Objective-C in an effort to create iOS-based totally video chat app.
  3. When it involves Android-based utility, Contus Fly makes use of Android SDK and different languages to construct android video chat app with Javascript.
webrtc-interview-application-development.png

Question Someone know whats wrong?

Currently, I’m exploring web development to see what all the hype is about. Except for following a small ‘create your first CRUD app in Node.JS’ and some formal training in JavaScript, I have no experience.

I’m new to JavaScript, NodeJS, Sails.JS, and WebSockets.

My current problem is this:
The app I’m trying to develop receives POST calls with a JSON object. This is the input part of the application. These POST calls originate from any random host.
The output is a webpage that updates itself by listening on a Sails.JS powered WebSocket system called sails.io.js.
Basically, each POST from any host should result in an event on the WebSocket.
Since I’m not building a formal REST API, I have to define some parts myself in Sails.JS. I do have blueprints enabled.
First, in the controller that handles the POST call, I can call the code below so existing WebSockets can receive an event of a new ServiceHeartBeatSession being created. All the server side code mentioned here is located in the controller or executed in the console.

Code:
sails.sockets.addRoomMembersToRooms(ServiceHeartBeatSession._classRoom()
, ServiceHeartBeatSession._room(session.id) );
Then, the invoke method is executed to send this event to all listening WebSockets.
ServiceHeartBeatSession.publish([ session.id ], { "verb": "created" });
However, the .publish method does not result in a event to an existing WebSocket. Unless I execute it myself in the console. The WebSocket is registered like this:
[COLOR=var(--tertiary-high)]io[/COLOR].socket.on([COLOR=var(--hljs-string)]'serviceheartbeatsession'[/COLOR], [COLOR=var(--primary-very-high)]function[/COLOR](resData) {
alert([COLOR=var(--hljs-string)]'Something changed!!!!'[/COLOR]);
});

I did some digging into the sourcecode and made some attempts at debugging this myself. Here’s what I’ve found so far:

  • Running the .publish call in the console produces the desired result.
  • It appears that the .addRoomMembersToRooms is a requirement for the .publish to work in the console. So I’m assuming that .addRoomMembersToRooms works as intended.
  • I tried the alternative below, but that doesn’t work in the controller. However, it does work in the Node console.

sails.sockets.broadcast([ ServiceHeartBeatSession._room(session.id) ], "serviceheartbeatsession", 'hi!');

  • The following works as intended, but I prefer not to use that.

sails.io.sockets.emit('serviceheartbeatsession', { verb: 'created' });

  • The above attempt lacked a room selection, so I dug a little deeper. The calls below where the result of a .publish method. However, only after repeating this in the console, it worked.
    var emitter = sails.io.sockets;
    emitter.in(‘sails_model_serviceheartbeatsession_5b6b26748377829d34983d67:serviceheartbeatsession’); // for example
    emitter.emit(‘serviceheartbeatsession’, { verb: “created” });

Check more information in the article: How to Build Node.js APIs with Sails.js | Adeva
Anyone have any ideas?

Filter