How to use medooze-media-server - 10 common examples

To help you get started, we’ve selected a few medooze-media-server examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github medooze / media-server-demo-node / index.js View on Github external
const url = require ('url');
const fs = require ('fs');
const path = require ('path');
const WebSocketServer = require ('websocket').server;

//Get the Medooze Media Server interface
const MediaServer = require("medooze-media-server");

//Check 
if (process.argv.length!=3)
	 throw new Error("Missing IP address\nUsage: node index.js ");
//Get ip
const ip = process.argv[2];

//Create UDP server endpoint
const endpoint = MediaServer.createEndpoint(ip);

const base = 'www';

const options = {
	key: fs.readFileSync ('server.key'),
	cert: fs.readFileSync ('server.cert')
};

//Enable debug
MediaServer.enableDebug(false);
MediaServer.enableUltraDebug(false);

//Restrict port range
MediaServer.setPortRange(10000,20000);

// maps file extention to MIME typere
github medooze / media-server-client-js / demo / index.js View on Github external
const fs = require ('fs');
const path = require ('path');
const WebSocketServer = require ('websocket').server;
const PeerConnectionServerDemo = require('./lib/PeerConnectionServerDemo');

//Get the Medooze Media Server interface
const MediaServer = require("medooze-media-server");

//Check 
if (process.argv.length!=3)
	 throw new Error("Missing IP address\nUsage: node index.js ");
//Get ip
const ip = process.argv[2];

//Create UDP server endpoint
const endpoint = MediaServer.createEndpoint(ip);

const base = 'www';

const options = {
	key: fs.readFileSync ('server.key'),
	cert: fs.readFileSync ('server.cert')
};

//Enable debug
MediaServer.enableDebug(true);
MediaServer.enableUltraDebug(true);

//Restrict port range
MediaServer.setPortRange(10000,20000);

// maps file extention to MIME typere
github medooze / media-server-client-js / demo / index.js View on Github external
throw new Error("Missing IP address\nUsage: node index.js ");
//Get ip
const ip = process.argv[2];

//Create UDP server endpoint
const endpoint = MediaServer.createEndpoint(ip);

const base = 'www';

const options = {
	key: fs.readFileSync ('server.key'),
	cert: fs.readFileSync ('server.cert')
};

//Enable debug
MediaServer.enableDebug(true);
MediaServer.enableUltraDebug(true);

//Restrict port range
MediaServer.setPortRange(10000,20000);

