UNPKG

@skyway-sdk/core

Version:

The official Next Generation JavaScript SDK for SkyWay

55 lines 2.09 kB
"use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; Object.defineProperty(exports, "__esModule", { value: true }); exports.RemoteStreamBase = void 0; const common_1 = require("@skyway-sdk/common"); class RemoteStreamBase { /**@internal */ constructor(id, contentType) { this.id = id; this.contentType = contentType; this.side = 'remote'; /**@internal */ this._onConnectionStateChanged = new common_1.Event(); this._connectionState = 'new'; /**@internal */ this._getTransport = () => undefined; /**@internal */ this._getStats = () => __awaiter(this, void 0, void 0, function* () { return []; }); } /**@internal */ _setConnectionState(state) { if (this._connectionState === state) return; this._connectionState = state; this._onConnectionStateChanged.emit(state); } /**@internal */ _getRTCPeerConnection() { var _a; return (_a = this._getTransport()) === null || _a === void 0 ? void 0 : _a.rtcPeerConnection; } /**@internal */ _getConnectionState() { return this._connectionState; } /**@internal */ toJSON() { return { contentType: this.contentType, id: this.id, codec: this.codec, side: this.side, }; } } exports.RemoteStreamBase = RemoteStreamBase; //# sourceMappingURL=base.js.map