|
|
@@ -8,6 +8,7 @@ var XMPPEvents = require("../../service/xmpp/XMPPEvents");
|
|
8
|
8
|
var JitsiConnectionErrors = require("../../JitsiConnectionErrors");
|
|
9
|
9
|
var JitsiConnectionEvents = require("../../JitsiConnectionEvents");
|
|
10
|
10
|
var RTC = require("../RTC/RTC");
|
|
|
11
|
+var RTCBrowserType = require("../RTC/RTCBrowserType");
|
|
11
|
12
|
|
|
12
|
13
|
var authenticatedUser = false;
|
|
13
|
14
|
|
|
|
@@ -44,6 +45,9 @@ function XMPP(options, token) {
|
|
44
|
45
|
|
|
45
|
46
|
this.connection = createConnection(options.bosh, token);
|
|
46
|
47
|
|
|
|
48
|
+ // Initialize features advertised in disco-info
|
|
|
49
|
+ this.initFeaturesList();
|
|
|
50
|
+
|
|
47
|
51
|
// Setup a disconnect on unload as a way to facilitate API consumers. It
|
|
48
|
52
|
// sounds like they would want that. A problem for them though may be if
|
|
49
|
53
|
// they wanted to utilize the connected connection in an unload handler of
|
|
|
@@ -52,6 +56,44 @@ function XMPP(options, token) {
|
|
52
|
56
|
$(window).on('beforeunload unload', this.disconnect.bind(this));
|
|
53
|
57
|
}
|
|
54
|
58
|
|
|
|
59
|
+/**
|
|
|
60
|
+ * Initializes the list of feature advertised through the disco-info mechanism
|
|
|
61
|
+ */
|
|
|
62
|
+XMPP.prototype.initFeaturesList = function () {
|
|
|
63
|
+ var disco = this.connection.disco;
|
|
|
64
|
+ if (disco) {
|
|
|
65
|
+ // http://xmpp.org/extensions/xep-0167.html#support
|
|
|
66
|
+ // http://xmpp.org/extensions/xep-0176.html#support
|
|
|
67
|
+ disco.addFeature('urn:xmpp:jingle:1');
|
|
|
68
|
+ disco.addFeature('urn:xmpp:jingle:apps:rtp:1');
|
|
|
69
|
+ disco.addFeature('urn:xmpp:jingle:transports:ice-udp:1');
|
|
|
70
|
+ disco.addFeature('urn:xmpp:jingle:apps:dtls:0');
|
|
|
71
|
+ disco.addFeature('urn:xmpp:jingle:transports:dtls-sctp:1');
|
|
|
72
|
+ disco.addFeature('urn:xmpp:jingle:apps:rtp:audio');
|
|
|
73
|
+ disco.addFeature('urn:xmpp:jingle:apps:rtp:video');
|
|
|
74
|
+
|
|
|
75
|
+ if (RTCBrowserType.isChrome() || RTCBrowserType.isOpera()
|
|
|
76
|
+ || RTCBrowserType.isTemasysPluginUsed()) {
|
|
|
77
|
+ disco.addFeature('urn:ietf:rfc:4588');
|
|
|
78
|
+ }
|
|
|
79
|
+
|
|
|
80
|
+ // this is dealt with by SDP O/A so we don't need to announce this
|
|
|
81
|
+ //disco.addFeature('urn:xmpp:jingle:apps:rtp:rtcp-fb:0'); // XEP-0293
|
|
|
82
|
+ //disco.addFeature('urn:xmpp:jingle:apps:rtp:rtp-hdrext:0'); // XEP-0294
|
|
|
83
|
+
|
|
|
84
|
+ disco.addFeature('urn:ietf:rfc:5761'); // rtcp-mux
|
|
|
85
|
+ disco.addFeature('urn:ietf:rfc:5888'); // a=group, e.g. bundle
|
|
|
86
|
+
|
|
|
87
|
+ //disco.addFeature('urn:ietf:rfc:5576'); // a=ssrc
|
|
|
88
|
+
|
|
|
89
|
+ // Enable Lipsync ?
|
|
|
90
|
+ if (this.options.enableLipSync && RTCBrowserType.isChrome()) {
|
|
|
91
|
+ logger.info("Lip-sync enabled !");
|
|
|
92
|
+ this.connection.disco.addFeature('http://jitsi.org/meet/lipsync');
|
|
|
93
|
+ }
|
|
|
94
|
+ }
|
|
|
95
|
+};
|
|
|
96
|
+
|
|
55
|
97
|
XMPP.prototype.getConnection = function () { return this.connection; };
|
|
56
|
98
|
|
|
57
|
99
|
/**
|