@dtelecom/livekit-client 1.12.5 → 1.12.6
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 -51
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,53 +1,29 @@
|
|
|
1
|
-
|
|
2
|
-
<picture>
|
|
3
|
-
<source media="(prefers-color-scheme: dark)" srcset="/.github/banner_dark.png">
|
|
4
|
-
<source media="(prefers-color-scheme: light)" srcset="/.github/banner_light.png">
|
|
5
|
-
<img style="width:100%;" alt="The LiveKit icon, the name of the repository and some sample code in the background." src="/.github/banner_light.png">
|
|
6
|
-
</picture>
|
|
7
|
-
<!--END_BANNER_IMAGE-->
|
|
8
|
-
|
|
9
|
-
# JavaScript/TypeScript client SDK for LiveKit
|
|
10
|
-
|
|
11
|
-
<!--BEGIN_DESCRIPTION-->Use this SDK to add real-time video, audio and data features to your JavaScript/TypeScript app. By connecting to a self- or cloud-hosted <a href="https://livekit.io/">LiveKit</a> server, you can quickly build applications like interactive live streaming or video calls with just a few lines of code.<!--END_DESCRIPTION-->
|
|
1
|
+
# JavaScript/TypeScript client SDK
|
|
12
2
|
|
|
13
3
|
## Docs
|
|
14
4
|
|
|
15
|
-
Docs and guides at [https://docs.
|
|
16
|
-
|
|
17
|
-
[SDK reference](https://docs.livekit.io/client-sdk-js/)
|
|
5
|
+
Docs and guides at [https://docs.dtelecom.org](https://docs.dtelecom.org)
|
|
18
6
|
|
|
19
7
|
## Installation
|
|
20
8
|
|
|
21
9
|
### Yarn
|
|
22
10
|
|
|
23
11
|
```shell
|
|
24
|
-
yarn add livekit-client
|
|
12
|
+
yarn add @dtelecom/livekit-client
|
|
25
13
|
```
|
|
26
14
|
|
|
27
15
|
### NPM
|
|
28
16
|
|
|
29
17
|
```shell
|
|
30
|
-
npm install livekit-client --save
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
### Minified JS
|
|
34
|
-
|
|
35
|
-
To use the SDK without a package manager, you can include it with a script tag:
|
|
36
|
-
|
|
37
|
-
```html
|
|
38
|
-
<script src="https://cdn.jsdelivr.net/npm/livekit-client/dist/livekit-client.umd.min.js"></script>
|
|
18
|
+
npm install @dtelecom/livekit-client --save
|
|
39
19
|
```
|
|
40
20
|
|
|
41
|
-
The module will be exported under `LivekitClient` in the global namespace. When
|
|
42
|
-
accessing symbols from the class, you'd need to prefix them with `LivekitClient.`.
|
|
43
|
-
For example, `Room` becomes `LivekitClient.Room`.
|
|
44
|
-
|
|
45
21
|
## Usage
|
|
46
22
|
|
|
47
23
|
Examples below are in TypeScript, if using JS/CommonJS imports replace import with:
|
|
48
24
|
|
|
49
25
|
```javascript
|
|
50
|
-
const livekit = require('livekit-client');
|
|
26
|
+
const livekit = require('@dtelecom/livekit-client');
|
|
51
27
|
|
|
52
28
|
const room = new livekit.Room(...);
|
|
53
29
|
await room.connect(...);
|
|
@@ -63,7 +39,7 @@ import {
|
|
|
63
39
|
RemoteTrackPublication,
|
|
64
40
|
Room,
|
|
65
41
|
RoomEvent,
|
|
66
|
-
} from 'livekit-client';
|
|
42
|
+
} from '@dtelecom/livekit-client';
|
|
67
43
|
|
|
68
44
|
// creates a new room with options
|
|
69
45
|
const room = new Room({
|
|
@@ -131,7 +107,7 @@ function handleDisconnect() {
|
|
|
131
107
|
|
|
132
108
|
In order to connect to a room, you need to first create an access token.
|
|
133
109
|
|
|
134
|
-
See [access token docs](https://docs.
|
|
110
|
+
See [access token docs](https://docs.dtelecom.org/guides/access-tokens) for details
|
|
135
111
|
|
|
136
112
|
### Handling common track types
|
|
137
113
|
|
|
@@ -282,12 +258,6 @@ setLogExtension((level: LogLevel, msg: string, context: object) => {
|
|
|
282
258
|
});
|
|
283
259
|
```
|
|
284
260
|
|
|
285
|
-
## Examples
|
|
286
|
-
|
|
287
|
-
### SDK Sample
|
|
288
|
-
|
|
289
|
-
[example/sample.ts](example/sample.ts) contains a demo webapp that uses the SDK. Run it with `yarn sample`
|
|
290
|
-
|
|
291
261
|
## Browser Support
|
|
292
262
|
|
|
293
263
|
| Browser | Desktop OS | Mobile OS |
|
|
@@ -307,17 +277,3 @@ You can have a look at the `"browerslist"` section of `package.json` for more de
|
|
|
307
277
|
If you are targeting legacy browsers, but still want adaptiveStream functionality you'll likely need to use polyfills for [ResizeObserver](https://www.npmjs.com/package/resize-observer-polyfill) and [IntersectionObserver](https://www.npmjs.com/package/intersection-observer).
|
|
308
278
|
|
|
309
279
|
Also when targeting legacy browsers, older than the ones specified in our browserslist target, make sure to transpile the library code to your desired target and include required polyfills with babel and/or corejs.
|
|
310
|
-
|
|
311
|
-
<!--BEGIN_REPO_NAV-->
|
|
312
|
-
|
|
313
|
-
<br/><table>
|
|
314
|
-
|
|
315
|
-
<thead><tr><th colspan="2">LiveKit Ecosystem</th></tr></thead>
|
|
316
|
-
<tbody>
|
|
317
|
-
<tr><td>Client SDKs</td><td><a href="https://github.com/livekit/components-js">Components</a> · <b>JavaScript</b> · <a href="https://github.com/livekit/client-sdk-rust">Rust</a> · <a href="https://github.com/livekit/client-sdk-swift">iOS/macOS</a> · <a href="https://github.com/livekit/client-sdk-android">Android</a> · <a href="https://github.com/livekit/client-sdk-flutter">Flutter</a> · <a href="https://github.com/livekit/client-sdk-unity-web">Unity (web)</a> · <a href="https://github.com/livekit/client-sdk-python">Python</a> · <a href="https://github.com/livekit/client-sdk-react-native">React Native (beta)</a></td></tr><tr></tr>
|
|
318
|
-
<tr><td>Server SDKs</td><td><a href="https://github.com/livekit/server-sdk-js">Node.js</a> · <a href="https://github.com/livekit/server-sdk-go">Golang</a> · <a href="https://github.com/livekit/server-sdk-ruby">Ruby</a> · <a href="https://github.com/livekit/server-sdk-kotlin">Java/Kotlin</a> · <a href="https://github.com/agence104/livekit-server-sdk-php">PHP (community)</a> · <a href="https://github.com/tradablebits/livekit-server-sdk-python">Python (community)</a></td></tr><tr></tr>
|
|
319
|
-
<tr><td>Services</td><td><a href="https://github.com/livekit/livekit">Livekit server</a> · <a href="https://github.com/livekit/egress">Egress</a> · <a href="https://github.com/livekit/ingress">Ingress</a></td></tr><tr></tr>
|
|
320
|
-
<tr><td>Resources</td><td><a href="https://docs.livekit.io">Docs</a> · <a href="https://github.com/livekit-examples">Example apps</a> · <a href="https://livekit.io/cloud">Cloud</a> · <a href="https://docs.livekit.io/oss/deployment">Self-hosting</a> · <a href="https://github.com/livekit/livekit-cli">CLI</a></td></tr>
|
|
321
|
-
</tbody>
|
|
322
|
-
</table>
|
|
323
|
-
<!--END_REPO_NAV-->
|