/* * gstwebrtc-api * * Copyright (C) 2022 Igalia S.L. * Author: Loïc Le Page * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ /** * GStreamer WebRTC configuration. *

The config can be passed on creation of the GstWebRTCAPI class.

*

For example: *

 *     const signalingProtocol = window.location.protocol.startsWith("https") ? "wss" : "ws";
 *     const api = new GstWebRTCAPI({
 *         meta: { name: `WebClient-${Date.now()}` },
 *         signalingServerUrl: `${signalingProtocol}://${window.location.host}/webrtc`
 *     });
 * 

* @typedef {object} GstWebRTCConfig * @property {object} meta=null - Client free-form information that will be exchanged with all peers through the * signaling meta property, its content depends on your application. * @property {string} signalingServerUrl=ws://127.0.0.1:8443 - The WebRTC signaling server URL. * @property {number} reconnectionTimeout=2500 - Timeout in milliseconds to reconnect to the signaling server in * case of an unexpected disconnection. * @property {object} webrtcConfig={iceServers...} - The WebRTC peer connection configuration passed to * {@link external:RTCPeerConnection}. Default configuration only includes a list of free STUN servers * (stun[0-4].l.google.com:19302). */ const defaultConfig = Object.freeze({ meta: null, signalingServerUrl: "ws://127.0.0.1:8443", reconnectionTimeout: 2500, webrtcConfig: { iceServers: [ { urls: [ "stun:stun.l.google.com:19302", "stun:stun1.l.google.com:19302" ] } ] } }); export { defaultConfig as default };