Finally entity capability implementation for XMPP is complete and is ready for review cycles. We have added the video discovery capability. As discussed in Part 1 after adding the receive capability and decoding it now we move forward for the sending part.
We need to send a c node along with the presence stanza to the user. We create a presence stanza like:
Now when a client receives this stanza it has to generate its own service capability stanza and send this to the user as a IQ result. Currently we use a generateServiceDiscovery() :
Service capability function
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
generateServiceDiscovery: function() {
let queryStanza = Stanza.node("query", null, {xmlns: "http://jabber.org/protocol/disco#info",
Now one of the prime task is to be able to actually detect our own video/audio devices and perform the video call only if the device is capable. For this we have used a callback method detectVideocapability() which detects the audio and video devices using mozGetUserMediaDevices and proceeds for the call only if the media devices are present.