UNPKG

@observertc/observer-js

Version:

Server Side NodeJS Library for processing ObserveRTC Samples

60 lines (59 loc) 1.67 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ObservedIceCandidate = void 0; class ObservedIceCandidate { timestamp; id; _peerConnection; _visited = false; appData; transportId; address; port; protocol; candidateType; priority; url; relayProtocol; foundation; relatedAddress; relatedPort; usernameFragment; tcpType; attachments; constructor(timestamp, id, _peerConnection) { this.timestamp = timestamp; this.id = id; this._peerConnection = _peerConnection; } get visited() { const visited = this._visited; this._visited = false; return visited; } getPeerConnection() { return this._peerConnection; } getIceTransport() { return this._peerConnection.observedIceTransports.get(this.transportId ?? ''); } update(stats) { this._visited = true; this.timestamp = stats.timestamp; this.transportId = stats.transportId; this.address = stats.address; this.port = stats.port; this.protocol = stats.protocol; this.candidateType = stats.candidateType; this.priority = stats.priority; this.url = stats.url; this.relayProtocol = stats.relayProtocol; this.foundation = stats.foundation; this.relatedAddress = stats.relatedAddress; this.relatedPort = stats.relatedPort; this.usernameFragment = stats.usernameFragment; this.tcpType = stats.tcpType; this.attachments = stats.attachments; } } exports.ObservedIceCandidate = ObservedIceCandidate;