Browse Source

feat(iframe_api): Add jwt token parameter

j8
hristoterezov 8 years ago
parent
commit
aeb301c8d5
2 changed files with 16 additions and 1 deletions
  1. 8
    0
      doc/api.md
  2. 8
    1
      modules/API/external/external_api.js

+ 8
- 0
doc/api.md View File

@@ -40,6 +40,14 @@ var interfaceConfigOverwrite = {filmStripOnly: true};
40 40
 var api = new JitsiMeetExternalAPI(domain, room, width, height, htmlElement, configOverwrite, interfaceConfigOverwrite);
41 41
 ```
42 42
 
43
+You can also pass jwt token to Jitsi Meet:
44
+
45
+ ```javascript
46
+ var jwt = "<jwt_token>";
47
+ var noSsl = false;
48
+ var api = new JitsiMeetExternalAPI(domain, room, width, height, htmlElement, configOverwrite, interfaceConfigOverwrite, noSsl, jwt);
49
+ ```
50
+
43 51
 ## Controlling the embedded Jitsi Meet Conference
44 52
 
45 53
 You can control the embedded Jitsi Meet conference using the `JitsiMeetExternalAPI` object by using `executeCommand`:

+ 8
- 1
modules/API/external/external_api.js View File

@@ -93,10 +93,12 @@ function changeParticipantNumber(APIInstance, number) {
93 93
  * @param interfaceConfigOverwrite object containing configuration options
94 94
  * defined in interface_config.js to be overridden.
95 95
  * @param noSsl if the value is true https won't be used
96
+ * @param {string} [jwt] the JWT token if needed by jitsi-meet for
97
+ * authentication.
96 98
  * @constructor
97 99
  */
98 100
 function JitsiMeetExternalAPI(domain, room_name, width, height, parentNode,
99
-    configOverwrite, interfaceConfigOverwrite, noSsl) {
101
+    configOverwrite, interfaceConfigOverwrite, noSsl, jwt) {
100 102
     if (!width || width < MIN_WIDTH)
101 103
         width = MIN_WIDTH;
102 104
     if (!height || height < MIN_HEIGHT)
@@ -121,6 +123,11 @@ function JitsiMeetExternalAPI(domain, room_name, width, height, parentNode,
121 123
     this.url = (noSsl) ? "http" : "https" +"://" + domain + "/";
122 124
     if(room_name)
123 125
         this.url += room_name;
126
+
127
+    if (jwt) {
128
+        this.url += '?jwt=' + jwt;
129
+    }
130
+
124 131
     this.url += "#jitsi_meet_external_api_id=" + id;
125 132
 
126 133
     var key;

Loading…
Cancel
Save