https://github.com/mconf/bfcp-server-js
https://github.com/mconf/bfcp-server-js
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/mconf/bfcp-server-js
- Owner: mconf
- Created: 2019-08-13T21:33:40.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2019-12-17T15:48:37.000Z (over 5 years ago)
- Last Synced: 2024-04-13T22:28:40.615Z (about 1 year ago)
- Language: JavaScript
- Size: 33.2 KB
- Stars: 1
- Watchers: 10
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# bfcp-server-js
bfcp-server-js is a simple application to handle user and conferences in
the Binary Floor Control Protocol environment.1. [BFCPServer](https://github.com/Scheffel-V/bfcp-server-js#BFCPServer)
## BFCPServer
**BFCPServer** class is the main class of this application, which is used to
_communicate_ with other applications. It fires events representing BFCP
messages.```javascript
const BfcpServer = require('bfcp-server-js');
const Logger;let bfcpServer = new BfcpServer(
{
'ip': '127.0.0.1',
'startingPort': 8000,
'logger': Logger
}
);let userId = 1;
let userPort;
let userIp;
let conferenceId = 1;
let protocol = 'UDP';/**
* You can start a new bfcp connection for a user in a conference.
* After this, BFCPServer can emit events depending on the
* BFCP messages received.
*/
bfcpServer.startBfcpConnection(
userId,
userPort,
userIp,
conferenceId,
protocol
);/**
* Expect for the BFCPServer events
*/
bfcpServer.on('FloorRequest', (body) => {
/**
* Here you can handle the Floor Request.
*/
let status = true;/**
* Then you can send a response.
*/
bfcpServer.floorRequestResponse(conferenceId, userId, status);
});bfcpServer.on('FloorRelease', (body) => {
/**
* Here you can handle the Floor Release.
*/
let conferenceId = 1;
let userId = 1;
let status = false;/**
* Then you can send a response.
*/
bfcpServer.floorRequestResponse(conferenceId, userId, false);
});/**
* You can stop the bfcp connection when you want.
*/
bfcpServer.stopBfcpConnection(userId);
```