Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import { remote } from "electron";
import { default as pino, Logger } from "pino";
import { v4 as uuid } from "uuid";
import {
createPeer,
createStream,
fireInputEvent,
forceH264Sdp,
getDesktopSources,
ISharedObject,
selectCaptureSource,
sharedObjectKeyName,
} from ".";
import { Signal } from "./signal";
const preloadLogger = pino();
// when our browser window as officially loaded, we'll begin
process.once("loaded", () => {
// we must get our shared state from the other process
const sharedObject = (remote.getGlobal(sharedObjectKeyName) as ISharedObject);
// we'll use the allowPreload flag to indicate to ourselves that we're on the first load of the page
// and should therefore be setting up webrtc and whatnot - we need this as preload scripts load each
// time the page inside the browser load changes (ie: a redirect, window reload, etc) and we want to persist
const allowPreload = sharedObject.allowPreload;
preloadLogger.info("loaded");
preloadLogger.info(`${allowPreload}`);
if (allowPreload) {
sharedObject.allowPreload = false;
}
import { config as configEnv } from "dotenv";
import { app, BrowserWindow } from "electron";
import {default as pino} from "pino";
import { createWindow, ISharedObject, sharedObjectKeyName } from ".";
const logger = pino();
logger.info(`working directory: ${process.cwd()}`);
/**
* Configure our environment variables from dotenv
* Supported:
* + SERVICE_URL (string) - the web service address (to render)
* + TURN_URL (string) - a turn address
* + TURN_USERNAME (string) - a turn username
* + TURN_PASSWORD (string) - a turn password credential
* + POLL_URL (string) - a signaling server base address
* + POLL_INTERVAL (number) - a signaling poll interval in ms
* + HEIGHT (number) - the window height
* + WIDTH (number) - the window width
* + EXP_HIDE_STREAMER (boolean) - experiment flag for hiding the streamer window
*/
const envParserStatus = configEnv();