// maps file extention to MIME typere
const map = {
	'.ico': 'image/x-icon',
	'.html': 'text/html',
	'.js': 'text/javascript',
	'.json': 'application/json',
	'.css': 'text/css',
	'.png': 'image/png',
	'.jpg': 'image/jpeg',
	'.wav': 'audio/wav',
	'.mp3': 'audio/mpeg',
github medooze / media-server-demo-node / index.js View on Github external
throw new Error("Missing IP address\nUsage: node index.js ");
//Get ip
const ip = process.argv[2];

//Create UDP server endpoint
const endpoint = MediaServer.createEndpoint(ip);

const base = 'www';

const options = {
	key: fs.readFileSync ('server.key'),
	cert: fs.readFileSync ('server.cert')
};

//Enable debug
MediaServer.enableDebug(false);
MediaServer.enableUltraDebug(false);

//Restrict port range
MediaServer.setPortRange(10000,20000);

// maps file extention to MIME typere
const map = {
	'.ico': 'image/x-icon',
	'.html': 'text/html',
	'.js': 'text/javascript',
	'.json': 'application/json',
	'.css': 'text/css',
	'.png': 'image/png',
	'.jpg': 'image/jpeg',
	'.wav': 'audio/wav',
	'.mp3': 'audio/mpeg',
github medooze / media-server-client-js / demo / index.js View on Github external
//Get ip
const ip = process.argv[2];

//Create UDP server endpoint
const endpoint = MediaServer.createEndpoint(ip);

const base = 'www';

const options = {
	key: fs.readFileSync ('server.key'),
	cert: fs.readFileSync ('server.cert')
};

//Enable debug
MediaServer.enableDebug(true);
MediaServer.enableUltraDebug(true);

//Restrict port range
MediaServer.setPortRange(10000,20000);

// maps file extention to MIME typere
const map = {
	'.ico': 'image/x-icon',
	'.html': 'text/html',
	'.js': 'text/javascript',
	'.json': 'application/json',
	'.css': 'text/css',
	'.png': 'image/png',
	'.jpg': 'image/jpeg',
	'.wav': 'audio/wav',
	'.mp3': 'audio/mpeg',
	'.svg': 'image/svg+xml',
github medooze / media-server-demo-node / index.js View on Github external
//Get ip
const ip = process.argv[2];

//Create UDP server endpoint
const endpoint = MediaServer.createEndpoint(ip);

const base = 'www';

const options = {
	key: fs.readFileSync ('server.key'),
	cert: fs.readFileSync ('server.cert')
};

//Enable debug
MediaServer.enableDebug(false);
MediaServer.enableUltraDebug(false);

//Restrict port range
MediaServer.setPortRange(10000,20000);

// maps file extention to MIME typere
const map = {
	'.ico': 'image/x-icon',
	'.html': 'text/html',
	'.js': 'text/javascript',
	'.json': 'application/json',
	'.css': 'text/css',
	'.png': 'image/png',
	'.jpg': 'image/jpeg',
	'.wav': 'audio/wav',
	'.mp3': 'audio/mpeg',
	'.svg': 'image/svg+xml',
github medooze / media-server-demo-node / index.js View on Github external
//Create UDP server endpoint
const endpoint = MediaServer.createEndpoint(ip);

const base = 'www';

const options = {
	key: fs.readFileSync ('server.key'),
	cert: fs.readFileSync ('server.cert')
};

//Enable debug
MediaServer.enableDebug(false);
MediaServer.enableUltraDebug(false);

//Restrict port range
MediaServer.setPortRange(10000,20000);

// maps file extention to MIME typere
const map = {
	'.ico': 'image/x-icon',
	'.html': 'text/html',
	'.js': 'text/javascript',
	'.json': 'application/json',
	'.css': 'text/css',
	'.png': 'image/png',
	'.jpg': 'image/jpeg',
	'.wav': 'audio/wav',
	'.mp3': 'audio/mpeg',
	'.svg': 'image/svg+xml',
	'.pdf': 'application/pdf',
	'.doc': 'application/msword'
};
github medooze / media-server-client-js / demo / index.js View on Github external
//Create UDP server endpoint
const endpoint = MediaServer.createEndpoint(ip);

const base = 'www';

const options = {
	key: fs.readFileSync ('server.key'),
	cert: fs.readFileSync ('server.cert')
};

//Enable debug
MediaServer.enableDebug(true);
MediaServer.enableUltraDebug(true);

//Restrict port range
MediaServer.setPortRange(10000,20000);

// maps file extention to MIME typere
const map = {
	'.ico': 'image/x-icon',
	'.html': 'text/html',
	'.js': 'text/javascript',
	'.json': 'application/json',
	'.css': 'text/css',
	'.png': 'image/png',
	'.jpg': 'image/jpeg',
	'.wav': 'audio/wav',
	'.mp3': 'audio/mpeg',
	'.svg': 'image/svg+xml',
	'.pdf': 'application/pdf',
	'.doc': 'application/msword'
};
github medooze / sfu / lib / Room.js View on Github external
{ "id": "ccm", "params": ["fir"]},
					{ "id": "nack"},
					{ "id": "nack", "params": ["pli"]},
				],
				extensions	: [ "http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01", "urn:3gpp:video-orientation"]
			}
		};
		
		//No participants
		this.max = 0;
		
		//Create event emitter
		this.emitter = new EventEmitter();
		
		//Active speaker detection
		this.activeSpeakerDetector = MediaServer.createActiveSpeakerDetector();
		
		//When new speaker detected
		this.activeSpeakerDetector.on("activespeakerchanged",(track)=>{
			//Get active speaker id
			const speakerId = track.participant.getId();
			//Check if it is the same as current one
			if (this.speakerId===speakerId)
				//Do nothing
				return;
			//Update speaker
			this.speakerId = speakerId;
			//Relaunch event
			this.emitter.emit("activespeakerchanged",track.participant,track);
		});
		//Create uri
		this.uri = ["rooms",id];
github webrtc / KITE / KITE-Multi-Simul-cast-Test / server / simulcast / src / server / config / init.js View on Github external
export const initConfig = async rawConfig => {
  const {
    debug,
    keyPath,
    certPath,
    httpPort,
    httpsPort,
    staticDir,
    serverAddress
  } = rawConfig

  const key = await readFile(keyPath)
  const cert = await readFile(certPath)

  const endpoint = MediaServer.createEndpoint(serverAddress)

  const simulcastSessionTable = new Map()
  const broadcastSessionTable = new Map()

  if (debug) {
    MediaServer.enableDebug(true)
  }

  return {
    key,
    cert,
    endpoint,
    httpPort,
    httpsPort,
    staticDir,
    serverAddress,