LivepeerEmitter is an EventEmitter class
export const LivePeerAPI = () => new LivepeerEmitter({ config: main, log });@param config
/*
Configuration store for the dependencies and frame config
*/
const env = process.env.NODE_ENV;
const homeDir = require('os').homedir();
const host = 'http://localhost';
const httpPort = '8935';
const rtmpPort = '1935';
const monitorHost = 'http://viz.livepeer.org:8081/metrics';
const frameConfig = [
{ framerate: 15, keyint: 75 },
{ framerate: 30, keyint: 150 },
{ framerate: 60, keyint: 300 }
];
export default {
main: { homeDir, frameConfig, rtmpPort, host, httpPort, monitorHost, env }
}@param log
log is used for debug purpose you can use js import log from 'electron-log'; in an electron context or build your own log.info function to fit your needs.
Constructor will start a loop to check if livepeer is running and emit two events
self.emit('loading', { type: 'delete/add', key: 1 });until the constructor send loading event with delete type livepeer is not running.
self.emit('peerCount', { peerCount });emit errors when livepeer stop via
self.emit('notifier', { error: 2 });emit errors when ffmpeg stop via
self.emit('notifier', { error: 3 });emit the current hlsStrmID
this.emit('broadcast', { hlsStrmID });