Переглянути джерело

Adds config options to the conference iq sent to the focus.

master
paweldomas 11 роки тому
джерело
коміт
6b968b1d14
1 змінених файлів з 35 додано та 7 видалено
  1. 35
    7
      moderator.js

+ 35
- 7
moderator.js Переглянути файл

@@ -1,5 +1,5 @@
1
-/* global $, $iq, config, connection, Etherpad, hangUp, Strophe, Toolbar,
2
-   Util, VideoLayout */
1
+/* global $, $iq, config, connection, Etherpad, hangUp, roomName, Strophe,
2
+ Toolbar, Util, VideoLayout */
3 3
 /**
4 4
  * Contains logic responsible for enabling/disabling functionality available
5 5
  * only to moderator users.
@@ -66,16 +66,43 @@ var Moderator = (function (my) {
66 66
         );
67 67
     };
68 68
 
69
-    // FIXME: we need to show the fact that we're waiting for the focus
70
-    // to the user(or that focus is not available)
71
-    my.allocateConferenceFocus = function (roomName, callback) {
69
+    my.createConferenceIq = function () {
72 70
         var elem = $iq({to: config.hosts.focus, type: 'set'});
73 71
         elem.c('conference', {
74 72
             xmlns: 'http://jitsi.org/protocol/focus',
75 73
             room: roomName
76 74
         });
75
+        if (config.channelLastN !== undefined)
76
+        {
77
+            elem.c(
78
+                'property',
79
+                { name: 'channelLastN', value: config.channelLastN})
80
+                .up();
81
+        }
82
+        if (config.adaptiveLastN !== undefined)
83
+        {
84
+            elem.c(
85
+                'property',
86
+                { name: 'adaptiveLastN', value: config.adaptiveLastN})
87
+                .up();
88
+        }
89
+        if (config.adaptiveSimulcast !== undefined)
90
+        {
91
+            elem.c(
92
+                'property',
93
+                { name: 'adaptiveSimulcast', value: config.adaptiveSimulcast})
94
+                .up();
95
+        }
77 96
         elem.up();
78
-        connection.sendIQ(elem,
97
+        return elem;
98
+    };
99
+
100
+    // FIXME: we need to show the fact that we're waiting for the focus
101
+    // to the user(or that focus is not available)
102
+    my.allocateConferenceFocus = function (roomName, callback) {
103
+        var iq = Moderator.createConferenceIq();
104
+        connection.sendIQ(
105
+            iq,
79 106
             function (result) {
80 107
                 if ('true' === $(result).find('conference').attr('ready')) {
81 108
                     // Reset both timers
@@ -89,7 +116,8 @@ var Moderator = (function (my) {
89 116
                     getNextErrorTimeout(true);
90 117
                     window.setTimeout(
91 118
                         function () {
92
-                            Moderator.allocateConferenceFocus(roomName, callback);
119
+                            Moderator.allocateConferenceFocus(
120
+                                roomName, callback);
93 121
                         }, waitMs);
94 122
                 }
95 123
             },

Завантаження…
Відмінити
Зберегти