Parcourir la source

doc: improve docs on external API constructor parameters

j8
Saúl Ibarra Corretgé il y a 8 ans
Parent
révision
dc2c49f4a9
1 fichiers modifiés avec 38 ajouts et 27 suppressions
  1. 38
    27
      doc/api.md

+ 38
- 27
doc/api.md Voir le fichier

@@ -10,45 +10,56 @@ To embed Jitsi Meet in your application you need to add the Jitsi Meet API libra
10 10
 <script src="https://meet.jit.si/external_api.js"></script>
11 11
 ```
12 12
 
13
-The next step for embedding Jitsi Meet is to create the Jitsi Meet API object:
14
-
15
-```javascript
16
-<script>
17
-    var domain = "meet.jit.si";
18
-    var room = "JitsiMeetAPIExample";
19
-    var width = 700;
20
-    var height = 700;
21
-    var api = new JitsiMeetExternalAPI(domain, room, width, height);
22
-</script>
23
-```
24
-
25
-You can use the above lines to indicate where exactly you want the Jitsi Meet conference to be placed in your HTML code,
26
-or you can specify the parent HTML element for the Jitsi Meet conference in the `JitsiMeetExternalAPI`
27
-constructor:
28
-
29
-```javascript
13
+## API
14
+
15
+### `api = new JitsiMeetExternalAPI(domain, room, [width], [height], [htmlElement], [configOverwite], [interfaceConfigOverwrite], [noSsl], [jwt])`
16
+
17
+The next step for embedding Jitsi Meet is to create the Jitsi Meet API object.
18
+Its constructor gets a number of options:
19
+
20
+* **domain**: domain used to build the conference URL, "meet.jit.si" for
21
+  example.
22
+* **room**: name of the room to join.
23
+* **width**: (optional) width for the iframe which will be created.
24
+* **height**: (optional) height for the iframe which will be created.
25
+* **htmlElement**: (optional) HTL DOM Element where the iframe will be added as
26
+  a child.
27
+* **configOverwite**: (optional) JS object with overrides for options defined in
28
+  [config.js].
29
+* **interfaceConfigOverwrite**: (optional) JS object with overrides for options
30
+  defined in [interface_config.js].
31
+* **noSsl**: (optional, defaults to true) Boolean indicating if the server
32
+  should be contacted using HTTP or HTTPS.
33
+* **jwt**: (optional) [JWT](https://jwt.io/) token.
34
+
35
+Example:
36
+
37
+```javascript
38
+var domain = "meet.jit.si";
39
+var room = "JitsiMeetAPIExample";
40
+var width = 700;
41
+var height = 700;
42
+var htmlElement = document.querySelector('#meet');
30 43
 var api = new JitsiMeetExternalAPI(domain, room, width, height, htmlElement);
31 44
 ```
32 45
 
33
-If you don't specify the room the user will enter in new conference with a random room name.
34
-
35
-You can overwrite options set in [config.js]() and [interface_config.js](). For example, to enable the film-strip-only interface mode and disable simulcast, you can use:
46
+You can overwrite options set in [config.js] and [interface_config.js].
47
+For example, to enable the film-strip-only interface mode, you can use:
36 48
 
37 49
 ```javascript
38
-var configOverwrite = {disableSimulcast: true};
39 50
 var interfaceConfigOverwrite = {filmStripOnly: true};
40
-var api = new JitsiMeetExternalAPI(domain, room, width, height, htmlElement, configOverwrite, interfaceConfigOverwrite);
51
+var api = new JitsiMeetExternalAPI(domain, room, width, height, undefined, undefined, interfaceConfigOverwrite);
41 52
 ```
42 53
 
43
-You can also pass jwt token to Jitsi Meet:
54
+You can also pass a jwt token to Jitsi Meet:
44 55
 
45 56
  ```javascript
46
- var jwt = "<jwt_token>";
47
- var noSsl = false;
48
- var api = new JitsiMeetExternalAPI(domain, room, width, height, htmlElement, configOverwrite, interfaceConfigOverwrite, noSsl, jwt);
57
+var jwt = "<jwt_token>";
58
+var noSsl = false;
59
+var api = new JitsiMeetExternalAPI(domain, room, width, height, htmlElement, configOverwrite, interfaceConfigOverwrite, noSsl, jwt);
49 60
  ```
50 61
 
51
-## Controlling the embedded Jitsi Meet Conference
62
+### Controlling the embedded Jitsi Meet Conference
52 63
 
53 64
 You can control the embedded Jitsi Meet conference using the `JitsiMeetExternalAPI` object by using `executeCommand`:
54 65
 

Chargement…
Annuler
Enregistrer