WebRTC Video Chat Plugin for ChatEngine
Adds the ability to do WebRTC audio/video with ChatEngine using
direct events for signaling
- Have a ChatEngine server running already, instantiate a client and connect it
const ChatEngine = ChatEngineCore;ChatEngine;ChatEngine;
- Set WebRTC configuration and event handlers for WebRTC related events
const rtcConfig =iceServers: // See;let localStream;
- Set configuration and attach this plugin to the
const config =rtcConfig // An RTCConfiguration dictionary from the browser WebRTC APIignoreNonTurn: false // Only accept TURN candidates when this is truemyStream: localStream // Local MediaStream object from the browser Media Streams APIonPeerStream // Event HandleronIncomingCall // Event HandleronCallResponse // Event HandleronDisconnect // Event Handler;const webRTC = ChatEngineCoreplugin'chat-engine-webrtc';ChatEngineme;
- Send a call request to another user
const userToCall = aChatEngineUserObject;ChatEnginemewebRTC;
Frequently Asked Questions (FAQ) about the WebRTC Plugin
What is WebRTC?
WebRTC is a free and open source project that enables web browsers and mobile devices to provide a simple real-time communication API. Please read this PubNub blog to learn more about WebRTC and how to implement the code in this repository.
What is ChatEngine?
What is PubNub? Why is PubNub relevant to WebRTC?
PubNub is a global Data Stream Network (DSN) and realtime network-as-a-service. PubNub's primary product is a realtime publish/subscribe messaging API built on a global data stream network which is made up of a replicated network with multiple points of presence around the world.
PubNub is a low cost, easy to use, infrastructure API that can be implemented rapidly as a WebRTC signaling service. The signaling service is responsible for delivering messages to WebRTC peer clients. See the next question for the specific signals that PubNub's publish/subscribe API handles.
Does ChatEngine stream audio or video data?
No. ChatEngine pairs very well with WebRTC as a signaling service. This means that PubNub signals events from client to client using the ChatEngine #direct events. These events include:
- I, User A, would like to call you, User B
- User A is currently trying to call you, User B
- I, User B, accept your call User A
- I, User B, reject your call User A
- I, User B, would like to end our call User A
- I, User A, would like to end our call User B
- Text instant messaging like in Slack, Google Hangouts, Skype, Facebook Messenger, etc.
Is this repository's plugin officially part of ChatEngine?
No. It is an open source project that is community supported. If you want to report a bug, do so on the GitHub Issues page.
Can I make a group call with more than 2 participants?
Group calling is possible to develop with WebRTC and ChatEngine, however, the current ChatEngine WebRTC plugin can connect only 2 users in a private call. The community may develop this feature in the future but there are no plans for development to date.
I found a bug in the plugin. Where do I report it?
The ChatEngine WebRTC plugin is an open source, community supported project. This means that the best place to report bugs is on the GitHub Issues page in for the code repository. The community will tackle the bug fix at will, so there is no guarantee that a fix will be made. If you wish to provide a code fix, fork the GitHub repository to your GitHub account, push fixes, and make a pull request (process documented on GitHub).