UNPKG

@huddle01/web-core

Version:

The Huddle01 Javascript SDK offers a comprehensive suite of methods and event listeners that allow for seamless real-time audio and video communication with minimal coding required.

1,597 lines (1,594 loc) 69.1 kB
import { GeolocationSchema } from './chunk-NTD5WULD.js'; import { apiCallWithRetry } from './chunk-UNAM3CMB.js'; import { Permissions, ProtoTransportSDPInfo, AppData, ProtoSctpStreamParameters, ProtoIceParameters, Request, ProtoRequestEvent } from './chunk-SJ5FMYZU.js'; import { Message, proto3, proto2, ProtoRtpParameters } from './chunk-DFNYORIF.js'; import { isReactNative } from './chunk-WA3QABYS.js'; import { mainLogger } from './chunk-TOCFOGTC.js'; import { EnhancedEventEmitter } from './chunk-BW2DGP4D.js'; // ../types/dist/socket.types.js var ESocketCloseCode; (function(ESocketCloseCode2) { ESocketCloseCode2[ESocketCloseCode2["ABNORMAL_CLOSURE"] = 1006] = "ABNORMAL_CLOSURE"; ESocketCloseCode2[ESocketCloseCode2["NORMAL_CLOSURE"] = 1e3] = "NORMAL_CLOSURE"; ESocketCloseCode2[ESocketCloseCode2["BROWSER_TAB_CLOSE"] = 1001] = "BROWSER_TAB_CLOSE"; ESocketCloseCode2[ESocketCloseCode2["GOING_AWAY"] = 4001] = "GOING_AWAY"; ESocketCloseCode2[ESocketCloseCode2["CONNECTION_EXPIRED"] = 4002] = "CONNECTION_EXPIRED"; ESocketCloseCode2[ESocketCloseCode2["CONNECTION_ERROR"] = 4006] = "CONNECTION_ERROR"; ESocketCloseCode2[ESocketCloseCode2["ROOM_CLOSED"] = 4007] = "ROOM_CLOSED"; ESocketCloseCode2[ESocketCloseCode2["ROOM_ENTRY_DENIED"] = 4008] = "ROOM_ENTRY_DENIED"; ESocketCloseCode2[ESocketCloseCode2["KICKED"] = 4009] = "KICKED"; ESocketCloseCode2[ESocketCloseCode2["MAX_PEERS_REACHED"] = 4010] = "MAX_PEERS_REACHED"; ESocketCloseCode2[ESocketCloseCode2["ROOM_EXPIRED"] = 4011] = "ROOM_EXPIRED"; })(ESocketCloseCode || (ESocketCloseCode = {})); var SocketCloseReason = { [ESocketCloseCode.ROOM_CLOSED]: "ROOM_CLOSED", [ESocketCloseCode.ABNORMAL_CLOSURE]: "ABNORMAL_CLOSURE", [ESocketCloseCode.NORMAL_CLOSURE]: "NORMAL_CLOSURE", [ESocketCloseCode.BROWSER_TAB_CLOSE]: "BROWSER_TAB_CLOSE", [ESocketCloseCode.GOING_AWAY]: "GOING_AWAY", [ESocketCloseCode.CONNECTION_ERROR]: "CONNECTION_ERROR", [ESocketCloseCode.CONNECTION_EXPIRED]: "CONNECTION_EXPIRED", [ESocketCloseCode.ROOM_ENTRY_DENIED]: "ROOM_ENTRY_DENIED", [ESocketCloseCode.KICKED]: "KICKED", [ESocketCloseCode.MAX_PEERS_REACHED]: "MAX_PEERS_REACHED", [ESocketCloseCode.ROOM_EXPIRED]: "ROOM_EXPIRED" }; // ../protoc/dist/rtc/rtp_capabilities_pb.js var ProtoRtpCodecCapability = class _ProtoRtpCodecCapability extends Message { /** * @generated from field: string kind = 1; */ kind = ""; /** * @generated from field: string mimeType = 2; */ mimeType = ""; /** * @generated from field: int32 preferredPayloadType = 3; */ preferredPayloadType = 0; /** * @generated from field: int32 clockRate = 4; */ clockRate = 0; /** * @generated from field: int32 channels = 5; */ channels = 0; /** * @generated from field: map<string, string> parameters = 6; */ parameters = {}; /** * @generated from field: repeated ProtoRtpCodecCapability.ProtoRtcpFeedback rtcpFeedback = 7; */ rtcpFeedback = []; constructor(data) { super(); proto3.util.initPartial(data, this); } static runtime = proto3; static typeName = "ProtoRtpCodecCapability"; static fields = proto3.util.newFieldList(() => [ { no: 1, name: "kind", kind: "scalar", T: 9 /* ScalarType.STRING */ }, { no: 2, name: "mimeType", kind: "scalar", T: 9 /* ScalarType.STRING */ }, { no: 3, name: "preferredPayloadType", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, { no: 4, name: "clockRate", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, { no: 5, name: "channels", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, { no: 6, name: "parameters", kind: "map", K: 9, V: { kind: "scalar", T: 9 /* ScalarType.STRING */ } }, { no: 7, name: "rtcpFeedback", kind: "message", T: ProtoRtpCodecCapability_ProtoRtcpFeedback, repeated: true } ]); static fromBinary(bytes, options) { return new _ProtoRtpCodecCapability().fromBinary(bytes, options); } static fromJson(jsonValue, options) { return new _ProtoRtpCodecCapability().fromJson(jsonValue, options); } static fromJsonString(jsonString, options) { return new _ProtoRtpCodecCapability().fromJsonString(jsonString, options); } static equals(a, b) { return proto3.util.equals(_ProtoRtpCodecCapability, a, b); } }; var ProtoRtpCodecCapability_ProtoRtcpFeedback = class _ProtoRtpCodecCapability_ProtoRtcpFeedback extends Message { /** * @generated from field: string type = 1; */ type = ""; /** * @generated from field: string parameter = 2; */ parameter = ""; constructor(data) { super(); proto3.util.initPartial(data, this); } static runtime = proto3; static typeName = "ProtoRtpCodecCapability.ProtoRtcpFeedback"; static fields = proto3.util.newFieldList(() => [ { no: 1, name: "type", kind: "scalar", T: 9 /* ScalarType.STRING */ }, { no: 2, name: "parameter", kind: "scalar", T: 9 /* ScalarType.STRING */ } ]); static fromBinary(bytes, options) { return new _ProtoRtpCodecCapability_ProtoRtcpFeedback().fromBinary(bytes, options); } static fromJson(jsonValue, options) { return new _ProtoRtpCodecCapability_ProtoRtcpFeedback().fromJson(jsonValue, options); } static fromJsonString(jsonString, options) { return new _ProtoRtpCodecCapability_ProtoRtcpFeedback().fromJsonString(jsonString, options); } static equals(a, b) { return proto3.util.equals(_ProtoRtpCodecCapability_ProtoRtcpFeedback, a, b); } }; var ProtoRtpHeaderExtension = class _ProtoRtpHeaderExtension extends Message { /** * @generated from field: string kind = 1; */ kind = ""; /** * @generated from field: string uri = 2; */ uri = ""; /** * @generated from field: int32 preferredId = 3; */ preferredId = 0; /** * @generated from field: bool preferredEncrypt = 4; */ preferredEncrypt = false; /** * @generated from field: string direction = 5; */ direction = ""; constructor(data) { super(); proto3.util.initPartial(data, this); } static runtime = proto3; static typeName = "ProtoRtpHeaderExtension"; static fields = proto3.util.newFieldList(() => [ { no: 1, name: "kind", kind: "scalar", T: 9 /* ScalarType.STRING */ }, { no: 2, name: "uri", kind: "scalar", T: 9 /* ScalarType.STRING */ }, { no: 3, name: "preferredId", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, { no: 4, name: "preferredEncrypt", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, { no: 5, name: "direction", kind: "scalar", T: 9 /* ScalarType.STRING */ } ]); static fromBinary(bytes, options) { return new _ProtoRtpHeaderExtension().fromBinary(bytes, options); } static fromJson(jsonValue, options) { return new _ProtoRtpHeaderExtension().fromJson(jsonValue, options); } static fromJsonString(jsonString, options) { return new _ProtoRtpHeaderExtension().fromJsonString(jsonString, options); } static equals(a, b) { return proto3.util.equals(_ProtoRtpHeaderExtension, a, b); } }; var ProtoRtpCapabilities = class _ProtoRtpCapabilities extends Message { /** * @generated from field: repeated ProtoRtpCodecCapability codecs = 1; */ codecs = []; /** * @generated from field: repeated ProtoRtpHeaderExtension headerExtensions = 2; */ headerExtensions = []; constructor(data) { super(); proto3.util.initPartial(data, this); } static runtime = proto3; static typeName = "ProtoRtpCapabilities"; static fields = proto3.util.newFieldList(() => [ { no: 1, name: "codecs", kind: "message", T: ProtoRtpCodecCapability, repeated: true }, { no: 2, name: "headerExtensions", kind: "message", T: ProtoRtpHeaderExtension, repeated: true } ]); static fromBinary(bytes, options) { return new _ProtoRtpCapabilities().fromBinary(bytes, options); } static fromJson(jsonValue, options) { return new _ProtoRtpCapabilities().fromJson(jsonValue, options); } static fromJsonString(jsonString, options) { return new _ProtoRtpCapabilities().fromJsonString(jsonString, options); } static equals(a, b) { return proto3.util.equals(_ProtoRtpCapabilities, a, b); } }; // ../protoc/dist/client/response_pb.js var Hello = class _Hello extends Message { /** * @generated from field: required string peerId = 1; */ peerId; /** * @generated from field: required string roomId = 2; */ roomId; /** * @generated from field: required string sessionId = 3; */ sessionId; /** * @generated from field: required Permissions acl = 4; */ acl; /** * @generated from field: optional string role = 5; */ role; /** * @generated from field: optional string metadata = 6; */ metadata; constructor(data) { super(); proto2.util.initPartial(data, this); } static runtime = proto2; static typeName = "Hello"; static fields = proto2.util.newFieldList(() => [ { no: 1, name: "peerId", kind: "scalar", T: 9, req: true }, { no: 2, name: "roomId", kind: "scalar", T: 9, req: true }, { no: 3, name: "sessionId", kind: "scalar", T: 9, req: true }, { no: 4, name: "acl", kind: "message", T: Permissions, req: true }, { no: 5, name: "role", kind: "scalar", T: 9, opt: true }, { no: 6, name: "metadata", kind: "scalar", T: 9, opt: true } ]); static fromBinary(bytes, options) { return new _Hello().fromBinary(bytes, options); } static fromJson(jsonValue, options) { return new _Hello().fromJson(jsonValue, options); } static fromJsonString(jsonString, options) { return new _Hello().fromJsonString(jsonString, options); } static equals(a, b) { return proto2.util.equals(_Hello, a, b); } }; var RoomControls = class _RoomControls extends Message { /** * @generated from field: required bool roomLocked = 1; */ roomLocked; /** * @generated from field: required bool allowProduce = 2; */ allowProduce; /** * @generated from field: required RoomControls.ProduceSources allowProduceSources = 3; */ allowProduceSources; /** * @generated from field: required bool allowConsume = 4; */ allowConsume; /** * @generated from field: required bool allowSendData = 5; */ allowSendData; constructor(data) { super(); proto2.util.initPartial(data, this); } static runtime = proto2; static typeName = "RoomControls"; static fields = proto2.util.newFieldList(() => [ { no: 1, name: "roomLocked", kind: "scalar", T: 8, req: true }, { no: 2, name: "allowProduce", kind: "scalar", T: 8, req: true }, { no: 3, name: "allowProduceSources", kind: "message", T: RoomControls_ProduceSources, req: true }, { no: 4, name: "allowConsume", kind: "scalar", T: 8, req: true }, { no: 5, name: "allowSendData", kind: "scalar", T: 8, req: true } ]); static fromBinary(bytes, options) { return new _RoomControls().fromBinary(bytes, options); } static fromJson(jsonValue, options) { return new _RoomControls().fromJson(jsonValue, options); } static fromJsonString(jsonString, options) { return new _RoomControls().fromJsonString(jsonString, options); } static equals(a, b) { return proto2.util.equals(_RoomControls, a, b); } }; var RoomControls_ProduceSources = class _RoomControls_ProduceSources extends Message { /** * @generated from field: required bool cam = 1; */ cam; /** * @generated from field: required bool mic = 2; */ mic; /** * @generated from field: required bool screen = 3; */ screen; constructor(data) { super(); proto2.util.initPartial(data, this); } static runtime = proto2; static typeName = "RoomControls.ProduceSources"; static fields = proto2.util.newFieldList(() => [ { no: 1, name: "cam", kind: "scalar", T: 8, req: true }, { no: 2, name: "mic", kind: "scalar", T: 8, req: true }, { no: 3, name: "screen", kind: "scalar", T: 8, req: true } ]); static fromBinary(bytes, options) { return new _RoomControls_ProduceSources().fromBinary(bytes, options); } static fromJson(jsonValue, options) { return new _RoomControls_ProduceSources().fromJson(jsonValue, options); } static fromJsonString(jsonString, options) { return new _RoomControls_ProduceSources().fromJsonString(jsonString, options); } static equals(a, b) { return proto2.util.equals(_RoomControls_ProduceSources, a, b); } }; var PeersInfo = class _PeersInfo extends Message { /** * @generated from field: required string peerId = 1; */ peerId; /** * @generated from field: optional string metadata = 3; */ metadata; /** * @generated from field: optional string role = 5; */ role; /** * @generated from field: repeated PeersInfo.ProducerInfo producers = 4; */ producers = []; constructor(data) { super(); proto2.util.initPartial(data, this); } static runtime = proto2; static typeName = "PeersInfo"; static fields = proto2.util.newFieldList(() => [ { no: 1, name: "peerId", kind: "scalar", T: 9, req: true }, { no: 3, name: "metadata", kind: "scalar", T: 9, opt: true }, { no: 5, name: "role", kind: "scalar", T: 9, opt: true }, { no: 4, name: "producers", kind: "message", T: PeersInfo_ProducerInfo, repeated: true } ]); static fromBinary(bytes, options) { return new _PeersInfo().fromBinary(bytes, options); } static fromJson(jsonValue, options) { return new _PeersInfo().fromJson(jsonValue, options); } static fromJsonString(jsonString, options) { return new _PeersInfo().fromJsonString(jsonString, options); } static equals(a, b) { return proto2.util.equals(_PeersInfo, a, b); } }; var PeersInfo_ProducerInfo = class _PeersInfo_ProducerInfo extends Message { /** * @generated from field: required string id = 1; */ id; /** * @generated from field: required string label = 2; */ label; /** * @generated from field: optional bool paused = 3; */ paused; constructor(data) { super(); proto2.util.initPartial(data, this); } static runtime = proto2; static typeName = "PeersInfo.ProducerInfo"; static fields = proto2.util.newFieldList(() => [ { no: 1, name: "id", kind: "scalar", T: 9, req: true }, { no: 2, name: "label", kind: "scalar", T: 9, req: true }, { no: 3, name: "paused", kind: "scalar", T: 8, opt: true } ]); static fromBinary(bytes, options) { return new _PeersInfo_ProducerInfo().fromBinary(bytes, options); } static fromJson(jsonValue, options) { return new _PeersInfo_ProducerInfo().fromJson(jsonValue, options); } static fromJsonString(jsonString, options) { return new _PeersInfo_ProducerInfo().fromJsonString(jsonString, options); } static equals(a, b) { return proto2.util.equals(_PeersInfo_ProducerInfo, a, b); } }; var RoomInfo = class _RoomInfo extends Message { /** * @generated from field: required bool roomLocked = 1; */ roomLocked; /** * @generated from field: required RoomControls config = 2; */ config; /** * @generated from field: repeated PeersInfo peers = 3; */ peers = []; /** * @generated from field: repeated LobbyPeers lobbyPeers = 4; */ lobbyPeers = []; /** * @generated from field: optional string metadata = 5; */ metadata; /** * @generated from field: required int64 startTime = 6; */ startTime; constructor(data) { super(); proto2.util.initPartial(data, this); } static runtime = proto2; static typeName = "RoomInfo"; static fields = proto2.util.newFieldList(() => [ { no: 1, name: "roomLocked", kind: "scalar", T: 8, req: true }, { no: 2, name: "config", kind: "message", T: RoomControls, req: true }, { no: 3, name: "peers", kind: "message", T: PeersInfo, repeated: true }, { no: 4, name: "lobbyPeers", kind: "message", T: LobbyPeers, repeated: true }, { no: 5, name: "metadata", kind: "scalar", T: 9, opt: true }, { no: 6, name: "startTime", kind: "scalar", T: 3, req: true } ]); static fromBinary(bytes, options) { return new _RoomInfo().fromBinary(bytes, options); } static fromJson(jsonValue, options) { return new _RoomInfo().fromJson(jsonValue, options); } static fromJsonString(jsonString, options) { return new _RoomInfo().fromJsonString(jsonString, options); } static equals(a, b) { return proto2.util.equals(_RoomInfo, a, b); } }; var LobbyPeers = class _LobbyPeers extends Message { /** * @generated from field: required string peerId = 1; */ peerId; /** * @generated from field: optional string metadata = 3; */ metadata; constructor(data) { super(); proto2.util.initPartial(data, this); } static runtime = proto2; static typeName = "LobbyPeers"; static fields = proto2.util.newFieldList(() => [ { no: 1, name: "peerId", kind: "scalar", T: 9, req: true }, { no: 3, name: "metadata", kind: "scalar", T: 9, opt: true } ]); static fromBinary(bytes, options) { return new _LobbyPeers().fromBinary(bytes, options); } static fromJson(jsonValue, options) { return new _LobbyPeers().fromJson(jsonValue, options); } static fromJsonString(jsonString, options) { return new _LobbyPeers().fromJsonString(jsonString, options); } static equals(a, b) { return proto2.util.equals(_LobbyPeers, a, b); } }; var ConnectRoomResponse = class _ConnectRoomResponse extends Message { /** * @generated from field: required string roomId = 1; */ roomId; /** * @generated from field: required RoomInfo roomInfo = 2; */ roomInfo; /** * @generated from field: required ProtoRtpCapabilities routerRTPCapabilities = 3; */ routerRTPCapabilities; /** * @generated from field: repeated ConnectRoomResponse.RTCIceServer turnServers = 4; */ turnServers = []; constructor(data) { super(); proto2.util.initPartial(data, this); } static runtime = proto2; static typeName = "ConnectRoomResponse"; static fields = proto2.util.newFieldList(() => [ { no: 1, name: "roomId", kind: "scalar", T: 9, req: true }, { no: 2, name: "roomInfo", kind: "message", T: RoomInfo, req: true }, { no: 3, name: "routerRTPCapabilities", kind: "message", T: ProtoRtpCapabilities, req: true }, { no: 4, name: "turnServers", kind: "message", T: ConnectRoomResponse_RTCIceServer, repeated: true } ]); static fromBinary(bytes, options) { return new _ConnectRoomResponse().fromBinary(bytes, options); } static fromJson(jsonValue, options) { return new _ConnectRoomResponse().fromJson(jsonValue, options); } static fromJsonString(jsonString, options) { return new _ConnectRoomResponse().fromJsonString(jsonString, options); } static equals(a, b) { return proto2.util.equals(_ConnectRoomResponse, a, b); } }; var ConnectRoomResponse_RTCIceServer = class _ConnectRoomResponse_RTCIceServer extends Message { /** * @generated from field: required string urls = 1; */ urls; /** * @generated from field: optional string username = 2; */ username; /** * @generated from field: optional string credential = 3; */ credential; constructor(data) { super(); proto2.util.initPartial(data, this); } static runtime = proto2; static typeName = "ConnectRoomResponse.RTCIceServer"; static fields = proto2.util.newFieldList(() => [ { no: 1, name: "urls", kind: "scalar", T: 9, req: true }, { no: 2, name: "username", kind: "scalar", T: 9, opt: true }, { no: 3, name: "credential", kind: "scalar", T: 9, opt: true } ]); static fromBinary(bytes, options) { return new _ConnectRoomResponse_RTCIceServer().fromBinary(bytes, options); } static fromJson(jsonValue, options) { return new _ConnectRoomResponse_RTCIceServer().fromJson(jsonValue, options); } static fromJsonString(jsonString, options) { return new _ConnectRoomResponse_RTCIceServer().fromJsonString(jsonString, options); } static equals(a, b) { return proto2.util.equals(_ConnectRoomResponse_RTCIceServer, a, b); } }; var CreateTransportOnClient = class _CreateTransportOnClient extends Message { /** * @generated from field: required string transportType = 1; */ transportType; /** * @generated from field: required ProtoTransportSDPInfo transportSDPInfo = 2; */ transportSDPInfo; constructor(data) { super(); proto2.util.initPartial(data, this); } static runtime = proto2; static typeName = "CreateTransportOnClient"; static fields = proto2.util.newFieldList(() => [ { no: 1, name: "transportType", kind: "scalar", T: 9, req: true }, { no: 2, name: "transportSDPInfo", kind: "message", T: ProtoTransportSDPInfo, req: true } ]); static fromBinary(bytes, options) { return new _CreateTransportOnClient().fromBinary(bytes, options); } static fromJson(jsonValue, options) { return new _CreateTransportOnClient().fromJson(jsonValue, options); } static fromJsonString(jsonString, options) { return new _CreateTransportOnClient().fromJsonString(jsonString, options); } static equals(a, b) { return proto2.util.equals(_CreateTransportOnClient, a, b); } }; var ConnectTransportResponse = class _ConnectTransportResponse extends Message { /** * @generated from field: required string transportType = 1; */ transportType; /** * @generated from field: required string transportId = 2; */ transportId; constructor(data) { super(); proto2.util.initPartial(data, this); } static runtime = proto2; static typeName = "ConnectTransportResponse"; static fields = proto2.util.newFieldList(() => [ { no: 1, name: "transportType", kind: "scalar", T: 9, req: true }, { no: 2, name: "transportId", kind: "scalar", T: 9, req: true } ]); static fromBinary(bytes, options) { return new _ConnectTransportResponse().fromBinary(bytes, options); } static fromJson(jsonValue, options) { return new _ConnectTransportResponse().fromJson(jsonValue, options); } static fromJsonString(jsonString, options) { return new _ConnectTransportResponse().fromJsonString(jsonString, options); } static equals(a, b) { return proto2.util.equals(_ConnectTransportResponse, a, b); } }; var ProduceResponse = class _ProduceResponse extends Message { /** * @generated from field: required string peerId = 1; */ peerId; /** * @generated from field: required string producerId = 2; */ producerId; /** * @generated from field: required string label = 3; */ label; /** * @generated from field: optional AppData appData = 4; */ appData; constructor(data) { super(); proto2.util.initPartial(data, this); } static runtime = proto2; static typeName = "ProduceResponse"; static fields = proto2.util.newFieldList(() => [ { no: 1, name: "peerId", kind: "scalar", T: 9, req: true }, { no: 2, name: "producerId", kind: "scalar", T: 9, req: true }, { no: 3, name: "label", kind: "scalar", T: 9, req: true }, { no: 4, name: "appData", kind: "message", T: AppData, opt: true } ]); static fromBinary(bytes, options) { return new _ProduceResponse().fromBinary(bytes, options); } static fromJson(jsonValue, options) { return new _ProduceResponse().fromJson(jsonValue, options); } static fromJsonString(jsonString, options) { return new _ProduceResponse().fromJsonString(jsonString, options); } static equals(a, b) { return proto2.util.equals(_ProduceResponse, a, b); } }; var ProduceDataResponse = class _ProduceDataResponse extends Message { /** * @generated from field: required string id = 1; */ id; /** * @generated from field: required string dataProducerId = 2; */ dataProducerId; /** * @generated from field: required string label = 3; */ label; /** * @generated from field: required string peerId = 4; */ peerId; /** * @generated from field: required string protocol = 5; */ protocol; /** * @generated from field: required ProtoSctpStreamParameters sctpStreamParameters = 6; */ sctpStreamParameters; /** * @generated from field: optional AppData appData = 7; */ appData; constructor(data) { super(); proto2.util.initPartial(data, this); } static runtime = proto2; static typeName = "ProduceDataResponse"; static fields = proto2.util.newFieldList(() => [ { no: 1, name: "id", kind: "scalar", T: 9, req: true }, { no: 2, name: "dataProducerId", kind: "scalar", T: 9, req: true }, { no: 3, name: "label", kind: "scalar", T: 9, req: true }, { no: 4, name: "peerId", kind: "scalar", T: 9, req: true }, { no: 5, name: "protocol", kind: "scalar", T: 9, req: true }, { no: 6, name: "sctpStreamParameters", kind: "message", T: ProtoSctpStreamParameters, req: true }, { no: 7, name: "appData", kind: "message", T: AppData, opt: true } ]); static fromBinary(bytes, options) { return new _ProduceDataResponse().fromBinary(bytes, options); } static fromJson(jsonValue, options) { return new _ProduceDataResponse().fromJson(jsonValue, options); } static fromJsonString(jsonString, options) { return new _ProduceDataResponse().fromJsonString(jsonString, options); } static equals(a, b) { return proto2.util.equals(_ProduceDataResponse, a, b); } }; var ConsumeDataResponse = class _ConsumeDataResponse extends Message { /** * @generated from field: required string id = 1; */ id; /** * @generated from field: required string dataProducerId = 2; */ dataProducerId; /** * @generated from field: required string label = 3; */ label; /** * @generated from field: required string peerId = 4; */ peerId; /** * @generated from field: required string protocol = 5; */ protocol; /** * @generated from field: required ProtoSctpStreamParameters sctpStreamParameters = 6; */ sctpStreamParameters; /** * @generated from field: optional AppData appData = 7; */ appData; constructor(data) { super(); proto2.util.initPartial(data, this); } static runtime = proto2; static typeName = "ConsumeDataResponse"; static fields = proto2.util.newFieldList(() => [ { no: 1, name: "id", kind: "scalar", T: 9, req: true }, { no: 2, name: "dataProducerId", kind: "scalar", T: 9, req: true }, { no: 3, name: "label", kind: "scalar", T: 9, req: true }, { no: 4, name: "peerId", kind: "scalar", T: 9, req: true }, { no: 5, name: "protocol", kind: "scalar", T: 9, req: true }, { no: 6, name: "sctpStreamParameters", kind: "message", T: ProtoSctpStreamParameters, req: true }, { no: 7, name: "appData", kind: "message", T: AppData, opt: true } ]); static fromBinary(bytes, options) { return new _ConsumeDataResponse().fromBinary(bytes, options); } static fromJson(jsonValue, options) { return new _ConsumeDataResponse().fromJson(jsonValue, options); } static fromJsonString(jsonString, options) { return new _ConsumeDataResponse().fromJsonString(jsonString, options); } static equals(a, b) { return proto2.util.equals(_ConsumeDataResponse, a, b); } }; var SyncMeetingStateResponse = class _SyncMeetingStateResponse extends Message { /** * @generated from field: required RoomInfo roomInfo = 1; */ roomInfo; constructor(data) { super(); proto2.util.initPartial(data, this); } static runtime = proto2; static typeName = "SyncMeetingStateResponse"; static fields = proto2.util.newFieldList(() => [ { no: 1, name: "roomInfo", kind: "message", T: RoomInfo, req: true } ]); static fromBinary(bytes, options) { return new _SyncMeetingStateResponse().fromBinary(bytes, options); } static fromJson(jsonValue, options) { return new _SyncMeetingStateResponse().fromJson(jsonValue, options); } static fromJsonString(jsonString, options) { return new _SyncMeetingStateResponse().fromJsonString(jsonString, options); } static equals(a, b) { return proto2.util.equals(_SyncMeetingStateResponse, a, b); } }; var ConsumeResponse = class _ConsumeResponse extends Message { /** * @generated from field: required string label = 1; */ label; /** * @generated from field: required string consumerId = 2; */ consumerId; /** * @generated from field: required string producerId = 3; */ producerId; /** * @generated from field: required string kind = 4; */ kind; /** * @generated from field: required ProtoRtpParameters rtpParameters = 5; */ rtpParameters; /** * @generated from field: required string producerPeerId = 6; */ producerPeerId; /** * @generated from field: optional AppData appData = 7; */ appData; /** * @generated from field: optional bool producerPaused = 8; */ producerPaused; constructor(data) { super(); proto2.util.initPartial(data, this); } static runtime = proto2; static typeName = "ConsumeResponse"; static fields = proto2.util.newFieldList(() => [ { no: 1, name: "label", kind: "scalar", T: 9, req: true }, { no: 2, name: "consumerId", kind: "scalar", T: 9, req: true }, { no: 3, name: "producerId", kind: "scalar", T: 9, req: true }, { no: 4, name: "kind", kind: "scalar", T: 9, req: true }, { no: 5, name: "rtpParameters", kind: "message", T: ProtoRtpParameters, req: true }, { no: 6, name: "producerPeerId", kind: "scalar", T: 9, req: true }, { no: 7, name: "appData", kind: "message", T: AppData, opt: true }, { no: 8, name: "producerPaused", kind: "scalar", T: 8, opt: true } ]); static fromBinary(bytes, options) { return new _ConsumeResponse().fromBinary(bytes, options); } static fromJson(jsonValue, options) { return new _ConsumeResponse().fromJson(jsonValue, options); } static fromJsonString(jsonString, options) { return new _ConsumeResponse().fromJsonString(jsonString, options); } static equals(a, b) { return proto2.util.equals(_ConsumeResponse, a, b); } }; var CloseProducerSuccess = class _CloseProducerSuccess extends Message { /** * @generated from field: required string peerId = 1; */ peerId; /** * @generated from field: required string producerId = 2; */ producerId; /** * @generated from field: required string label = 3; */ label; constructor(data) { super(); proto2.util.initPartial(data, this); } static runtime = proto2; static typeName = "CloseProducerSuccess"; static fields = proto2.util.newFieldList(() => [ { no: 1, name: "peerId", kind: "scalar", T: 9, req: true }, { no: 2, name: "producerId", kind: "scalar", T: 9, req: true }, { no: 3, name: "label", kind: "scalar", T: 9, req: true } ]); static fromBinary(bytes, options) { return new _CloseProducerSuccess().fromBinary(bytes, options); } static fromJson(jsonValue, options) { return new _CloseProducerSuccess().fromJson(jsonValue, options); } static fromJsonString(jsonString, options) { return new _CloseProducerSuccess().fromJsonString(jsonString, options); } static equals(a, b) { return proto2.util.equals(_CloseProducerSuccess, a, b); } }; var PauseProducerSuccess = class _PauseProducerSuccess extends Message { /** * @generated from field: required string peerId = 1; */ peerId; /** * @generated from field: required string producerId = 2; */ producerId; /** * @generated from field: required string label = 3; */ label; constructor(data) { super(); proto2.util.initPartial(data, this); } static runtime = proto2; static typeName = "PauseProducerSuccess"; static fields = proto2.util.newFieldList(() => [ { no: 1, name: "peerId", kind: "scalar", T: 9, req: true }, { no: 2, name: "producerId", kind: "scalar", T: 9, req: true }, { no: 3, name: "label", kind: "scalar", T: 9, req: true } ]); static fromBinary(bytes, options) { return new _PauseProducerSuccess().fromBinary(bytes, options); } static fromJson(jsonValue, options) { return new _PauseProducerSuccess().fromJson(jsonValue, options); } static fromJsonString(jsonString, options) { return new _PauseProducerSuccess().fromJsonString(jsonString, options); } static equals(a, b) { return proto2.util.equals(_PauseProducerSuccess, a, b); } }; var ResumeProducerSuccess = class _ResumeProducerSuccess extends Message { /** * @generated from field: required string peerId = 1; */ peerId; /** * @generated from field: required string producerId = 2; */ producerId; /** * @generated from field: required string label = 3; */ label; constructor(data) { super(); proto2.util.initPartial(data, this); } static runtime = proto2; static typeName = "ResumeProducerSuccess"; static fields = proto2.util.newFieldList(() => [ { no: 1, name: "peerId", kind: "scalar", T: 9, req: true }, { no: 2, name: "producerId", kind: "scalar", T: 9, req: true }, { no: 3, name: "label", kind: "scalar", T: 9, req: true } ]); static fromBinary(bytes, options) { return new _ResumeProducerSuccess().fromBinary(bytes, options); } static fromJson(jsonValue, options) { return new _ResumeProducerSuccess().fromJson(jsonValue, options); } static fromJsonString(jsonString, options) { return new _ResumeProducerSuccess().fromJsonString(jsonString, options); } static equals(a, b) { return proto2.util.equals(_ResumeProducerSuccess, a, b); } }; var CloseConsumerSuccess = class _CloseConsumerSuccess extends Message { /** * @generated from field: required string peerId = 1; */ peerId; /** * @generated from field: required string consumerId = 2; */ consumerId; constructor(data) { super(); proto2.util.initPartial(data, this); } static runtime = proto2; static typeName = "CloseConsumerSuccess"; static fields = proto2.util.newFieldList(() => [ { no: 1, name: "peerId", kind: "scalar", T: 9, req: true }, { no: 2, name: "consumerId", kind: "scalar", T: 9, req: true } ]); static fromBinary(bytes, options) { return new _CloseConsumerSuccess().fromBinary(bytes, options); } static fromJson(jsonValue, options) { return new _CloseConsumerSuccess().fromJson(jsonValue, options); } static fromJsonString(jsonString, options) { return new _CloseConsumerSuccess().fromJsonString(jsonString, options); } static equals(a, b) { return proto2.util.equals(_CloseConsumerSuccess, a, b); } }; var RestartTransportIceResponse = class _RestartTransportIceResponse extends Message { /** * @generated from field: required string transportType = 1; */ transportType; /** * @generated from field: required ProtoIceParameters iceParameters = 2; */ iceParameters; constructor(data) { super(); proto2.util.initPartial(data, this); } static runtime = proto2; static typeName = "RestartTransportIceResponse"; static fields = proto2.util.newFieldList(() => [ { no: 1, name: "transportType", kind: "scalar", T: 9, req: true }, { no: 2, name: "iceParameters", kind: "message", T: ProtoIceParameters, req: true } ]); static fromBinary(bytes, options) { return new _RestartTransportIceResponse().fromBinary(bytes, options); } static fromJson(jsonValue, options) { return new _RestartTransportIceResponse().fromJson(jsonValue, options); } static fromJsonString(jsonString, options) { return new _RestartTransportIceResponse().fromJsonString(jsonString, options); } static equals(a, b) { return proto2.util.equals(_RestartTransportIceResponse, a, b); } }; var NewPeerJoined = class _NewPeerJoined extends Message { /** * @generated from field: required string peerId = 1; */ peerId; /** * @generated from field: optional string metadata = 2; */ metadata; /** * @generated from field: optional string role = 3; */ role; constructor(data) { super(); proto2.util.initPartial(data, this); } static runtime = proto2; static typeName = "NewPeerJoined"; static fields = proto2.util.newFieldList(() => [ { no: 1, name: "peerId", kind: "scalar", T: 9, req: true }, { no: 2, name: "metadata", kind: "scalar", T: 9, opt: true }, { no: 3, name: "role", kind: "scalar", T: 9, opt: true } ]); static fromBinary(bytes, options) { return new _NewPeerJoined().fromBinary(bytes, options); } static fromJson(jsonValue, options) { return new _NewPeerJoined().fromJson(jsonValue, options); } static fromJsonString(jsonString, options) { return new _NewPeerJoined().fromJsonString(jsonString, options); } static equals(a, b) { return proto2.util.equals(_NewPeerJoined, a, b); } }; var NewLobbyPeer = class _NewLobbyPeer extends Message { /** * @generated from field: required string peerId = 1; */ peerId; /** * @generated from field: optional string metadata = 2; */ metadata; constructor(data) { super(); proto2.util.initPartial(data, this); } static runtime = proto2; static typeName = "NewLobbyPeer"; static fields = proto2.util.newFieldList(() => [ { no: 1, name: "peerId", kind: "scalar", T: 9, req: true }, { no: 2, name: "metadata", kind: "scalar", T: 9, opt: true } ]); static fromBinary(bytes, options) { return new _NewLobbyPeer().fromBinary(bytes, options); } static fromJson(jsonValue, options) { return new _NewLobbyPeer().fromJson(jsonValue, options); } static fromJsonString(jsonString, options) { return new _NewLobbyPeer().fromJsonString(jsonString, options); } static equals(a, b) { return proto2.util.equals(_NewLobbyPeer, a, b); } }; var NewPermissions = class _NewPermissions extends Message { /** * @generated from field: required Permissions acl = 2; */ acl; constructor(data) { super(); proto2.util.initPartial(data, this); } static runtime = proto2; static typeName = "NewPermissions"; static fields = proto2.util.newFieldList(() => [ { no: 2, name: "acl", kind: "message", T: Permissions, req: true } ]); static fromBinary(bytes, options) { return new _NewPermissions().fromBinary(bytes, options); } static fromJson(jsonValue, options) { return new _NewPermissions().fromJson(jsonValue, options); } static fromJsonString(jsonString, options) { return new _NewPermissions().fromJsonString(jsonString, options); } static equals(a, b) { return proto2.util.equals(_NewPermissions, a, b); } }; var NewRoomControls = class _NewRoomControls extends Message { /** * @generated from field: required RoomControls controls = 1; */ controls; constructor(data) { super(); proto2.util.initPartial(data, this); } static runtime = proto2; static typeName = "NewRoomControls"; static fields = proto2.util.newFieldList(() => [ { no: 1, name: "controls", kind: "message", T: RoomControls, req: true } ]); static fromBinary(bytes, options) { return new _NewRoomControls().fromBinary(bytes, options); } static fromJson(jsonValue, options) { return new _NewRoomControls().fromJson(jsonValue, options); } static fromJsonString(jsonString, options) { return new _NewRoomControls().fromJsonString(jsonString, options); } static equals(a, b) { return proto2.util.equals(_NewRoomControls, a, b); } }; var NewPeerRole = class _NewPeerRole extends Message { /** * @generated from field: required string peerId = 1; */ peerId; /** * @generated from field: required string role = 2; */ role; constructor(data) { super(); proto2.util.initPartial(data, this); } static runtime = proto2; static typeName = "NewPeerRole"; static fields = proto2.util.newFieldList(() => [ { no: 1, name: "peerId", kind: "scalar", T: 9, req: true }, { no: 2, name: "role", kind: "scalar", T: 9, req: true } ]); static fromBinary(bytes, options) { return new _NewPeerRole().fromBinary(bytes, options); } static fromJson(jsonValue, options) { return new _NewPeerRole().fromJson(jsonValue, options); } static fromJsonString(jsonString, options) { return new _NewPeerRole().fromJsonString(jsonString, options); } static equals(a, b) { return proto2.util.equals(_NewPeerRole, a, b); } }; var ReceiveData = class _ReceiveData extends Message { /** * @generated from field: required string from = 1; */ from; /** * @generated from field: required string payload = 2; */ payload; /** * @generated from field: optional string label = 3; */ label; constructor(data) { super(); proto2.util.initPartial(data, this); } static runtime = proto2; static typeName = "ReceiveData"; static fields = proto2.util.newFieldList(() => [ { no: 1, name: "from", kind: "scalar", T: 9, req: true }, { no: 2, name: "payload", kind: "scalar", T: 9, req: true }, { no: 3, name: "label", kind: "scalar", T: 9, opt: true } ]); static fromBinary(bytes, options) { return new _ReceiveData().fromBinary(bytes, options); } static fromJson(jsonValue, options) { return new _ReceiveData().fromJson(jsonValue, options); } static fromJsonString(jsonString, options) { return new _ReceiveData().fromJsonString(jsonString, options); } static equals(a, b) { return proto2.util.equals(_ReceiveData, a, b); } }; var PeerMetadataUpdated = class _PeerMetadataUpdated extends Message { /** * @generated from field: required string peerId = 1; */ peerId; /** * @generated from field: required string metadata = 2; */ metadata; constructor(data) { super(); proto2.util.initPartial(data, this); } static runtime = proto2; static typeName = "PeerMetadataUpdated"; static fields = proto2.util.newFieldList(() => [ { no: 1, name: "peerId", kind: "scalar", T: 9, req: true }, { no: 2, name: "metadata", kind: "scalar", T: 9, req: true } ]); static fromBinary(bytes, options) { return new _PeerMetadataUpdated().fromBinary(bytes, options); } static fromJson(jsonValue, options) { return new _PeerMetadataUpdated().fromJson(jsonValue, options); } static fromJsonString(jsonString, options) { return new _PeerMetadataUpdated().fromJsonString(jsonString, options); } static equals(a, b) { return proto2.util.equals(_PeerMetadataUpdated, a, b); } }; var RoomMetadataUpdated = class _RoomMetadataUpdated extends Message { /** * @generated from field: required string metadata = 1; */ metadata; constructor(data) { super(); proto2.util.initPartial(data, this); } static runtime = proto2; static typeName = "RoomMetadataUpdated"; static fields = proto2.util.newFieldList(() => [ { no: 1, name: "metadata", kind: "scalar", T: 9, req: true } ]); static fromBinary(bytes, options) { return new _RoomMetadataUpdated().fromBinary(bytes, options); } static fromJson(jsonValue, options) { return new _RoomMetadataUpdated().fromJson(jsonValue, options); } static fromJsonString(jsonString, options) { return new _RoomMetadataUpdated().fromJsonString(jsonString, options); } static equals(a, b) { return proto2.util.equals(_RoomMetadataUpdated, a, b); } }; var RoomClosedProducers = class _RoomClosedProducers extends Message { /** * @generated from field: repeated RoomClosedProducers.CloseProducerInfo producers = 1; */ producers = []; /** * @generated from field: required RoomClosedProducers.CloseProducerReason reason = 2; */ reason; constructor(data) { super(); proto2.util.initPartial(data, this); } static runtime = proto2; static typeName = "RoomClosedProducers"; static fields = proto2.util.newFieldList(() => [ { no: 1, name: "producers", kind: "message", T: RoomClosedProducers_CloseProducerInfo, repeated: true }, { no: 2, name: "reason", kind: "message", T: RoomClosedProducers_CloseProducerReason, req: true } ]); static fromBinary(bytes, options) { return new _RoomClosedProducers().fromBinary(bytes, options); } static fromJson(jsonValue, options) { return new _RoomClosedProducers().fromJson(jsonValue, options); } static fromJsonString(jsonString, options) { return new _RoomClosedProducers().fromJsonString(jsonString, options); } static equals(a, b) { return proto2.util.equals(_RoomClosedProducers, a, b); } }; var RoomClosedProducers_CloseProducerInfo = class _RoomClosedProducers_CloseProducerInfo extends Message { /** * @generated from field: required string peerId = 1; */ peerId; /** * @generated from field: required string producerId = 2; */ producerId; /** * @generated from field: required string label = 3; */ label; constructor(data) { super(); proto2.util.initPartial(data, this); } static runtime = proto2; static typeName = "RoomClosedProducers.CloseProducerInfo"; static fields = proto2.util.newFieldList(() => [ { no: 1, name: "peerId", kind: "scalar", T: 9, req: true }, { no: 2, name: "producerId", kind: "scalar", T: 9, req: true }, { no: 3, name: "label", kind: "scalar", T: 9, req: true } ]); static fromBinary(bytes, options) { return new _RoomClosedProducers_CloseProducerInfo().fromBinary(bytes, options); } static fromJson(jsonValue, options) { return new _RoomClosedProducers_CloseProducerInfo().fromJson(jsonValue, options); } static fromJsonString(jsonString, options) { return new _RoomClosedProducers_CloseProducerInfo().fromJsonString(jsonString, options); } static equals(a, b) { return proto2.util.equals(_RoomClosedProducers_CloseProducerInfo, a, b); } }; var RoomClosedProducers_CloseProducerReason = class _RoomClosedProducers_CloseProducerReason extends Message { /** * @generated from field: required int32 code = 1; */ code; /** * @generated from field: required string tag = 2; */ tag; /** * @generated from field: required string message = 3; */ message; constructor(data) { super(); proto2.util.initPartial(data, this); } static runtime = proto2; static typeName = "RoomClosedProducers.CloseProducerReason"; static fields = proto2.util.newFieldList(() => [ { no: 1, name: "code", kind: "scalar", T: 5, req: true }, { no: 2, name: "tag", kind: "scalar", T: 9, req: true }, { no: 3, name: "message", kind: "scalar", T: 9, req: true } ]); static fromBinary(bytes, options) { return new _RoomClosedProducers_CloseProducerReason().fromBinary(bytes, options); } static fromJson(jsonValue, options) { return new _RoomClosedProducers_CloseProducerReason().fromJson(jsonValue, options); } static fromJsonString(jsonString, options) { return new _RoomClosedProducers_CloseProducerReason().fromJsonString(jsonString, options); } static equals(a, b) { return proto2.util.equals(_RoomClosedProducers_CloseProducerReason, a, b); } }; var PeerLeft = class _PeerLeft extends Message { /** * @generated from field: required string peerId = 1; */ peerId; constructor(data) { super(); proto2.util.initPartial(data, this); } static runtime = proto2; static typeName = "PeerLeft"; static fields = proto2.util.newFieldList(() => [ { no: 1, name: "peerId", kind: "scalar", T: 9, req: true } ]); static fromBinary(bytes, options) { return new _PeerLeft().fromBinary(bytes, options); } static fromJson(jsonValue, options) { return new _PeerLeft().fromJson(jsonValue, options); } static fromJsonString(jsonString, options) { return new _PeerLeft().fromJsonString(jsonString, options); } static equals(a, b) { return proto2.util.equals(_PeerLeft, a, b); } }; var LobbyPeerLeft = class _LobbyPeerLeft extends Message { /** * @generated from field: required string peerId = 1; */ peerId; /** * @generated from field: required string status = 2; */ status; /** * @generated from field: optional string message = 3; */ message; constructor(data) { super(); proto2.util.initPartial(data, this); } static runtime = proto2; static typeName = "LobbyPeerLeft"; static fields = proto2.util.newFieldList(() => [ { no: 1, name: "peerId", kind: "scalar", T: 9, req: true }, { no: 2, name: "status", kind: "scalar", T: 9, req: true }, { no: 3, name: "message", kind: "scalar", T: 9, opt: true } ]); static fromBinary(bytes, options) { return new _LobbyPeerLeft().fromBinary(bytes, options); } static fromJson(jsonValue, options) { return new _LobbyPeerLeft().fromJson(jsonValue, options); } static fromJsonString(jsonString, options) { return new _LobbyPeerLeft().fromJsonString(jsonString, options); } static equals(a, b) { return proto2.util.equals(_LobbyPeerLeft, a, b); } }; var WaitingRoom = class _WaitingRoom extends Message { /** * @generated from field: required string reason = 1; */ reason; /** * @generated from field: optional string metadata = 2; */ metadata; constructor(data) { super(); proto2.util.initPartial(data, this); } static runtime = proto2; static typeName = "WaitingRoom"; static fields = proto2.util.newFieldList(() => [ { no: 1, name: "reason", kind: "scalar", T: 9, req: true }, { no: 2, name: "metadata", kind: "scalar", T: 9, opt: true } ]); static fromBinary(bytes, options) { return new _WaitingRoom().fromBinary(bytes, options); } static fromJson(jsonValue, options) { return new _WaitingRoom().fromJson(jsonValue, options); } static fromJsonString(jsonString, options) { return new _WaitingRoom().fromJsonString(jsonString, options); } static equals(a, b) { return