You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
75 lines
1.1 KiB
75 lines
1.1 KiB
|
|
# Conferencing with Janus WebRTC Gateway
|
|
|
|
Node.js client that implements a subset of the WebSocket interface of the Janus WebRTC Gateway.
|
|
|
|
Note: For now it supports the videoroom plugin only.
|
|
|
|
## Initial setup
|
|
|
|
```javascript
|
|
var JanusVideoroomClient = require('janus-videoroom-client').Janus;
|
|
```
|
|
|
|
Without authentication
|
|
|
|
```javascript
|
|
var client = new JanusVideoroomClient({
|
|
url: 'ws://localhost:8188'
|
|
});
|
|
```
|
|
|
|
Token based authentication
|
|
|
|
```javascript
|
|
var client = new JanusVideoroomClient({
|
|
url: 'ws://localhost:8188',
|
|
token: 'yourToken'
|
|
});
|
|
```
|
|
|
|
Static secret authentication
|
|
|
|
```javascript
|
|
var client = new JanusVideoroomClient({
|
|
url: 'ws://localhost:8188',
|
|
apiSecret: 'yourStaticSecret'
|
|
});
|
|
```
|
|
|
|
## Usage
|
|
|
|
Create a new janus session
|
|
|
|
```javascript
|
|
client.createSession().then((session)=>{
|
|
...
|
|
}).catch((err)=>{
|
|
...
|
|
});
|
|
```
|
|
|
|
Create a new videoroom handle
|
|
|
|
```javascript
|
|
client.createSession().then((session)=>{
|
|
return session.createVideoRoomHandle();
|
|
}).then((handle)=>{
|
|
...
|
|
}).catch((err)=>{
|
|
...
|
|
});
|
|
```
|
|
|
|
## Run tests
|
|
|
|
npm test
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|