@snapcall/stream-ui 1.32.2 → 1.33.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -22
- package/dist/stream-ui.esm.js +8284 -11524
- package/dist/stream-ui.js +8246 -11486
- package/dist/types.d.ts +9 -59
- package/package.json +2 -8
package/README.md
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# SnapCall Stream UI
|
|
2
2
|
|
|
3
3
|
The Stream UI is a library that will help you to quickly integrate [SnapCall](https://www.snapcall.io/) on your application.
|
|
4
|
+
It allows you to join a call or record media.
|
|
4
5
|
|
|
5
6
|
## Installation
|
|
6
7
|
|
|
@@ -18,28 +19,25 @@ We also distrubute a UMD build of the package, which can be used directly in the
|
|
|
18
19
|
|
|
19
20
|
## Basic usage
|
|
20
21
|
|
|
22
|
+
Depending on your Stream token you will join a call or start a media recording session.
|
|
23
|
+
|
|
21
24
|
```js
|
|
22
25
|
import { streamUI } from '@snapcall/stream-ui';
|
|
23
26
|
|
|
24
27
|
const container = document.getElementById('container');
|
|
25
28
|
const roomToken = '123';
|
|
26
29
|
|
|
27
|
-
streamUI.
|
|
28
|
-
streamUI.joinRoom(roomToken);
|
|
30
|
+
streamUI.initV2({ element: container, token: roomToken });
|
|
29
31
|
```
|
|
30
32
|
|
|
31
33
|
## Methods
|
|
32
34
|
|
|
33
|
-
### `
|
|
35
|
+
### `initV2(options: InitOptions): void`
|
|
34
36
|
|
|
35
|
-
Initializes the UI
|
|
37
|
+
Initializes the UI and start the session.
|
|
36
38
|
|
|
37
39
|
See [InitOptions](#initoptions) for more details.
|
|
38
40
|
|
|
39
|
-
### `joinRoom(token: string): Promise<void>`
|
|
40
|
-
|
|
41
|
-
Joins a room.
|
|
42
|
-
|
|
43
41
|
### `leaveRoom(): void`
|
|
44
42
|
|
|
45
43
|
Leaves a room.
|
|
@@ -48,10 +46,6 @@ Leaves a room.
|
|
|
48
46
|
|
|
49
47
|
Terminates the room, all participants will be disconnected and the room won't be usable anymore.
|
|
50
48
|
|
|
51
|
-
### `generateToken(buttonId: string): Promise<string>`
|
|
52
|
-
|
|
53
|
-
Generate a room token with a SnapCall button ID.
|
|
54
|
-
|
|
55
49
|
### `sendNotification(message: string, options: NotificationOptions): void`
|
|
56
50
|
|
|
57
51
|
Send a notification (tooltip), see [NotificationOptions](#notificationoptions) for the options.
|
|
@@ -65,7 +59,6 @@ Send a notification (tooltip), see [NotificationOptions](#notificationoptions) f
|
|
|
65
59
|
element: HTMLElement;
|
|
66
60
|
sharedURL?: string;
|
|
67
61
|
audioTiles?: boolean;
|
|
68
|
-
settingsShortcuts?: { id: string, displayType: 'icon' | 'full' }[];
|
|
69
62
|
controls?: {
|
|
70
63
|
microphone?: ControlSettings;
|
|
71
64
|
camera?: ControlSettings;
|
|
@@ -93,17 +86,9 @@ The URL used for features such as "Open new tab" or "Quick Connect".
|
|
|
93
86
|
|
|
94
87
|
Enable audio-only tiles.
|
|
95
88
|
|
|
96
|
-
#### `settingsShortcuts`
|
|
97
|
-
|
|
98
|
-
##### Default value: `[]`
|
|
99
|
-
|
|
100
|
-
Specified options are added as a small shortcut next to the menu button.
|
|
101
|
-
Type are `full` or `icon`.
|
|
102
|
-
Possible id values are: `openNewTab`, `copyLink`, `quickConnect`, `settings` and `pip`.
|
|
103
|
-
|
|
104
89
|
#### `controls`
|
|
105
90
|
|
|
106
|
-
Allows to manage the available and enabled devices
|
|
91
|
+
Allows to manage the available and enabled devices for call.
|
|
107
92
|
|
|
108
93
|
```ts
|
|
109
94
|
type Device = 'microphone' | 'camera' | 'screenshare';
|