UNPKG

@observertc/observer-js

Version:

Server Side NodeJS Library for processing ObserveRTC Samples

46 lines (45 loc) 1.24 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ObservedCodec = void 0; class ObservedCodec { timestamp; id; mimeType; _peerConnection; _visited = false; appData; payloadType; transportId; clockRate; channels; sdpFmtpLine; attachments; constructor(timestamp, id, mimeType, _peerConnection) { this.timestamp = timestamp; this.id = id; this.mimeType = mimeType; 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.payloadType = stats.payloadType; this.transportId = stats.transportId; this.clockRate = stats.clockRate; this.channels = stats.channels; this.sdpFmtpLine = stats.sdpFmtpLine; this.attachments = stats.attachments; } } exports.ObservedCodec = ObservedCodec;