项目作者: ethand91

项目描述 :
Mediasoup 3 Simple WS Demo
高级语言: JavaScript
项目地址: git://github.com/ethand91/mediasoup3-wsdemo.git
创建时间: 2019-05-29T04:38:12Z
项目社区:https://github.com/ethand91/mediasoup3-wsdemo

开源协议:

下载


Mediasoup3 WS Demo


Simple Mediasoupv3 demo using HTML5 Websocket as ws module

How to use

  1. # Download the repo
  2. git clone https://github.com/ethand91/mediasoup3-wsdemo.git
  3. # Install server modules
  4. npm i
  5. # Install public side modules
  6. cd public
  7. npm i
  8. # Build the HTML source
  9. npm run build
  10. # Start the server
  11. npm start

Access: https://localhost:3000?options

Server ENV Options

Options to customize the server

Argument Type Explanation Example
REST_PORT number Port for the Koa REST server to listen on PORT=3000
LISTEN_IP string Ip for the socket server to listen on LISTEN_IP=0.0.0.0
LISTEN_PORT number Port for the socket server to listen on LISTEN_PORT=3001
CERT_FILE string Path to the certificate file CERT_FILE=./ssl/server.crt
KEY_FILE string Path to the key file KEY_FILE=./ssl/server.key

HTML URL Options

Options can be added to the end of the url to customize the session

Argument Type Explanation Example
roomId string(required) Unique room id, will be created if it doesn’t already exist ?roomId=room
peerId string(required) Unique user id ?peerId=peer
produce number 1 = produce a stream to mediasoup, anything other than 1 will not produce a stream ?produce=1
consume number 1 = consume streams from mediasoup, anything other than 1 will not consume any streams ?consume=1
videoCodec string video codec to use then producing video (default is vp8) ?videoCodec=h264

Example: https://localhost:3000?roomId=room&peerId=peer&produce=1&consume=1&videoCodec=h264