UNPKG

@simplito/privmx-webendpoint

Version:

PrivMX Web Endpoint library

54 lines (53 loc) 1.69 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.WebRtcConfig = void 0; class WebRtcConfig { // TMP IV static iv = "uMuF0aaCZ6+kLrwp"; // TMP key static key = "7c4ba0c3e256369f7c4ba0c3e256369f"; static iceTransportPolicy = "all"; static appServer = "localhost:8810"; static getIV() { return this.iv; } static getKey() { return this.key; } // Default turn servers static getTurnServers() { return ["turn:172.16.238.1:3478"]; } static getRTCIceTransportPolicy() { return this.iceTransportPolicy; } // public static generateTurnConfiguration(credentials: PeerCredentials|undefined) { // const servers: RTCIceServer[] = this.getTurnServers().map(x => ( // { // urls: x, // username: credentials && credentials.username ? credentials.username : undefined, // credential: credentials && credentials.password ? credentials.password : undefined // } // )); // return { // iceServers: servers, // iceTransportPolicy: this.iceTransportPolicy // } // } static generateTurnConfiguration(credentials) { return { iceServers: credentials.map((x) => { return { urls: x.url, username: x.username, credential: x.password, }; }), iceTransportPolicy: this.iceTransportPolicy, }; } static getAppServerAddress() { return this.appServer; } } exports.WebRtcConfig = WebRtcConfig;