diff --git a/package.json b/package.json
index 706b4c8ab3..bee60ce55e 100644
--- a/package.json
+++ b/package.json
@@ -78,8 +78,8 @@
"nx": "16.10.0",
"prettier": "^3.3.2",
"typescript": "^5.5.2",
- "vercel": "^37.2.1",
- "vite": "^4.4.11"
+ "vercel": "^37.4.2",
+ "vite": "^5.4.6"
},
"resolutions": {
"eslint-plugin-prettier": "^5.1.3"
diff --git a/packages/audio-filters-web/CHANGELOG.md b/packages/audio-filters-web/CHANGELOG.md
index 6f8b552ae0..0ceee1cb56 100644
--- a/packages/audio-filters-web/CHANGELOG.md
+++ b/packages/audio-filters-web/CHANGELOG.md
@@ -2,6 +2,13 @@
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
+## [0.2.2](https://github.com/GetStream/stream-video-js/compare/@stream-io/audio-filters-web-0.2.1...@stream-io/audio-filters-web-0.2.2) (2024-09-19)
+
+
+### Features
+
+* React SDK cold-start optimizations ([#1488](https://github.com/GetStream/stream-video-js/issues/1488)) ([972e579](https://github.com/GetStream/stream-video-js/commit/972e5792b5a131a212b1031ade76dcb383897a46))
+
### [0.2.1](https://github.com/GetStream/stream-video-js/compare/@stream-io/audio-filters-web-0.2.0...@stream-io/audio-filters-web-0.2.1) (2024-07-02)
diff --git a/packages/audio-filters-web/package.json b/packages/audio-filters-web/package.json
index 4dd3791d45..f817b78561 100644
--- a/packages/audio-filters-web/package.json
+++ b/packages/audio-filters-web/package.json
@@ -1,7 +1,7 @@
{
"name": "@stream-io/audio-filters-web",
"packageManager": "yarn@3.5.0",
- "version": "0.2.1",
+ "version": "0.2.2",
"main": "./dist/index.cjs.js",
"module": "./dist/index.es.js",
"types": "./dist/index.d.ts",
@@ -16,6 +16,7 @@
"url": "https://github.com/GetStream/stream-video-js.git",
"directory": "packages/audio-filters-web"
},
+ "sideEffects": false,
"files": [
"dist",
"src",
@@ -29,10 +30,10 @@
"wasm-feature-detect": "^1.6.1"
},
"devDependencies": {
- "@rollup/plugin-replace": "^5.0.5",
+ "@rollup/plugin-replace": "^5.0.7",
"@rollup/plugin-typescript": "^11.1.6",
"rimraf": "^5.0.7",
- "rollup": "^3.29.4",
+ "rollup": "^4.22.0",
"typescript": "^5.5.2"
}
}
diff --git a/packages/client/CHANGELOG.md b/packages/client/CHANGELOG.md
index 486d1618f5..ec3c21469b 100644
--- a/packages/client/CHANGELOG.md
+++ b/packages/client/CHANGELOG.md
@@ -2,6 +2,69 @@
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
+## [1.7.3](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-client-1.7.2...@stream-io/video-client-1.7.3) (2024-09-24)
+
+
+### Bug Fixes
+
+* do not always error out api calls when web socket initially failed ([#1495](https://github.com/GetStream/stream-video-js/issues/1495)) ([7cdb62e](https://github.com/GetStream/stream-video-js/commit/7cdb62e75cad56098ee81eabbcc63382f93fd218))
+
+## [1.7.2](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-client-1.7.1...@stream-io/video-client-1.7.2) (2024-09-20)
+
+
+### Bug Fixes
+
+* overridable bitrate and bitrate downscale factor ([#1493](https://github.com/GetStream/stream-video-js/issues/1493)) ([cce5d8e](https://github.com/GetStream/stream-video-js/commit/cce5d8e641a9182a1779952e4e62aa16ec21ab92))
+
+## [1.7.1](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-client-1.7.0...@stream-io/video-client-1.7.1) (2024-09-20)
+
+
+### Bug Fixes
+
+* don't attempt to recover broken WebSockets when there isn't a network connection ([#1490](https://github.com/GetStream/stream-video-js/issues/1490)) ([d576f48](https://github.com/GetStream/stream-video-js/commit/d576f48c7f819d48008359a3c30fe5d1a3372145))
+
+## [1.7.0](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-client-1.6.5...@stream-io/video-client-1.7.0) (2024-09-19)
+
+
+### Features
+
+* React SDK cold-start optimizations ([#1488](https://github.com/GetStream/stream-video-js/issues/1488)) ([972e579](https://github.com/GetStream/stream-video-js/commit/972e5792b5a131a212b1031ade76dcb383897a46))
+
+## [1.6.5](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-client-1.6.4...@stream-io/video-client-1.6.5) (2024-09-19)
+
+
+### Bug Fixes
+
+* race condition in `applySettingsToStream` ([#1489](https://github.com/GetStream/stream-video-js/issues/1489)) ([bf2ad90](https://github.com/GetStream/stream-video-js/commit/bf2ad90224d88592d4ea27ea8d0683efe98771f7))
+
+## [1.6.4](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-client-1.6.3...@stream-io/video-client-1.6.4) (2024-09-13)
+
+
+### Bug Fixes
+
+* allow video target bitrate override ([#1487](https://github.com/GetStream/stream-video-js/issues/1487)) ([bfe34a3](https://github.com/GetStream/stream-video-js/commit/bfe34a3609182da5bbb03331978d86569cada098))
+
+## [1.6.3](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-client-1.6.2...@stream-io/video-client-1.6.3) (2024-09-11)
+
+
+### Bug Fixes
+
+* client instance removal used a wrong key ([#1484](https://github.com/GetStream/stream-video-js/issues/1484)) ([edff5d7](https://github.com/GetStream/stream-video-js/commit/edff5d7ca0cc241a3929da3b752073883f29da32))
+
+## [1.6.2](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-client-1.6.1...@stream-io/video-client-1.6.2) (2024-09-09)
+
+
+### Bug Fixes
+
+* prioritize h264 baseline profile ([#1482](https://github.com/GetStream/stream-video-js/issues/1482)) ([3ea3c5e](https://github.com/GetStream/stream-video-js/commit/3ea3c5ecf57b50d3f909d59a96811f636b07d8aa))
+
+## [1.6.1](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-client-1.6.0...@stream-io/video-client-1.6.1) (2024-09-05)
+
+
+### Bug Fixes
+
+* update state.endedAt after the SFU terminates the call ([#1477](https://github.com/GetStream/stream-video-js/issues/1477)) ([135b11f](https://github.com/GetStream/stream-video-js/commit/135b11f2e29f486f2f43b9ac2a84848d0fd0b5b4))
+
## [1.6.0](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-client-1.5.2...@stream-io/video-client-1.6.0) (2024-09-03)
diff --git a/packages/client/docusaurus/docs/javascript/02-guides/04-noise-cancellation.mdx b/packages/client/docusaurus/docs/javascript/02-guides/04-noise-cancellation.mdx
index 92f75a218f..557698c8fa 100644
--- a/packages/client/docusaurus/docs/javascript/02-guides/04-noise-cancellation.mdx
+++ b/packages/client/docusaurus/docs/javascript/02-guides/04-noise-cancellation.mdx
@@ -27,7 +27,7 @@ npm install @stream-io/audio-filters-web
## Integration
-In the following code snippet, we show how to check if platform is supported, initialize the plugin and enable/disable it.
+In the following code snippet, we show how to check if а platform is supported, initialize the plugin, and enable/disable it.
```typescript
import { NoiseCancellation } from '@stream-io/audio-filters-web';
@@ -61,3 +61,19 @@ const off = noiseCancellation.on('change', (v) => {
console.log(`Noise Cancellation is ${v ? 'enabled' : 'disabled'}`);
});
```
+
+In action, the most straight-forward integration should look like this:
+
+```typescript
+import { NoiseCancellation } from '@stream-io/audio-filters-web';
+
+const call = client.call(type, id);
+await call.get(); // or call.getOrCreate()
+
+const noiseCancellation = new NoiseCancellation();
+const isSupported = await noiseCancellation.isSupported();
+if (isSupported) {
+ await noiseCancellation.init();
+ await call.microphone.enableNoiseCancellation(noiseCancellation);
+}
+```
diff --git a/packages/client/docusaurus/docs/javascript/02-guides/06-querying-calls.mdx b/packages/client/docusaurus/docs/javascript/02-guides/06-querying-calls.mdx
index 83a43b9062..73ad2e64fd 100644
--- a/packages/client/docusaurus/docs/javascript/02-guides/06-querying-calls.mdx
+++ b/packages/client/docusaurus/docs/javascript/02-guides/06-querying-calls.mdx
@@ -89,7 +89,7 @@ const { calls } = await client.queryCalls({
});
```
-### Calls that live / currently have participants
+### Calls that are ongoing / currently have participants
```typescript
import { StreamVideoClient } from '@stream-io/video-client';
diff --git a/packages/client/docusaurus/docs/javascript/02-guides/07-query-call-members.mdx b/packages/client/docusaurus/docs/javascript/02-guides/07-query-call-members.mdx
new file mode 100644
index 0000000000..8ff806876d
--- /dev/null
+++ b/packages/client/docusaurus/docs/javascript/02-guides/07-query-call-members.mdx
@@ -0,0 +1,58 @@
+---
+id: querying-call-members
+title: Querying Call Members
+description: How to query call members
+---
+
+import FilterConditions from '../../../shared/_filter-operators.mdx';
+import CallMemberFilters from '../../../shared/video/_call-member-filters.mdx';
+import CallMemberSort from '../../../shared/video/_call-member-sort-fields.mdx';
+
+When you create or join a call you get a list of call members, however this can return at most 100 members:
+
+```typescript
+// The maximum limit is 100
+// The default limit is 25
+await call.getOrCreate({ members_limit: 100 });
+
+// or
+await call.join({ members_limit: 100 });
+```
+
+To get the complete list of call members the Stream API allows you to query, filter and sort members of a call using a paginated list.
+
+## Examples
+
+Below are a few examples of how to use this API:
+
+```typescript
+const result = await call.queryMembers();
+
+// sorting and pagination
+const queryMembersReq = {
+ sort: [{ field: 'user_id', direction: 1 }],
+ limit: 2,
+};
+const result = await call.queryMembers(queryMembersReq);
+
+// loading the next page
+const result = await call.queryMembers({
+ ...queryMembersReq,
+ next: result.next,
+});
+
+// filtering
+const result = await call.queryMembers({
+ filter_conditions: { role: { $eq: 'admin' } },
+});
+```
+
+## Sort options
+
+
+
+## Filter options
+
+
+
+
diff --git a/packages/client/package.json b/packages/client/package.json
index f9a4d7eb77..b309114185 100644
--- a/packages/client/package.json
+++ b/packages/client/package.json
@@ -1,6 +1,6 @@
{
"name": "@stream-io/video-client",
- "version": "1.6.0",
+ "version": "1.7.3",
"packageManager": "yarn@3.2.4",
"main": "dist/index.cjs.js",
"module": "dist/index.es.js",
@@ -43,10 +43,10 @@
},
"devDependencies": {
"@openapitools/openapi-generator-cli": "^2.13.4",
- "@rollup/plugin-replace": "^5.0.5",
+ "@rollup/plugin-replace": "^5.0.7",
"@rollup/plugin-typescript": "^11.1.6",
"@stream-io/audio-filters-web": "workspace:^",
- "@stream-io/node-sdk": "^0.4.0",
+ "@stream-io/node-sdk": "^0.4.3",
"@types/sdp-transform": "^2.4.7",
"@types/ua-parser-js": "^0.7.37",
"@vitest/coverage-v8": "^0.34.4",
@@ -54,9 +54,9 @@
"happy-dom": "^11.0.2",
"prettier": "^3.3.2",
"rimraf": "^5.0.7",
- "rollup": "^3.29.4",
+ "rollup": "^4.22.0",
"typescript": "^5.5.2",
- "vite": "^4.4.11",
+ "vite": "^5.4.6",
"vitest": "^1.0.0",
"vitest-mock-extended": "^1.2.1"
}
diff --git a/packages/client/src/Call.ts b/packages/client/src/Call.ts
index 5f49f63aff..d89e32fc42 100644
--- a/packages/client/src/Call.ts
+++ b/packages/client/src/Call.ts
@@ -804,6 +804,7 @@ export class Call {
logTag: String(this.sfuClientTag++),
dispatcher: this.dispatcher,
credentials: this.credentials,
+ streamClient: this.streamClient,
// a new session_id is necessary for the REJOIN strategy.
// we use the previous session_id if available
sessionId: performingRejoin ? undefined : previousSessionId,
@@ -1324,9 +1325,10 @@ export class Call {
case TrackType.VIDEO:
const videoStream = this.camera.state.mediaStream;
if (videoStream) {
- await this.publishVideoStream(videoStream, {
- preferredCodec: this.camera.preferredCodec,
- });
+ await this.publishVideoStream(
+ videoStream,
+ this.camera.publishOptions,
+ );
}
break;
case TrackType.SCREEN_SHARE:
@@ -2209,9 +2211,10 @@ export class Call {
this.camera.state.mediaStream &&
!this.publisher?.isPublishing(TrackType.VIDEO)
) {
- await this.publishVideoStream(this.camera.state.mediaStream, {
- preferredCodec: this.camera.preferredCodec,
- });
+ await this.publishVideoStream(
+ this.camera.state.mediaStream,
+ this.camera.publishOptions,
+ );
}
// Start camera if backend config specifies, and there is no local setting
diff --git a/packages/client/src/StreamSfuClient.ts b/packages/client/src/StreamSfuClient.ts
index df928d2747..eca72c36c4 100644
--- a/packages/client/src/StreamSfuClient.ts
+++ b/packages/client/src/StreamSfuClient.ts
@@ -24,6 +24,7 @@ import {
UpdateMuteStatesRequest,
} from './gen/video/sfu/signal_rpc/signal';
import { ICETrickle, TrackType } from './gen/video/sfu/models/models';
+import { StreamClient } from './coordinator/connection/client';
import { generateUUIDv4, sleep } from './coordinator/connection/utils';
import { Credentials } from './gen/coordinator';
import { Logger } from './coordinator/connection/types';
@@ -65,6 +66,11 @@ export type StreamSfuClientConstructor = {
* Callback for when the WebSocket connection is closed.
*/
onSignalClose?: () => void;
+
+ /**
+ * The StreamClient instance to use for the connection.
+ */
+ streamClient: StreamClient;
};
/**
@@ -112,12 +118,14 @@ export class StreamSfuClient {
private lastMessageTimestamp?: Date;
private readonly restoreWebSocketConcurrencyTag = Symbol('recoverWebSocket');
private readonly unsubscribeIceTrickle: () => void;
+ private readonly unsubscribeNetworkChanged: () => void;
private readonly onSignalClose: (() => void) | undefined;
private readonly logger: Logger;
private readonly logTag: string;
private readonly credentials: Credentials;
private readonly dispatcher: Dispatcher;
private readonly joinResponseTimeout?: number;
+ private networkAvailableTask: PromiseWithResolvers | undefined;
/**
* Promise that resolves when the JoinResponse is received.
* Rejects after a certain threshold if the response is not received.
@@ -163,6 +171,7 @@ export class StreamSfuClient {
logTag,
joinResponseTimeout = 5000,
onSignalClose,
+ streamClient,
}: StreamSfuClientConstructor) {
this.dispatcher = dispatcher;
this.sessionId = sessionId || generateUUIDv4();
@@ -193,6 +202,16 @@ export class StreamSfuClient {
this.iceTrickleBuffer.push(iceTrickle);
});
+ // listen to network changes to handle offline state
+ // we shouldn't attempt to recover websocket connection when offline
+ this.unsubscribeNetworkChanged = streamClient.on('network.changed', (e) => {
+ if (!e.online) {
+ this.networkAvailableTask = promiseWithResolvers();
+ } else {
+ this.networkAvailableTask?.resolve();
+ }
+ });
+
this.createWebSocket();
}
@@ -226,6 +245,7 @@ export class StreamSfuClient {
private restoreWebSocket = () => {
withoutConcurrency(this.restoreWebSocketConcurrencyTag, async () => {
+ await this.networkAvailableTask?.promise;
this.logger('debug', 'Restoring SFU WS connection');
this.cleanUpWebSocket();
await sleep(500);
@@ -260,6 +280,7 @@ export class StreamSfuClient {
dispose = () => {
this.logger('debug', 'Disposing SFU client');
this.unsubscribeIceTrickle();
+ this.unsubscribeNetworkChanged();
clearInterval(this.keepAliveInterval);
clearTimeout(this.connectionCheckTimeout);
clearTimeout(this.migrateAwayTimeout);
diff --git a/packages/client/src/StreamVideoClient.ts b/packages/client/src/StreamVideoClient.ts
index c3bb531dbd..01285741c0 100644
--- a/packages/client/src/StreamVideoClient.ts
+++ b/packages/client/src/StreamVideoClient.ts
@@ -320,6 +320,7 @@ export class StreamVideoClient {
return;
}
const userId = this.streamClient.user?.id;
+ const apiKey = this.streamClient.key;
const disconnectUser = () => this.streamClient.disconnectUser(timeout);
this.disconnectionPromise = this.connectionPromise
? this.connectionPromise.then(() => disconnectUser())
@@ -329,7 +330,7 @@ export class StreamVideoClient {
);
await this.disconnectionPromise;
if (userId) {
- StreamVideoClient._instanceMap.delete(userId);
+ StreamVideoClient._instanceMap.delete(apiKey + userId);
}
this.eventHandlersToUnregister.forEach((unregister) => unregister());
this.eventHandlersToUnregister = [];
diff --git a/packages/client/src/__tests__/Call.test.ts b/packages/client/src/__tests__/Call.test.ts
index a16243c48d..f6f77c4c58 100644
--- a/packages/client/src/__tests__/Call.test.ts
+++ b/packages/client/src/__tests__/Call.test.ts
@@ -210,6 +210,46 @@ describe('state updates in reponse to coordinator API', () => {
await call.leave();
});
+ it('should query call members', async () => {
+ await call.getOrCreate({
+ data: {
+ members: [
+ { user_id: 'sara', role: 'admin' },
+ { user_id: 'jane' },
+ { user_id: 'jack' },
+ ],
+ },
+ });
+
+ // default sorting
+ let result = await call.queryMembers();
+
+ expect(result.members.length).toBe(3);
+
+ // sorting and pagination
+ const queryMembersReq = {
+ sort: [{ field: 'user_id', direction: 1 }],
+ limit: 2,
+ };
+ result = await call.queryMembers(queryMembersReq);
+
+ expect(result.members.length).toBe(2);
+ expect(result.members[0].user_id).toBe('jack');
+ expect(result.members[1].user_id).toBe('jane');
+
+ // loading next page
+ result = await call.queryMembers({ ...queryMembersReq, next: result.next });
+
+ expect(result.members.length).toBe(1);
+
+ result = await call.queryMembers({
+ filter_conditions: { role: { $eq: 'admin' } },
+ });
+
+ expect(result.members.length).toBe(1);
+ expect(result.members[0].user_id).toBe('sara');
+ });
+
afterEach(async () => {
await serverClient.video.call(call.type, call.id).delete({ hard: true });
});
diff --git a/packages/client/src/coordinator/connection/client.ts b/packages/client/src/coordinator/connection/client.ts
index d551e60811..d52cec2464 100644
--- a/packages/client/src/coordinator/connection/client.ts
+++ b/packages/client/src/coordinator/connection/client.ts
@@ -47,7 +47,6 @@ export class StreamClient {
axiosInstance: AxiosInstance;
baseURL?: string;
browser: boolean;
- cleaningIntervalRef?: NodeJS.Timeout;
clientID?: string;
key: string;
listeners: Partial<
@@ -323,11 +322,6 @@ export class StreamClient {
* https://developer.mozilla.org/en-US/docs/Web/API/CloseEvent
*/
closeConnection = async (timeout?: number) => {
- if (this.cleaningIntervalRef != null) {
- clearInterval(this.cleaningIntervalRef);
- this.cleaningIntervalRef = undefined;
- }
-
await Promise.all([
this.wsConnection?.disconnect(timeout),
this.wsFallback?.disconnect(timeout),
@@ -365,12 +359,7 @@ export class StreamClient {
return Promise.resolve();
}
- this.connectionIdPromise = new Promise(
- (resolve, reject) => {
- this.resolveConnectionId = resolve;
- this.rejectConnectionId = reject;
- },
- );
+ this._setupConnectionIdPromise();
this.clientID = `${this.userID}--${randomId()}`;
this.wsPromise = this.connect();
@@ -434,12 +423,7 @@ export class StreamClient {
tokenOrProvider: TokenOrProvider,
) => {
addConnectionEventListeners(this.updateNetworkConnectionStatus);
- this.connectionIdPromise = new Promise(
- (resolve, reject) => {
- this.resolveConnectionId = resolve;
- this.rejectConnectionId = reject;
- },
- );
+ this._setupConnectionIdPromise();
this.anonymous = true;
await this._setToken(user, tokenOrProvider, this.anonymous);
@@ -493,6 +477,19 @@ export class StreamClient {
);
};
+ /**
+ * sets up the this.connectionIdPromise
+ */
+ _setupConnectionIdPromise = async () => {
+ /** a promise that is resolved once connection id is set */
+ this.connectionIdPromise = new Promise(
+ (resolve, reject) => {
+ this.resolveConnectionId = resolve;
+ this.rejectConnectionId = reject;
+ },
+ );
+ };
+
_logApiRequest = (
type: string,
url: string,
@@ -540,8 +537,17 @@ export class StreamClient {
await Promise.all([
this.tokenManager.tokenReady(),
this.guestUserCreatePromise,
- this.connectionIdPromise,
]);
+ // we need to wait for presence of connection id before making requests
+ try {
+ await this.connectionIdPromise;
+ } catch (e) {
+ // in case connection id was rejected
+ // reconnection maybe in progress
+ // we can wait for healthy connection to resolve, which rejects when 15s timeout is reached
+ await this.wsConnection?._waitForHealthy();
+ await this.connectionIdPromise;
+ }
}
const requestConfig = this._enrichAxiosOptions(options);
try {
diff --git a/packages/client/src/coordinator/connection/connection.ts b/packages/client/src/coordinator/connection/connection.ts
index e95c863a8e..9a2f04bdbb 100644
--- a/packages/client/src/coordinator/connection/connection.ts
+++ b/packages/client/src/coordinator/connection/connection.ts
@@ -8,6 +8,7 @@ import {
import {
addConnectionEventListeners,
convertErrorToJson,
+ isPromisePending,
KnownCodes,
randomId,
removeConnectionEventListeners,
@@ -337,6 +338,15 @@ export class StableWSConnection {
await this.client.tokenManager.loadToken();
}
+ let mustSetupConnectionIdPromise = true;
+ if (this.client.connectionIdPromise) {
+ if (await isPromisePending(this.client.connectionIdPromise)) {
+ mustSetupConnectionIdPromise = false;
+ }
+ }
+ if (mustSetupConnectionIdPromise) {
+ this.client._setupConnectionIdPromise();
+ }
this._setupConnectionPromise();
const wsURL = this._buildUrl();
this._log(`_connect() - Connecting to ${wsURL}`, {
@@ -369,6 +379,7 @@ export class StableWSConnection {
return response;
}
} catch (err) {
+ await this.client._setupConnectionIdPromise();
this.isConnecting = false;
// @ts-ignore
this._log(`_connect() - Error - `, err);
diff --git a/packages/client/src/coordinator/connection/utils.ts b/packages/client/src/coordinator/connection/utils.ts
index 73403b6c55..2276e7c006 100644
--- a/packages/client/src/coordinator/connection/utils.ts
+++ b/packages/client/src/coordinator/connection/utils.ts
@@ -110,6 +110,17 @@ export function convertErrorToJson(err: Error) {
return jsonObj;
}
+/**
+ * Informs if a promise is yet to be resolved or rejected
+ */
+export async function isPromisePending(promise: Promise) {
+ const emptyObj = {};
+ return Promise.race([promise, emptyObj]).then(
+ (value) => (value === emptyObj ? true : false),
+ () => false,
+ );
+}
+
/**
* isOnline safely return the navigator.online value for browser env
* if navigator is not in global object, it always return true
diff --git a/packages/client/src/devices/CameraManager.ts b/packages/client/src/devices/CameraManager.ts
index d9db282947..f82aef4eb7 100644
--- a/packages/client/src/devices/CameraManager.ts
+++ b/packages/client/src/devices/CameraManager.ts
@@ -4,8 +4,7 @@ import { CameraDirection, CameraManagerState } from './CameraManagerState';
import { InputMediaDeviceManager } from './InputMediaDeviceManager';
import { getVideoDevices, getVideoStream } from './devices';
import { TrackType } from '../gen/video/sfu/models/models';
-
-type PreferredCodec = 'vp8' | 'vp9' | 'av1' | 'h264' | string;
+import { PreferredCodec, PublishOptions } from '../types';
export class CameraManager extends InputMediaDeviceManager {
private targetResolution = {
@@ -14,17 +13,17 @@ export class CameraManager extends InputMediaDeviceManager {
};
/**
- * The preferred codec for encoding the video.
+ * The options to use when publishing the video stream.
*
- * @internal internal use only, not part of the public API.
+ * @internal
*/
- preferredCodec: PreferredCodec | undefined;
+ publishOptions: PublishOptions | undefined;
+
/**
- * The scalability mode to use for the codec.
- * @internal internal use only, not part of the public API.
+ * Constructs a new CameraManager.
+ *
+ * @param call the call instance.
*/
- scalabilityMode: string | undefined;
-
constructor(call: Call) {
super(call, new CameraManagerState(), TrackType.VIDEO);
}
@@ -88,11 +87,37 @@ export class CameraManager extends InputMediaDeviceManager {
*
* @internal internal use only, not part of the public API.
* @param codec the codec to use for encoding the video.
- * @param scalabilityMode the scalability mode to use for the codec.
*/
- setPreferredCodec(codec: PreferredCodec, scalabilityMode?: string) {
- this.preferredCodec = codec;
- this.scalabilityMode = scalabilityMode;
+ setPreferredCodec(codec: PreferredCodec | undefined) {
+ this.updatePublishOptions({ preferredCodec: codec });
+ }
+
+ /**
+ * Updates the preferred publish options for the video stream.
+ *
+ * @internal
+ * @param options the options to use.
+ */
+ updatePublishOptions(options: PublishOptions) {
+ this.publishOptions = { ...this.publishOptions, ...options };
+ }
+
+ /**
+ * Returns the capture resolution of the camera.
+ */
+ getCaptureResolution() {
+ const { mediaStream } = this.state;
+ if (!mediaStream) return;
+
+ const [videoTrack] = mediaStream.getVideoTracks();
+ if (!videoTrack) return;
+
+ const settings = videoTrack.getSettings();
+ return {
+ width: settings.width,
+ height: settings.height,
+ frameRate: settings.frameRate,
+ };
}
protected getDevices(): Observable {
@@ -114,10 +139,7 @@ export class CameraManager extends InputMediaDeviceManager {
}
protected publishStream(stream: MediaStream): Promise {
- return this.call.publishVideoStream(stream, {
- preferredCodec: this.preferredCodec,
- scalabilityMode: this.scalabilityMode,
- });
+ return this.call.publishVideoStream(stream, this.publishOptions);
}
protected stopPublishStream(stopTracks: boolean): Promise {
diff --git a/packages/client/src/devices/InputMediaDeviceManager.ts b/packages/client/src/devices/InputMediaDeviceManager.ts
index 5c4944950e..0b13138165 100644
--- a/packages/client/src/devices/InputMediaDeviceManager.ts
+++ b/packages/client/src/devices/InputMediaDeviceManager.ts
@@ -223,10 +223,12 @@ export abstract class InputMediaDeviceManager<
};
protected async applySettingsToStream() {
- if (this.enabled) {
- await this.muteStream();
- await this.unmuteStream();
- }
+ await withCancellation(this.statusChangeConcurrencyTag, async () => {
+ if (this.enabled) {
+ await this.muteStream();
+ await this.unmuteStream();
+ }
+ });
}
protected abstract getDevices(): Observable;
@@ -394,17 +396,21 @@ export abstract class InputMediaDeviceManager<
}
if (this.state.mediaStream !== stream) {
this.state.setMediaStream(stream, await rootStream);
+ const handleTrackEnded = async () => {
+ await this.statusChangeSettled();
+ if (this.enabled) {
+ this.isTrackStoppedDueToTrackEnd = true;
+ setTimeout(() => {
+ this.isTrackStoppedDueToTrackEnd = false;
+ }, 2000);
+ await this.disable();
+ }
+ };
this.getTracks().forEach((track) => {
- track.addEventListener('ended', async () => {
- await this.statusChangeSettled();
- if (this.enabled) {
- this.isTrackStoppedDueToTrackEnd = true;
- setTimeout(() => {
- this.isTrackStoppedDueToTrackEnd = false;
- }, 2000);
- await this.disable();
- }
- });
+ track.addEventListener('ended', handleTrackEnded);
+ this.subscriptions.push(() =>
+ track.removeEventListener('ended', handleTrackEnded),
+ );
});
}
}
diff --git a/packages/client/src/devices/__tests__/CameraManager.test.ts b/packages/client/src/devices/__tests__/CameraManager.test.ts
index 8d8fb8d0e4..656b5e48b2 100644
--- a/packages/client/src/devices/__tests__/CameraManager.test.ts
+++ b/packages/client/src/devices/__tests__/CameraManager.test.ts
@@ -82,9 +82,7 @@ describe('CameraManager', () => {
expect(manager['call'].publishVideoStream).toHaveBeenCalledWith(
manager.state.mediaStream,
- {
- preferredCodec: undefined,
- },
+ undefined,
);
});
diff --git a/packages/client/src/events/__tests__/call.test.ts b/packages/client/src/events/__tests__/call.test.ts
index 4939e4d078..e005dfc14a 100644
--- a/packages/client/src/events/__tests__/call.test.ts
+++ b/packages/client/src/events/__tests__/call.test.ts
@@ -1,6 +1,11 @@
import { describe, expect, it, vi } from 'vitest';
import { CallingState, StreamVideoWriteableStateStore } from '../../store';
-import { watchCallAccepted, watchCallEnded, watchCallRejected } from '../call';
+import {
+ watchCallAccepted,
+ watchCallEnded,
+ watchCallRejected,
+ watchSfuCallEnded,
+} from '../call';
import {
CallAcceptedEvent,
CallEndedEvent,
@@ -8,6 +13,8 @@ import {
} from '../../gen/coordinator';
import { Call } from '../../Call';
import { StreamClient } from '../../coordinator/connection/client';
+import { SfuEvent } from '../../gen/video/sfu/event/events';
+import { CallEndedReason } from '../../gen/video/sfu/models/models';
describe('Call ringing events', () => {
describe(`call.accepted`, () => {
@@ -263,6 +270,46 @@ describe('Call ringing events', () => {
expect(call.leave).not.toHaveBeenCalled();
});
});
+
+ describe('callEnded (SFU)', () => {
+ it('will leave the call if not already left', async () => {
+ const call = fakeCall();
+ vi.spyOn(call, 'leave').mockImplementation(async () => {
+ console.log(`TEST: leave() called`);
+ });
+
+ watchSfuCallEnded(call);
+ const event: SfuEvent = {
+ eventPayload: {
+ oneofKind: 'callEnded',
+ callEnded: { reason: CallEndedReason.ENDED },
+ },
+ };
+ call['dispatcher'].dispatch(event);
+
+ expect(call.leave).toHaveBeenCalled();
+ expect(call.state.endedAt).toBeDefined();
+ });
+
+ it('will not leave the call if already left', async () => {
+ const call = fakeCall();
+ call.state.setCallingState(CallingState.LEFT);
+ vi.spyOn(call, 'leave').mockImplementation(async () => {
+ console.log(`TEST: leave() called`);
+ });
+
+ watchSfuCallEnded(call);
+ const event: SfuEvent = {
+ eventPayload: {
+ oneofKind: 'callEnded',
+ callEnded: { reason: CallEndedReason.KICKED },
+ },
+ };
+ call['dispatcher'].dispatch(event);
+
+ expect(call.leave).not.toHaveBeenCalled();
+ });
+ });
});
const fakeCall = ({ ring = true, currentUserId = 'test-user-id' } = {}) => {
diff --git a/packages/client/src/events/call.ts b/packages/client/src/events/call.ts
index 13a791358d..f0de9b6ea6 100644
--- a/packages/client/src/events/call.ts
+++ b/packages/client/src/events/call.ts
@@ -1,6 +1,8 @@
import { CallingState } from '../store';
import { Call } from '../Call';
import type { CallAcceptedEvent, CallRejectedEvent } from '../gen/coordinator';
+import { CallEnded } from '../gen/video/sfu/event/events';
+import { CallEndedReason } from '../gen/video/sfu/models/models';
/**
* Event handler that watched the delivery of `call.accepted`.
@@ -71,14 +73,39 @@ export const watchCallRejected = (call: Call) => {
* Event handler that watches the delivery of `call.ended` Websocket event.
*/
export const watchCallEnded = (call: Call) => {
- return async function onCallEnded() {
+ return function onCallEnded() {
const { callingState } = call.state;
if (
callingState === CallingState.RINGING ||
callingState === CallingState.JOINED ||
callingState === CallingState.JOINING
) {
- await call.leave({ reason: 'call.ended event received' });
+ call.leave({ reason: 'call.ended event received' }).catch((err) => {
+ call.logger('error', 'Failed to leave call after call.ended ', err);
+ });
}
};
};
+
+/**
+ * Watches for `callEnded` events.
+ */
+export const watchSfuCallEnded = (call: Call) => {
+ return call.on('callEnded', async (e: CallEnded) => {
+ if (call.state.callingState === CallingState.LEFT) return;
+ try {
+ // `call.ended` event arrived after the call is already left
+ // and all event handlers are detached. We need to manually
+ // update the call state to reflect the call has ended.
+ call.state.setEndedAt(new Date());
+ const reason = CallEndedReason[e.reason];
+ await call.leave({ reason: `callEnded received: ${reason}` });
+ } catch (err) {
+ call.logger(
+ 'error',
+ 'Failed to leave call after being ended by the SFU',
+ err,
+ );
+ }
+ });
+};
diff --git a/packages/client/src/events/internal.ts b/packages/client/src/events/internal.ts
index 14c1a54375..b74719f74f 100644
--- a/packages/client/src/events/internal.ts
+++ b/packages/client/src/events/internal.ts
@@ -3,16 +3,13 @@ import { Call } from '../Call';
import { CallState } from '../store';
import { StreamVideoParticipantPatches } from '../types';
import { getLogger } from '../logger';
-import type { CallEnded, PinsChanged } from '../gen/video/sfu/event/events';
+import type { PinsChanged } from '../gen/video/sfu/event/events';
import {
- CallEndedReason,
ErrorCode,
WebsocketReconnectStrategy,
} from '../gen/video/sfu/models/models';
import { OwnCapability } from '../gen/coordinator';
-const logger = getLogger(['events']);
-
/**
* An event responder which handles the `changePublishQuality` event.
*/
@@ -74,7 +71,7 @@ export const watchLiveEnded = (dispatcher: Dispatcher, call: Call) => {
if (!call.permissionsContext.hasPermission(OwnCapability.JOIN_BACKSTAGE)) {
call.leave({ reason: 'live ended' }).catch((err) => {
- logger('error', 'Failed to leave call after live ended', err);
+ call.logger('error', 'Failed to leave call after live ended', err);
});
}
});
@@ -86,6 +83,7 @@ export const watchLiveEnded = (dispatcher: Dispatcher, call: Call) => {
export const watchSfuErrorReports = (dispatcher: Dispatcher) => {
return dispatcher.on('error', (e) => {
if (!e.error) return;
+ const logger = getLogger(['SfuClient']);
const { error, reconnectStrategy } = e;
logger('error', 'SFU reported error', {
code: ErrorCode[error.code],
@@ -106,15 +104,3 @@ export const watchPinsUpdated = (state: CallState) => {
state.setServerSidePins(pins);
};
};
-
-/**
- * Watches for `callEnded` events.
- */
-export const watchSfuCallEnded = (call: Call) => {
- return call.on('callEnded', (e: CallEnded) => {
- const reason = CallEndedReason[e.reason];
- call.leave({ reason }).catch((err) => {
- logger('error', 'Failed to leave call after call ended by the SFU', err);
- });
- });
-};
diff --git a/packages/client/src/gen/google/protobuf/struct.ts b/packages/client/src/gen/google/protobuf/struct.ts
index b8754e4fb7..f449f4e0b0 100644
--- a/packages/client/src/gen/google/protobuf/struct.ts
+++ b/packages/client/src/gen/google/protobuf/struct.ts
@@ -1,5 +1,5 @@
/* eslint-disable */
-// @generated by protobuf-ts 2.9.4 with parameter long_type_string,client_generic,server_none,eslint_disable
+// @generated by protobuf-ts 2.9.4 with parameter long_type_string,client_generic,server_none,eslint_disable,optimize_code_size
// @generated from protobuf file "google/protobuf/struct.proto" (package "google.protobuf", syntax proto3)
// tslint:disable
//
@@ -34,23 +34,15 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
import type {
- BinaryReadOptions,
- BinaryWriteOptions,
- IBinaryReader,
- IBinaryWriter,
JsonObject,
JsonReadOptions,
JsonValue,
JsonWriteOptions,
- PartialMessage,
} from '@protobuf-ts/runtime';
import {
isJsonObject,
MessageType,
- reflectionMergePartial,
typeofJsonValue,
- UnknownFieldHandler,
- WireType,
} from '@protobuf-ts/runtime';
/**
@@ -224,97 +216,6 @@ class Struct$Type extends MessageType {
}
return target;
}
- create(value?: PartialMessage): Struct {
- const message = globalThis.Object.create(this.messagePrototype!);
- message.fields = {};
- if (value !== undefined)
- reflectionMergePartial(this, message, value);
- return message;
- }
- internalBinaryRead(
- reader: IBinaryReader,
- length: number,
- options: BinaryReadOptions,
- target?: Struct,
- ): Struct {
- let message = target ?? this.create(),
- end = reader.pos + length;
- while (reader.pos < end) {
- let [fieldNo, wireType] = reader.tag();
- switch (fieldNo) {
- case /* map fields */ 1:
- this.binaryReadMap1(message.fields, reader, options);
- break;
- default:
- let u = options.readUnknownField;
- if (u === 'throw')
- throw new globalThis.Error(
- `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`,
- );
- let d = reader.skip(wireType);
- if (u !== false)
- (u === true ? UnknownFieldHandler.onRead : u)(
- this.typeName,
- message,
- fieldNo,
- wireType,
- d,
- );
- }
- }
- return message;
- }
- private binaryReadMap1(
- map: Struct['fields'],
- reader: IBinaryReader,
- options: BinaryReadOptions,
- ): void {
- let len = reader.uint32(),
- end = reader.pos + len,
- key: keyof Struct['fields'] | undefined,
- val: Struct['fields'][any] | undefined;
- while (reader.pos < end) {
- let [fieldNo, wireType] = reader.tag();
- switch (fieldNo) {
- case 1:
- key = reader.string();
- break;
- case 2:
- val = Value.internalBinaryRead(reader, reader.uint32(), options);
- break;
- default:
- throw new globalThis.Error(
- 'unknown map entry field for field google.protobuf.Struct.fields',
- );
- }
- }
- map[key ?? ''] = val ?? Value.create();
- }
- internalBinaryWrite(
- message: Struct,
- writer: IBinaryWriter,
- options: BinaryWriteOptions,
- ): IBinaryWriter {
- /* map fields = 1; */
- for (let k of globalThis.Object.keys(message.fields)) {
- writer
- .tag(1, WireType.LengthDelimited)
- .fork()
- .tag(1, WireType.LengthDelimited)
- .string(k);
- writer.tag(2, WireType.LengthDelimited).fork();
- Value.internalBinaryWrite(message.fields[k], writer, options);
- writer.join().join();
- }
- let u = options.writeUnknownFields;
- if (u !== false)
- (u == true ? UnknownFieldHandler.onWrite : u)(
- this.typeName,
- message,
- writer,
- );
- return writer;
- }
}
/**
* @generated MessageType for protobuf message google.protobuf.Struct
@@ -444,129 +345,6 @@ class Value$Type extends MessageType {
}
return target;
}
- create(value?: PartialMessage): Value {
- const message = globalThis.Object.create(this.messagePrototype!);
- message.kind = { oneofKind: undefined };
- if (value !== undefined)
- reflectionMergePartial(this, message, value);
- return message;
- }
- internalBinaryRead(
- reader: IBinaryReader,
- length: number,
- options: BinaryReadOptions,
- target?: Value,
- ): Value {
- let message = target ?? this.create(),
- end = reader.pos + length;
- while (reader.pos < end) {
- let [fieldNo, wireType] = reader.tag();
- switch (fieldNo) {
- case /* google.protobuf.NullValue null_value */ 1:
- message.kind = {
- oneofKind: 'nullValue',
- nullValue: reader.int32(),
- };
- break;
- case /* double number_value */ 2:
- message.kind = {
- oneofKind: 'numberValue',
- numberValue: reader.double(),
- };
- break;
- case /* string string_value */ 3:
- message.kind = {
- oneofKind: 'stringValue',
- stringValue: reader.string(),
- };
- break;
- case /* bool bool_value */ 4:
- message.kind = {
- oneofKind: 'boolValue',
- boolValue: reader.bool(),
- };
- break;
- case /* google.protobuf.Struct struct_value */ 5:
- message.kind = {
- oneofKind: 'structValue',
- structValue: Struct.internalBinaryRead(
- reader,
- reader.uint32(),
- options,
- (message.kind as any).structValue,
- ),
- };
- break;
- case /* google.protobuf.ListValue list_value */ 6:
- message.kind = {
- oneofKind: 'listValue',
- listValue: ListValue.internalBinaryRead(
- reader,
- reader.uint32(),
- options,
- (message.kind as any).listValue,
- ),
- };
- break;
- default:
- let u = options.readUnknownField;
- if (u === 'throw')
- throw new globalThis.Error(
- `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`,
- );
- let d = reader.skip(wireType);
- if (u !== false)
- (u === true ? UnknownFieldHandler.onRead : u)(
- this.typeName,
- message,
- fieldNo,
- wireType,
- d,
- );
- }
- }
- return message;
- }
- internalBinaryWrite(
- message: Value,
- writer: IBinaryWriter,
- options: BinaryWriteOptions,
- ): IBinaryWriter {
- /* google.protobuf.NullValue null_value = 1; */
- if (message.kind.oneofKind === 'nullValue')
- writer.tag(1, WireType.Varint).int32(message.kind.nullValue);
- /* double number_value = 2; */
- if (message.kind.oneofKind === 'numberValue')
- writer.tag(2, WireType.Bit64).double(message.kind.numberValue);
- /* string string_value = 3; */
- if (message.kind.oneofKind === 'stringValue')
- writer.tag(3, WireType.LengthDelimited).string(message.kind.stringValue);
- /* bool bool_value = 4; */
- if (message.kind.oneofKind === 'boolValue')
- writer.tag(4, WireType.Varint).bool(message.kind.boolValue);
- /* google.protobuf.Struct struct_value = 5; */
- if (message.kind.oneofKind === 'structValue')
- Struct.internalBinaryWrite(
- message.kind.structValue,
- writer.tag(5, WireType.LengthDelimited).fork(),
- options,
- ).join();
- /* google.protobuf.ListValue list_value = 6; */
- if (message.kind.oneofKind === 'listValue')
- ListValue.internalBinaryWrite(
- message.kind.listValue,
- writer.tag(6, WireType.LengthDelimited).fork(),
- options,
- ).join();
- let u = options.writeUnknownFields;
- if (u !== false)
- (u == true ? UnknownFieldHandler.onWrite : u)(
- this.typeName,
- message,
- writer,
- );
- return writer;
- }
}
/**
* @generated MessageType for protobuf message google.protobuf.Value
@@ -611,69 +389,6 @@ class ListValue$Type extends MessageType {
target.values.push(...values);
return target;
}
- create(value?: PartialMessage): ListValue {
- const message = globalThis.Object.create(this.messagePrototype!);
- message.values = [];
- if (value !== undefined)
- reflectionMergePartial(this, message, value);
- return message;
- }
- internalBinaryRead(
- reader: IBinaryReader,
- length: number,
- options: BinaryReadOptions,
- target?: ListValue,
- ): ListValue {
- let message = target ?? this.create(),
- end = reader.pos + length;
- while (reader.pos < end) {
- let [fieldNo, wireType] = reader.tag();
- switch (fieldNo) {
- case /* repeated google.protobuf.Value values */ 1:
- message.values.push(
- Value.internalBinaryRead(reader, reader.uint32(), options),
- );
- break;
- default:
- let u = options.readUnknownField;
- if (u === 'throw')
- throw new globalThis.Error(
- `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`,
- );
- let d = reader.skip(wireType);
- if (u !== false)
- (u === true ? UnknownFieldHandler.onRead : u)(
- this.typeName,
- message,
- fieldNo,
- wireType,
- d,
- );
- }
- }
- return message;
- }
- internalBinaryWrite(
- message: ListValue,
- writer: IBinaryWriter,
- options: BinaryWriteOptions,
- ): IBinaryWriter {
- /* repeated google.protobuf.Value values = 1; */
- for (let i = 0; i < message.values.length; i++)
- Value.internalBinaryWrite(
- message.values[i],
- writer.tag(1, WireType.LengthDelimited).fork(),
- options,
- ).join();
- let u = options.writeUnknownFields;
- if (u !== false)
- (u == true ? UnknownFieldHandler.onWrite : u)(
- this.typeName,
- message,
- writer,
- );
- return writer;
- }
}
/**
* @generated MessageType for protobuf message google.protobuf.ListValue
diff --git a/packages/client/src/gen/google/protobuf/timestamp.ts b/packages/client/src/gen/google/protobuf/timestamp.ts
index bc1f78672b..7f690766f4 100644
--- a/packages/client/src/gen/google/protobuf/timestamp.ts
+++ b/packages/client/src/gen/google/protobuf/timestamp.ts
@@ -1,5 +1,5 @@
/* eslint-disable */
-// @generated by protobuf-ts 2.9.4 with parameter long_type_string,client_generic,server_none,eslint_disable
+// @generated by protobuf-ts 2.9.4 with parameter long_type_string,client_generic,server_none,eslint_disable,optimize_code_size
// @generated from protobuf file "google/protobuf/timestamp.proto" (package "google.protobuf", syntax proto3)
// tslint:disable
//
@@ -34,23 +34,11 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
import type {
- BinaryReadOptions,
- BinaryWriteOptions,
- IBinaryReader,
- IBinaryWriter,
JsonReadOptions,
JsonValue,
JsonWriteOptions,
- PartialMessage,
-} from '@protobuf-ts/runtime';
-import {
- MessageType,
- PbLong,
- reflectionMergePartial,
- typeofJsonValue,
- UnknownFieldHandler,
- WireType,
} from '@protobuf-ts/runtime';
+import { MessageType, PbLong, typeofJsonValue } from '@protobuf-ts/runtime';
/**
* A Timestamp represents a point in time independent of any time zone or local
@@ -283,70 +271,6 @@ class Timestamp$Type extends MessageType {
1000000000;
return target;
}
- create(value?: PartialMessage): Timestamp {
- const message = globalThis.Object.create(this.messagePrototype!);
- message.seconds = '0';
- message.nanos = 0;
- if (value !== undefined)
- reflectionMergePartial(this, message, value);
- return message;
- }
- internalBinaryRead(
- reader: IBinaryReader,
- length: number,
- options: BinaryReadOptions,
- target?: Timestamp,
- ): Timestamp {
- let message = target ?? this.create(),
- end = reader.pos + length;
- while (reader.pos < end) {
- let [fieldNo, wireType] = reader.tag();
- switch (fieldNo) {
- case /* int64 seconds */ 1:
- message.seconds = reader.int64().toString();
- break;
- case /* int32 nanos */ 2:
- message.nanos = reader.int32();
- break;
- default:
- let u = options.readUnknownField;
- if (u === 'throw')
- throw new globalThis.Error(
- `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`,
- );
- let d = reader.skip(wireType);
- if (u !== false)
- (u === true ? UnknownFieldHandler.onRead : u)(
- this.typeName,
- message,
- fieldNo,
- wireType,
- d,
- );
- }
- }
- return message;
- }
- internalBinaryWrite(
- message: Timestamp,
- writer: IBinaryWriter,
- options: BinaryWriteOptions,
- ): IBinaryWriter {
- /* int64 seconds = 1; */
- if (message.seconds !== '0')
- writer.tag(1, WireType.Varint).int64(message.seconds);
- /* int32 nanos = 2; */
- if (message.nanos !== 0)
- writer.tag(2, WireType.Varint).int32(message.nanos);
- let u = options.writeUnknownFields;
- if (u !== false)
- (u == true ? UnknownFieldHandler.onWrite : u)(
- this.typeName,
- message,
- writer,
- );
- return writer;
- }
}
/**
* @generated MessageType for protobuf message google.protobuf.Timestamp
diff --git a/packages/client/src/gen/video/sfu/event/events.ts b/packages/client/src/gen/video/sfu/event/events.ts
index 7e29db26af..48d5203110 100644
--- a/packages/client/src/gen/video/sfu/event/events.ts
+++ b/packages/client/src/gen/video/sfu/event/events.ts
@@ -1,20 +1,8 @@
/* eslint-disable */
-// @generated by protobuf-ts 2.9.4 with parameter long_type_string,client_generic,server_none,eslint_disable
+// @generated by protobuf-ts 2.9.4 with parameter long_type_string,client_generic,server_none,eslint_disable,optimize_code_size
// @generated from protobuf file "video/sfu/event/events.proto" (package "stream.video.sfu.event", syntax proto3)
// tslint:disable
-import type {
- BinaryReadOptions,
- BinaryWriteOptions,
- IBinaryReader,
- IBinaryWriter,
- PartialMessage,
-} from '@protobuf-ts/runtime';
-import {
- MessageType,
- reflectionMergePartial,
- UnknownFieldHandler,
- WireType,
-} from '@protobuf-ts/runtime';
+import { MessageType } from '@protobuf-ts/runtime';
import {
CallEndedReason,
CallGrants,
@@ -1030,437 +1018,6 @@ class SfuEvent$Type extends MessageType {
},
]);
}
- create(value?: PartialMessage): SfuEvent {
- const message = globalThis.Object.create(this.messagePrototype!);
- message.eventPayload = { oneofKind: undefined };
- if (value !== undefined)
- reflectionMergePartial(this, message, value);
- return message;
- }
- internalBinaryRead(
- reader: IBinaryReader,
- length: number,
- options: BinaryReadOptions,
- target?: SfuEvent,
- ): SfuEvent {
- let message = target ?? this.create(),
- end = reader.pos + length;
- while (reader.pos < end) {
- let [fieldNo, wireType] = reader.tag();
- switch (fieldNo) {
- case /* stream.video.sfu.event.SubscriberOffer subscriber_offer */ 1:
- message.eventPayload = {
- oneofKind: 'subscriberOffer',
- subscriberOffer: SubscriberOffer.internalBinaryRead(
- reader,
- reader.uint32(),
- options,
- (message.eventPayload as any).subscriberOffer,
- ),
- };
- break;
- case /* stream.video.sfu.event.PublisherAnswer publisher_answer */ 2:
- message.eventPayload = {
- oneofKind: 'publisherAnswer',
- publisherAnswer: PublisherAnswer.internalBinaryRead(
- reader,
- reader.uint32(),
- options,
- (message.eventPayload as any).publisherAnswer,
- ),
- };
- break;
- case /* stream.video.sfu.event.ConnectionQualityChanged connection_quality_changed */ 3:
- message.eventPayload = {
- oneofKind: 'connectionQualityChanged',
- connectionQualityChanged:
- ConnectionQualityChanged.internalBinaryRead(
- reader,
- reader.uint32(),
- options,
- (message.eventPayload as any).connectionQualityChanged,
- ),
- };
- break;
- case /* stream.video.sfu.event.AudioLevelChanged audio_level_changed */ 4:
- message.eventPayload = {
- oneofKind: 'audioLevelChanged',
- audioLevelChanged: AudioLevelChanged.internalBinaryRead(
- reader,
- reader.uint32(),
- options,
- (message.eventPayload as any).audioLevelChanged,
- ),
- };
- break;
- case /* stream.video.sfu.models.ICETrickle ice_trickle */ 5:
- message.eventPayload = {
- oneofKind: 'iceTrickle',
- iceTrickle: ICETrickle$.internalBinaryRead(
- reader,
- reader.uint32(),
- options,
- (message.eventPayload as any).iceTrickle,
- ),
- };
- break;
- case /* stream.video.sfu.event.ChangePublishQuality change_publish_quality */ 6:
- message.eventPayload = {
- oneofKind: 'changePublishQuality',
- changePublishQuality: ChangePublishQuality.internalBinaryRead(
- reader,
- reader.uint32(),
- options,
- (message.eventPayload as any).changePublishQuality,
- ),
- };
- break;
- case /* stream.video.sfu.event.ParticipantJoined participant_joined */ 10:
- message.eventPayload = {
- oneofKind: 'participantJoined',
- participantJoined: ParticipantJoined.internalBinaryRead(
- reader,
- reader.uint32(),
- options,
- (message.eventPayload as any).participantJoined,
- ),
- };
- break;
- case /* stream.video.sfu.event.ParticipantLeft participant_left */ 11:
- message.eventPayload = {
- oneofKind: 'participantLeft',
- participantLeft: ParticipantLeft.internalBinaryRead(
- reader,
- reader.uint32(),
- options,
- (message.eventPayload as any).participantLeft,
- ),
- };
- break;
- case /* stream.video.sfu.event.DominantSpeakerChanged dominant_speaker_changed */ 12:
- message.eventPayload = {
- oneofKind: 'dominantSpeakerChanged',
- dominantSpeakerChanged: DominantSpeakerChanged.internalBinaryRead(
- reader,
- reader.uint32(),
- options,
- (message.eventPayload as any).dominantSpeakerChanged,
- ),
- };
- break;
- case /* stream.video.sfu.event.JoinResponse join_response */ 13:
- message.eventPayload = {
- oneofKind: 'joinResponse',
- joinResponse: JoinResponse.internalBinaryRead(
- reader,
- reader.uint32(),
- options,
- (message.eventPayload as any).joinResponse,
- ),
- };
- break;
- case /* stream.video.sfu.event.HealthCheckResponse health_check_response */ 14:
- message.eventPayload = {
- oneofKind: 'healthCheckResponse',
- healthCheckResponse: HealthCheckResponse.internalBinaryRead(
- reader,
- reader.uint32(),
- options,
- (message.eventPayload as any).healthCheckResponse,
- ),
- };
- break;
- case /* stream.video.sfu.event.TrackPublished track_published */ 16:
- message.eventPayload = {
- oneofKind: 'trackPublished',
- trackPublished: TrackPublished.internalBinaryRead(
- reader,
- reader.uint32(),
- options,
- (message.eventPayload as any).trackPublished,
- ),
- };
- break;
- case /* stream.video.sfu.event.TrackUnpublished track_unpublished */ 17:
- message.eventPayload = {
- oneofKind: 'trackUnpublished',
- trackUnpublished: TrackUnpublished.internalBinaryRead(
- reader,
- reader.uint32(),
- options,
- (message.eventPayload as any).trackUnpublished,
- ),
- };
- break;
- case /* stream.video.sfu.event.Error error */ 18:
- message.eventPayload = {
- oneofKind: 'error',
- error: Error.internalBinaryRead(
- reader,
- reader.uint32(),
- options,
- (message.eventPayload as any).error,
- ),
- };
- break;
- case /* stream.video.sfu.event.CallGrantsUpdated call_grants_updated */ 19:
- message.eventPayload = {
- oneofKind: 'callGrantsUpdated',
- callGrantsUpdated: CallGrantsUpdated.internalBinaryRead(
- reader,
- reader.uint32(),
- options,
- (message.eventPayload as any).callGrantsUpdated,
- ),
- };
- break;
- case /* stream.video.sfu.event.GoAway go_away */ 20:
- message.eventPayload = {
- oneofKind: 'goAway',
- goAway: GoAway.internalBinaryRead(
- reader,
- reader.uint32(),
- options,
- (message.eventPayload as any).goAway,
- ),
- };
- break;
- case /* stream.video.sfu.event.ICERestart ice_restart */ 21:
- message.eventPayload = {
- oneofKind: 'iceRestart',
- iceRestart: ICERestart.internalBinaryRead(
- reader,
- reader.uint32(),
- options,
- (message.eventPayload as any).iceRestart,
- ),
- };
- break;
- case /* stream.video.sfu.event.PinsChanged pins_updated */ 22:
- message.eventPayload = {
- oneofKind: 'pinsUpdated',
- pinsUpdated: PinsChanged.internalBinaryRead(
- reader,
- reader.uint32(),
- options,
- (message.eventPayload as any).pinsUpdated,
- ),
- };
- break;
- case /* stream.video.sfu.event.CallEnded call_ended */ 23:
- message.eventPayload = {
- oneofKind: 'callEnded',
- callEnded: CallEnded.internalBinaryRead(
- reader,
- reader.uint32(),
- options,
- (message.eventPayload as any).callEnded,
- ),
- };
- break;
- case /* stream.video.sfu.event.ParticipantUpdated participant_updated */ 24:
- message.eventPayload = {
- oneofKind: 'participantUpdated',
- participantUpdated: ParticipantUpdated.internalBinaryRead(
- reader,
- reader.uint32(),
- options,
- (message.eventPayload as any).participantUpdated,
- ),
- };
- break;
- case /* stream.video.sfu.event.ParticipantMigrationComplete participant_migration_complete */ 25:
- message.eventPayload = {
- oneofKind: 'participantMigrationComplete',
- participantMigrationComplete:
- ParticipantMigrationComplete.internalBinaryRead(
- reader,
- reader.uint32(),
- options,
- (message.eventPayload as any).participantMigrationComplete,
- ),
- };
- break;
- default:
- let u = options.readUnknownField;
- if (u === 'throw')
- throw new globalThis.Error(
- `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`,
- );
- let d = reader.skip(wireType);
- if (u !== false)
- (u === true ? UnknownFieldHandler.onRead : u)(
- this.typeName,
- message,
- fieldNo,
- wireType,
- d,
- );
- }
- }
- return message;
- }
- internalBinaryWrite(
- message: SfuEvent,
- writer: IBinaryWriter,
- options: BinaryWriteOptions,
- ): IBinaryWriter {
- /* stream.video.sfu.event.SubscriberOffer subscriber_offer = 1; */
- if (message.eventPayload.oneofKind === 'subscriberOffer')
- SubscriberOffer.internalBinaryWrite(
- message.eventPayload.subscriberOffer,
- writer.tag(1, WireType.LengthDelimited).fork(),
- options,
- ).join();
- /* stream.video.sfu.event.PublisherAnswer publisher_answer = 2; */
- if (message.eventPayload.oneofKind === 'publisherAnswer')
- PublisherAnswer.internalBinaryWrite(
- message.eventPayload.publisherAnswer,
- writer.tag(2, WireType.LengthDelimited).fork(),
- options,
- ).join();
- /* stream.video.sfu.event.ConnectionQualityChanged connection_quality_changed = 3; */
- if (message.eventPayload.oneofKind === 'connectionQualityChanged')
- ConnectionQualityChanged.internalBinaryWrite(
- message.eventPayload.connectionQualityChanged,
- writer.tag(3, WireType.LengthDelimited).fork(),
- options,
- ).join();
- /* stream.video.sfu.event.AudioLevelChanged audio_level_changed = 4; */
- if (message.eventPayload.oneofKind === 'audioLevelChanged')
- AudioLevelChanged.internalBinaryWrite(
- message.eventPayload.audioLevelChanged,
- writer.tag(4, WireType.LengthDelimited).fork(),
- options,
- ).join();
- /* stream.video.sfu.models.ICETrickle ice_trickle = 5; */
- if (message.eventPayload.oneofKind === 'iceTrickle')
- ICETrickle$.internalBinaryWrite(
- message.eventPayload.iceTrickle,
- writer.tag(5, WireType.LengthDelimited).fork(),
- options,
- ).join();
- /* stream.video.sfu.event.ChangePublishQuality change_publish_quality = 6; */
- if (message.eventPayload.oneofKind === 'changePublishQuality')
- ChangePublishQuality.internalBinaryWrite(
- message.eventPayload.changePublishQuality,
- writer.tag(6, WireType.LengthDelimited).fork(),
- options,
- ).join();
- /* stream.video.sfu.event.ParticipantJoined participant_joined = 10; */
- if (message.eventPayload.oneofKind === 'participantJoined')
- ParticipantJoined.internalBinaryWrite(
- message.eventPayload.participantJoined,
- writer.tag(10, WireType.LengthDelimited).fork(),
- options,
- ).join();
- /* stream.video.sfu.event.ParticipantLeft participant_left = 11; */
- if (message.eventPayload.oneofKind === 'participantLeft')
- ParticipantLeft.internalBinaryWrite(
- message.eventPayload.participantLeft,
- writer.tag(11, WireType.LengthDelimited).fork(),
- options,
- ).join();
- /* stream.video.sfu.event.DominantSpeakerChanged dominant_speaker_changed = 12; */
- if (message.eventPayload.oneofKind === 'dominantSpeakerChanged')
- DominantSpeakerChanged.internalBinaryWrite(
- message.eventPayload.dominantSpeakerChanged,
- writer.tag(12, WireType.LengthDelimited).fork(),
- options,
- ).join();
- /* stream.video.sfu.event.JoinResponse join_response = 13; */
- if (message.eventPayload.oneofKind === 'joinResponse')
- JoinResponse.internalBinaryWrite(
- message.eventPayload.joinResponse,
- writer.tag(13, WireType.LengthDelimited).fork(),
- options,
- ).join();
- /* stream.video.sfu.event.HealthCheckResponse health_check_response = 14; */
- if (message.eventPayload.oneofKind === 'healthCheckResponse')
- HealthCheckResponse.internalBinaryWrite(
- message.eventPayload.healthCheckResponse,
- writer.tag(14, WireType.LengthDelimited).fork(),
- options,
- ).join();
- /* stream.video.sfu.event.TrackPublished track_published = 16; */
- if (message.eventPayload.oneofKind === 'trackPublished')
- TrackPublished.internalBinaryWrite(
- message.eventPayload.trackPublished,
- writer.tag(16, WireType.LengthDelimited).fork(),
- options,
- ).join();
- /* stream.video.sfu.event.TrackUnpublished track_unpublished = 17; */
- if (message.eventPayload.oneofKind === 'trackUnpublished')
- TrackUnpublished.internalBinaryWrite(
- message.eventPayload.trackUnpublished,
- writer.tag(17, WireType.LengthDelimited).fork(),
- options,
- ).join();
- /* stream.video.sfu.event.Error error = 18; */
- if (message.eventPayload.oneofKind === 'error')
- Error.internalBinaryWrite(
- message.eventPayload.error,
- writer.tag(18, WireType.LengthDelimited).fork(),
- options,
- ).join();
- /* stream.video.sfu.event.CallGrantsUpdated call_grants_updated = 19; */
- if (message.eventPayload.oneofKind === 'callGrantsUpdated')
- CallGrantsUpdated.internalBinaryWrite(
- message.eventPayload.callGrantsUpdated,
- writer.tag(19, WireType.LengthDelimited).fork(),
- options,
- ).join();
- /* stream.video.sfu.event.GoAway go_away = 20; */
- if (message.eventPayload.oneofKind === 'goAway')
- GoAway.internalBinaryWrite(
- message.eventPayload.goAway,
- writer.tag(20, WireType.LengthDelimited).fork(),
- options,
- ).join();
- /* stream.video.sfu.event.ICERestart ice_restart = 21; */
- if (message.eventPayload.oneofKind === 'iceRestart')
- ICERestart.internalBinaryWrite(
- message.eventPayload.iceRestart,
- writer.tag(21, WireType.LengthDelimited).fork(),
- options,
- ).join();
- /* stream.video.sfu.event.PinsChanged pins_updated = 22; */
- if (message.eventPayload.oneofKind === 'pinsUpdated')
- PinsChanged.internalBinaryWrite(
- message.eventPayload.pinsUpdated,
- writer.tag(22, WireType.LengthDelimited).fork(),
- options,
- ).join();
- /* stream.video.sfu.event.CallEnded call_ended = 23; */
- if (message.eventPayload.oneofKind === 'callEnded')
- CallEnded.internalBinaryWrite(
- message.eventPayload.callEnded,
- writer.tag(23, WireType.LengthDelimited).fork(),
- options,
- ).join();
- /* stream.video.sfu.event.ParticipantUpdated participant_updated = 24; */
- if (message.eventPayload.oneofKind === 'participantUpdated')
- ParticipantUpdated.internalBinaryWrite(
- message.eventPayload.participantUpdated,
- writer.tag(24, WireType.LengthDelimited).fork(),
- options,
- ).join();
- /* stream.video.sfu.event.ParticipantMigrationComplete participant_migration_complete = 25; */
- if (message.eventPayload.oneofKind === 'participantMigrationComplete')
- ParticipantMigrationComplete.internalBinaryWrite(
- message.eventPayload.participantMigrationComplete,
- writer.tag(25, WireType.LengthDelimited).fork(),
- options,
- ).join();
- let u = options.writeUnknownFields;
- if (u !== false)
- (u == true ? UnknownFieldHandler.onWrite : u)(
- this.typeName,
- message,
- writer,
- );
- return writer;
- }
}
/**
* @generated MessageType for protobuf message stream.video.sfu.event.SfuEvent
@@ -1471,40 +1028,6 @@ class ParticipantMigrationComplete$Type extends MessageType,
- ): ParticipantMigrationComplete {
- const message = globalThis.Object.create(this.messagePrototype!);
- if (value !== undefined)
- reflectionMergePartial(
- this,
- message,
- value,
- );
- return message;
- }
- internalBinaryRead(
- reader: IBinaryReader,
- length: number,
- options: BinaryReadOptions,
- target?: ParticipantMigrationComplete,
- ): ParticipantMigrationComplete {
- return target ?? this.create();
- }
- internalBinaryWrite(
- message: ParticipantMigrationComplete,
- writer: IBinaryWriter,
- options: BinaryWriteOptions,
- ): IBinaryWriter {
- let u = options.writeUnknownFields;
- if (u !== false)
- (u == true ? UnknownFieldHandler.onWrite : u)(
- this.typeName,
- message,
- writer,
- );
- return writer;
- }
}
/**
* @generated MessageType for protobuf message stream.video.sfu.event.ParticipantMigrationComplete
@@ -1524,69 +1047,6 @@ class PinsChanged$Type extends MessageType {
},
]);
}
- create(value?: PartialMessage): PinsChanged {
- const message = globalThis.Object.create(this.messagePrototype!);
- message.pins = [];
- if (value !== undefined)
- reflectionMergePartial(this, message, value);
- return message;
- }
- internalBinaryRead(
- reader: IBinaryReader,
- length: number,
- options: BinaryReadOptions,
- target?: PinsChanged,
- ): PinsChanged {
- let message = target ?? this.create(),
- end = reader.pos + length;
- while (reader.pos < end) {
- let [fieldNo, wireType] = reader.tag();
- switch (fieldNo) {
- case /* repeated stream.video.sfu.models.Pin pins */ 1:
- message.pins.push(
- Pin.internalBinaryRead(reader, reader.uint32(), options),
- );
- break;
- default:
- let u = options.readUnknownField;
- if (u === 'throw')
- throw new globalThis.Error(
- `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`,
- );
- let d = reader.skip(wireType);
- if (u !== false)
- (u === true ? UnknownFieldHandler.onRead : u)(
- this.typeName,
- message,
- fieldNo,
- wireType,
- d,
- );
- }
- }
- return message;
- }
- internalBinaryWrite(
- message: PinsChanged,
- writer: IBinaryWriter,
- options: BinaryWriteOptions,
- ): IBinaryWriter {
- /* repeated stream.video.sfu.models.Pin pins = 1; */
- for (let i = 0; i < message.pins.length; i++)
- Pin.internalBinaryWrite(
- message.pins[i],
- writer.tag(1, WireType.LengthDelimited).fork(),
- options,
- ).join();
- let u = options.writeUnknownFields;
- if (u !== false)
- (u == true ? UnknownFieldHandler.onWrite : u)(
- this.typeName,
- message,
- writer,
- );
- return writer;
- }
}
/**
* @generated MessageType for protobuf message stream.video.sfu.event.PinsChanged
@@ -1609,78 +1069,6 @@ class Error$Type extends MessageType {
},
]);
}
- create(value?: PartialMessage): Error {
- const message = globalThis.Object.create(this.messagePrototype!);
- message.reconnectStrategy = 0;
- if (value !== undefined)
- reflectionMergePartial(this, message, value);
- return message;
- }
- internalBinaryRead(
- reader: IBinaryReader,
- length: number,
- options: BinaryReadOptions,
- target?: Error,
- ): Error {
- let message = target ?? this.create(),
- end = reader.pos + length;
- while (reader.pos < end) {
- let [fieldNo, wireType] = reader.tag();
- switch (fieldNo) {
- case /* stream.video.sfu.models.Error error */ 4:
- message.error = Error$.internalBinaryRead(
- reader,
- reader.uint32(),
- options,
- message.error,
- );
- break;
- case /* stream.video.sfu.models.WebsocketReconnectStrategy reconnect_strategy */ 5:
- message.reconnectStrategy = reader.int32();
- break;
- default:
- let u = options.readUnknownField;
- if (u === 'throw')
- throw new globalThis.Error(
- `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`,
- );
- let d = reader.skip(wireType);
- if (u !== false)
- (u === true ? UnknownFieldHandler.onRead : u)(
- this.typeName,
- message,
- fieldNo,
- wireType,
- d,
- );
- }
- }
- return message;
- }
- internalBinaryWrite(
- message: Error,
- writer: IBinaryWriter,
- options: BinaryWriteOptions,
- ): IBinaryWriter {
- /* stream.video.sfu.models.Error error = 4; */
- if (message.error)
- Error$.internalBinaryWrite(
- message.error,
- writer.tag(4, WireType.LengthDelimited).fork(),
- options,
- ).join();
- /* stream.video.sfu.models.WebsocketReconnectStrategy reconnect_strategy = 5; */
- if (message.reconnectStrategy !== 0)
- writer.tag(5, WireType.Varint).int32(message.reconnectStrategy);
- let u = options.writeUnknownFields;
- if (u !== false)
- (u == true ? UnknownFieldHandler.onWrite : u)(
- this.typeName,
- message,
- writer,
- );
- return writer;
- }
}
/**
* @generated MessageType for protobuf message stream.video.sfu.event.Error
@@ -1704,70 +1092,6 @@ class ICETrickle$Type extends MessageType {
},
]);
}
- create(value?: PartialMessage): ICETrickle {
- const message = globalThis.Object.create(this.messagePrototype!);
- message.peerType = 0;
- message.iceCandidate = '';
- if (value !== undefined)
- reflectionMergePartial(this, message, value);
- return message;
- }
- internalBinaryRead(
- reader: IBinaryReader,
- length: number,
- options: BinaryReadOptions,
- target?: ICETrickle,
- ): ICETrickle {
- let message = target ?? this.create(),
- end = reader.pos + length;
- while (reader.pos < end) {
- let [fieldNo, wireType] = reader.tag();
- switch (fieldNo) {
- case /* stream.video.sfu.models.PeerType peer_type */ 1:
- message.peerType = reader.int32();
- break;
- case /* string ice_candidate */ 2:
- message.iceCandidate = reader.string();
- break;
- default:
- let u = options.readUnknownField;
- if (u === 'throw')
- throw new globalThis.Error(
- `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`,
- );
- let d = reader.skip(wireType);
- if (u !== false)
- (u === true ? UnknownFieldHandler.onRead : u)(
- this.typeName,
- message,
- fieldNo,
- wireType,
- d,
- );
- }
- }
- return message;
- }
- internalBinaryWrite(
- message: ICETrickle,
- writer: IBinaryWriter,
- options: BinaryWriteOptions,
- ): IBinaryWriter {
- /* stream.video.sfu.models.PeerType peer_type = 1; */
- if (message.peerType !== 0)
- writer.tag(1, WireType.Varint).int32(message.peerType);
- /* string ice_candidate = 2; */
- if (message.iceCandidate !== '')
- writer.tag(2, WireType.LengthDelimited).string(message.iceCandidate);
- let u = options.writeUnknownFields;
- if (u !== false)
- (u == true ? UnknownFieldHandler.onWrite : u)(
- this.typeName,
- message,
- writer,
- );
- return writer;
- }
}
/**
* @generated MessageType for protobuf message stream.video.sfu.event.ICETrickle
@@ -1785,63 +1109,6 @@ class ICERestart$Type extends MessageType {
},
]);
}
- create(value?: PartialMessage): ICERestart {
- const message = globalThis.Object.create(this.messagePrototype!);
- message.peerType = 0;
- if (value !== undefined)
- reflectionMergePartial(this, message, value);
- return message;
- }
- internalBinaryRead(
- reader: IBinaryReader,
- length: number,
- options: BinaryReadOptions,
- target?: ICERestart,
- ): ICERestart {
- let message = target ?? this.create(),
- end = reader.pos + length;
- while (reader.pos < end) {
- let [fieldNo, wireType] = reader.tag();
- switch (fieldNo) {
- case /* stream.video.sfu.models.PeerType peer_type */ 1:
- message.peerType = reader.int32();
- break;
- default:
- let u = options.readUnknownField;
- if (u === 'throw')
- throw new globalThis.Error(
- `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`,
- );
- let d = reader.skip(wireType);
- if (u !== false)
- (u === true ? UnknownFieldHandler.onRead : u)(
- this.typeName,
- message,
- fieldNo,
- wireType,
- d,
- );
- }
- }
- return message;
- }
- internalBinaryWrite(
- message: ICERestart,
- writer: IBinaryWriter,
- options: BinaryWriteOptions,
- ): IBinaryWriter {
- /* stream.video.sfu.models.PeerType peer_type = 1; */
- if (message.peerType !== 0)
- writer.tag(1, WireType.Varint).int32(message.peerType);
- let u = options.writeUnknownFields;
- if (u !== false)
- (u == true ? UnknownFieldHandler.onWrite : u)(
- this.typeName,
- message,
- writer,
- );
- return writer;
- }
}
/**
* @generated MessageType for protobuf message stream.video.sfu.event.ICERestart
@@ -1874,111 +1141,6 @@ class SfuRequest$Type extends MessageType {
},
]);
}
- create(value?: PartialMessage): SfuRequest {
- const message = globalThis.Object.create(this.messagePrototype!);
- message.requestPayload = { oneofKind: undefined };
- if (value !== undefined)
- reflectionMergePartial(this, message, value);
- return message;
- }
- internalBinaryRead(
- reader: IBinaryReader,
- length: number,
- options: BinaryReadOptions,
- target?: SfuRequest,
- ): SfuRequest {
- let message = target ?? this.create(),
- end = reader.pos + length;
- while (reader.pos < end) {
- let [fieldNo, wireType] = reader.tag();
- switch (fieldNo) {
- case /* stream.video.sfu.event.JoinRequest join_request */ 1:
- message.requestPayload = {
- oneofKind: 'joinRequest',
- joinRequest: JoinRequest.internalBinaryRead(
- reader,
- reader.uint32(),
- options,
- (message.requestPayload as any).joinRequest,
- ),
- };
- break;
- case /* stream.video.sfu.event.HealthCheckRequest health_check_request */ 2:
- message.requestPayload = {
- oneofKind: 'healthCheckRequest',
- healthCheckRequest: HealthCheckRequest.internalBinaryRead(
- reader,
- reader.uint32(),
- options,
- (message.requestPayload as any).healthCheckRequest,
- ),
- };
- break;
- case /* stream.video.sfu.event.LeaveCallRequest leave_call_request */ 3:
- message.requestPayload = {
- oneofKind: 'leaveCallRequest',
- leaveCallRequest: LeaveCallRequest.internalBinaryRead(
- reader,
- reader.uint32(),
- options,
- (message.requestPayload as any).leaveCallRequest,
- ),
- };
- break;
- default:
- let u = options.readUnknownField;
- if (u === 'throw')
- throw new globalThis.Error(
- `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`,
- );
- let d = reader.skip(wireType);
- if (u !== false)
- (u === true ? UnknownFieldHandler.onRead : u)(
- this.typeName,
- message,
- fieldNo,
- wireType,
- d,
- );
- }
- }
- return message;
- }
- internalBinaryWrite(
- message: SfuRequest,
- writer: IBinaryWriter,
- options: BinaryWriteOptions,
- ): IBinaryWriter {
- /* stream.video.sfu.event.JoinRequest join_request = 1; */
- if (message.requestPayload.oneofKind === 'joinRequest')
- JoinRequest.internalBinaryWrite(
- message.requestPayload.joinRequest,
- writer.tag(1, WireType.LengthDelimited).fork(),
- options,
- ).join();
- /* stream.video.sfu.event.HealthCheckRequest health_check_request = 2; */
- if (message.requestPayload.oneofKind === 'healthCheckRequest')
- HealthCheckRequest.internalBinaryWrite(
- message.requestPayload.healthCheckRequest,
- writer.tag(2, WireType.LengthDelimited).fork(),
- options,
- ).join();
- /* stream.video.sfu.event.LeaveCallRequest leave_call_request = 3; */
- if (message.requestPayload.oneofKind === 'leaveCallRequest')
- LeaveCallRequest.internalBinaryWrite(
- message.requestPayload.leaveCallRequest,
- writer.tag(3, WireType.LengthDelimited).fork(),
- options,
- ).join();
- let u = options.writeUnknownFields;
- if (u !== false)
- (u == true ? UnknownFieldHandler.onWrite : u)(
- this.typeName,
- message,
- writer,
- );
- return writer;
- }
}
/**
* @generated MessageType for protobuf message stream.video.sfu.event.SfuRequest
@@ -1992,70 +1154,6 @@ class LeaveCallRequest$Type extends MessageType {
{ no: 2, name: 'reason', kind: 'scalar', T: 9 /*ScalarType.STRING*/ },
]);
}
- create(value?: PartialMessage): LeaveCallRequest {
- const message = globalThis.Object.create(this.messagePrototype!);
- message.sessionId = '';
- message.reason = '';
- if (value !== undefined)
- reflectionMergePartial(this, message, value);
- return message;
- }
- internalBinaryRead(
- reader: IBinaryReader,
- length: number,
- options: BinaryReadOptions,
- target?: LeaveCallRequest,
- ): LeaveCallRequest {
- let message = target ?? this.create(),
- end = reader.pos + length;
- while (reader.pos < end) {
- let [fieldNo, wireType] = reader.tag();
- switch (fieldNo) {
- case /* string session_id */ 1:
- message.sessionId = reader.string();
- break;
- case /* string reason */ 2:
- message.reason = reader.string();
- break;
- default:
- let u = options.readUnknownField;
- if (u === 'throw')
- throw new globalThis.Error(
- `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`,
- );
- let d = reader.skip(wireType);
- if (u !== false)
- (u === true ? UnknownFieldHandler.onRead : u)(
- this.typeName,
- message,
- fieldNo,
- wireType,
- d,
- );
- }
- }
- return message;
- }
- internalBinaryWrite(
- message: LeaveCallRequest,
- writer: IBinaryWriter,
- options: BinaryWriteOptions,
- ): IBinaryWriter {
- /* string session_id = 1; */
- if (message.sessionId !== '')
- writer.tag(1, WireType.LengthDelimited).string(message.sessionId);
- /* string reason = 2; */
- if (message.reason !== '')
- writer.tag(2, WireType.LengthDelimited).string(message.reason);
- let u = options.writeUnknownFields;
- if (u !== false)
- (u == true ? UnknownFieldHandler.onWrite : u)(
- this.typeName,
- message,
- writer,
- );
- return writer;
- }
}
/**
* @generated MessageType for protobuf message stream.video.sfu.event.LeaveCallRequest
@@ -2066,34 +1164,6 @@ class HealthCheckRequest$Type extends MessageType {
constructor() {
super('stream.video.sfu.event.HealthCheckRequest', []);
}
- create(value?: PartialMessage): HealthCheckRequest {
- const message = globalThis.Object.create(this.messagePrototype!);
- if (value !== undefined)
- reflectionMergePartial(this, message, value);
- return message;
- }
- internalBinaryRead(
- reader: IBinaryReader,
- length: number,
- options: BinaryReadOptions,
- target?: HealthCheckRequest,
- ): HealthCheckRequest {
- return target ?? this.create();
- }
- internalBinaryWrite(
- message: HealthCheckRequest,
- writer: IBinaryWriter,
- options: BinaryWriteOptions,
- ): IBinaryWriter {
- let u = options.writeUnknownFields;
- if (u !== false)
- (u == true ? UnknownFieldHandler.onWrite : u)(
- this.typeName,
- message,
- writer,
- );
- return writer;
- }
}
/**
* @generated MessageType for protobuf message stream.video.sfu.event.HealthCheckRequest
@@ -2111,71 +1181,6 @@ class HealthCheckResponse$Type extends MessageType {
},
]);
}
- create(value?: PartialMessage): HealthCheckResponse {
- const message = globalThis.Object.create(this.messagePrototype!);
- if (value !== undefined)
- reflectionMergePartial(this, message, value);
- return message;
- }
- internalBinaryRead(
- reader: IBinaryReader,
- length: number,
- options: BinaryReadOptions,
- target?: HealthCheckResponse,
- ): HealthCheckResponse {
- let message = target ?? this.create(),
- end = reader.pos + length;
- while (reader.pos < end) {
- let [fieldNo, wireType] = reader.tag();
- switch (fieldNo) {
- case /* stream.video.sfu.models.ParticipantCount participant_count */ 1:
- message.participantCount = ParticipantCount.internalBinaryRead(
- reader,
- reader.uint32(),
- options,
- message.participantCount,
- );
- break;
- default:
- let u = options.readUnknownField;
- if (u === 'throw')
- throw new globalThis.Error(
- `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`,
- );
- let d = reader.skip(wireType);
- if (u !== false)
- (u === true ? UnknownFieldHandler.onRead : u)(
- this.typeName,
- message,
- fieldNo,
- wireType,
- d,
- );
- }
- }
- return message;
- }
- internalBinaryWrite(
- message: HealthCheckResponse,
- writer: IBinaryWriter,
- options: BinaryWriteOptions,
- ): IBinaryWriter {
- /* stream.video.sfu.models.ParticipantCount participant_count = 1; */
- if (message.participantCount)
- ParticipantCount.internalBinaryWrite(
- message.participantCount,
- writer.tag(1, WireType.LengthDelimited).fork(),
- options,
- ).join();
- let u = options.writeUnknownFields;
- if (u !== false)
- (u == true ? UnknownFieldHandler.onWrite : u)(
- this.typeName,
- message,
- writer,
- );
- return writer;
- }
}
/**
* @generated MessageType for protobuf message stream.video.sfu.event.HealthCheckResponse
@@ -2200,91 +1205,6 @@ class TrackPublished$Type extends MessageType {
{ no: 4, name: 'participant', kind: 'message', T: () => Participant },
]);
}
- create(value?: PartialMessage): TrackPublished {
- const message = globalThis.Object.create(this.messagePrototype!);
- message.userId = '';
- message.sessionId = '';
- message.type = 0;
- if (value !== undefined)
- reflectionMergePartial(this, message, value);
- return message;
- }
- internalBinaryRead(
- reader: IBinaryReader,
- length: number,
- options: BinaryReadOptions,
- target?: TrackPublished,
- ): TrackPublished {
- let message = target ?? this.create(),
- end = reader.pos + length;
- while (reader.pos < end) {
- let [fieldNo, wireType] = reader.tag();
- switch (fieldNo) {
- case /* string user_id */ 1:
- message.userId = reader.string();
- break;
- case /* string session_id */ 2:
- message.sessionId = reader.string();
- break;
- case /* stream.video.sfu.models.TrackType type */ 3:
- message.type = reader.int32();
- break;
- case /* stream.video.sfu.models.Participant participant */ 4:
- message.participant = Participant.internalBinaryRead(
- reader,
- reader.uint32(),
- options,
- message.participant,
- );
- break;
- default:
- let u = options.readUnknownField;
- if (u === 'throw')
- throw new globalThis.Error(
- `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`,
- );
- let d = reader.skip(wireType);
- if (u !== false)
- (u === true ? UnknownFieldHandler.onRead : u)(
- this.typeName,
- message,
- fieldNo,
- wireType,
- d,
- );
- }
- }
- return message;
- }
- internalBinaryWrite(
- message: TrackPublished,
- writer: IBinaryWriter,
- options: BinaryWriteOptions,
- ): IBinaryWriter {
- /* string user_id = 1; */
- if (message.userId !== '')
- writer.tag(1, WireType.LengthDelimited).string(message.userId);
- /* string session_id = 2; */
- if (message.sessionId !== '')
- writer.tag(2, WireType.LengthDelimited).string(message.sessionId);
- /* stream.video.sfu.models.TrackType type = 3; */
- if (message.type !== 0) writer.tag(3, WireType.Varint).int32(message.type);
- /* stream.video.sfu.models.Participant participant = 4; */
- if (message.participant)
- Participant.internalBinaryWrite(
- message.participant,
- writer.tag(4, WireType.LengthDelimited).fork(),
- options,
- ).join();
- let u = options.writeUnknownFields;
- if (u !== false)
- (u == true ? UnknownFieldHandler.onWrite : u)(
- this.typeName,
- message,
- writer,
- );
- return writer;
- }
}
/**
* @generated MessageType for protobuf message stream.video.sfu.event.TrackPublished
@@ -2319,98 +1239,6 @@ class TrackUnpublished$Type extends MessageType {
{ no: 5, name: 'participant', kind: 'message', T: () => Participant },
]);
}
- create(value?: PartialMessage): TrackUnpublished {
- const message = globalThis.Object.create(this.messagePrototype!);
- message.userId = '';
- message.sessionId = '';
- message.type = 0;
- message.cause = 0;
- if (value !== undefined)
- reflectionMergePartial(this, message, value);
- return message;
- }
- internalBinaryRead(
- reader: IBinaryReader,
- length: number,
- options: BinaryReadOptions,
- target?: TrackUnpublished,
- ): TrackUnpublished {
- let message = target ?? this.create(),
- end = reader.pos + length;
- while (reader.pos < end) {
- let [fieldNo, wireType] = reader.tag();
- switch (fieldNo) {
- case /* string user_id */ 1:
- message.userId = reader.string();
- break;
- case /* string session_id */ 2:
- message.sessionId = reader.string();
- break;
- case /* stream.video.sfu.models.TrackType type */ 3:
- message.type = reader.int32();
- break;
- case /* stream.video.sfu.models.TrackUnpublishReason cause */ 4:
- message.cause = reader.int32();
- break;
- case /* stream.video.sfu.models.Participant participant */ 5:
- message.participant = Participant.internalBinaryRead(
- reader,
- reader.uint32(),
- options,
- message.participant,
- );
- break;
- default:
- let u = options.readUnknownField;
- if (u === 'throw')
- throw new globalThis.Error(
- `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`,
- );
- let d = reader.skip(wireType);
- if (u !== false)
- (u === true ? UnknownFieldHandler.onRead : u)(
- this.typeName,
- message,
- fieldNo,
- wireType,
- d,
- );
- }
- }
- return message;
- }
- internalBinaryWrite(
- message: TrackUnpublished,
- writer: IBinaryWriter,
- options: BinaryWriteOptions,
- ): IBinaryWriter {
- /* string user_id = 1; */
- if (message.userId !== '')
- writer.tag(1, WireType.LengthDelimited).string(message.userId);
- /* string session_id = 2; */
- if (message.sessionId !== '')
- writer.tag(2, WireType.LengthDelimited).string(message.sessionId);
- /* stream.video.sfu.models.TrackType type = 3; */
- if (message.type !== 0) writer.tag(3, WireType.Varint).int32(message.type);
- /* stream.video.sfu.models.TrackUnpublishReason cause = 4; */
- if (message.cause !== 0)
- writer.tag(4, WireType.Varint).int32(message.cause);
- /* stream.video.sfu.models.Participant participant = 5; */
- if (message.participant)
- Participant.internalBinaryWrite(
- message.participant,
- writer.tag(5, WireType.LengthDelimited).fork(),
- options,
- ).join();
- let u = options.writeUnknownFields;
- if (u !== false)
- (u == true ? UnknownFieldHandler.onWrite : u)(
- this.typeName,
- message,
- writer,
- );
- return writer;
- }
}
/**
* @generated MessageType for protobuf message stream.video.sfu.event.TrackUnpublished
@@ -2449,129 +1277,6 @@ class JoinRequest$Type extends MessageType {
},
]);
}
- create(value?: PartialMessage): JoinRequest {
- const message = globalThis.Object.create(this.messagePrototype!);
- message.token = '';
- message.sessionId = '';
- message.subscriberSdp = '';
- message.fastReconnect = false;
- if (value !== undefined)
- reflectionMergePartial(this, message, value);
- return message;
- }
- internalBinaryRead(
- reader: IBinaryReader,
- length: number,
- options: BinaryReadOptions,
- target?: JoinRequest,
- ): JoinRequest {
- let message = target ?? this.create(),
- end = reader.pos + length;
- while (reader.pos < end) {
- let [fieldNo, wireType] = reader.tag();
- switch (fieldNo) {
- case /* string token */ 1:
- message.token = reader.string();
- break;
- case /* string session_id */ 2:
- message.sessionId = reader.string();
- break;
- case /* string subscriber_sdp */ 3:
- message.subscriberSdp = reader.string();
- break;
- case /* stream.video.sfu.models.ClientDetails client_details */ 4:
- message.clientDetails = ClientDetails.internalBinaryRead(
- reader,
- reader.uint32(),
- options,
- message.clientDetails,
- );
- break;
- case /* stream.video.sfu.event.Migration migration = 5 [deprecated = true];*/ 5:
- message.migration = Migration.internalBinaryRead(
- reader,
- reader.uint32(),
- options,
- message.migration,
- );
- break;
- case /* bool fast_reconnect = 6 [deprecated = true];*/ 6:
- message.fastReconnect = reader.bool();
- break;
- case /* stream.video.sfu.event.ReconnectDetails reconnect_details */ 7:
- message.reconnectDetails = ReconnectDetails.internalBinaryRead(
- reader,
- reader.uint32(),
- options,
- message.reconnectDetails,
- );
- break;
- default:
- let u = options.readUnknownField;
- if (u === 'throw')
- throw new globalThis.Error(
- `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`,
- );
- let d = reader.skip(wireType);
- if (u !== false)
- (u === true ? UnknownFieldHandler.onRead : u)(
- this.typeName,
- message,
- fieldNo,
- wireType,
- d,
- );
- }
- }
- return message;
- }
- internalBinaryWrite(
- message: JoinRequest,
- writer: IBinaryWriter,
- options: BinaryWriteOptions,
- ): IBinaryWriter {
- /* string token = 1; */
- if (message.token !== '')
- writer.tag(1, WireType.LengthDelimited).string(message.token);
- /* string session_id = 2; */
- if (message.sessionId !== '')
- writer.tag(2, WireType.LengthDelimited).string(message.sessionId);
- /* string subscriber_sdp = 3; */
- if (message.subscriberSdp !== '')
- writer.tag(3, WireType.LengthDelimited).string(message.subscriberSdp);
- /* stream.video.sfu.models.ClientDetails client_details = 4; */
- if (message.clientDetails)
- ClientDetails.internalBinaryWrite(
- message.clientDetails,
- writer.tag(4, WireType.LengthDelimited).fork(),
- options,
- ).join();
- /* stream.video.sfu.event.Migration migration = 5 [deprecated = true]; */
- if (message.migration)
- Migration.internalBinaryWrite(
- message.migration,
- writer.tag(5, WireType.LengthDelimited).fork(),
- options,
- ).join();
- /* bool fast_reconnect = 6 [deprecated = true]; */
- if (message.fastReconnect !== false)
- writer.tag(6, WireType.Varint).bool(message.fastReconnect);
- /* stream.video.sfu.event.ReconnectDetails reconnect_details = 7; */
- if (message.reconnectDetails)
- ReconnectDetails.internalBinaryWrite(
- message.reconnectDetails,
- writer.tag(7, WireType.LengthDelimited).fork(),
- options,
- ).join();
- let u = options.writeUnknownFields;
- if (u !== false)
- (u == true ? UnknownFieldHandler.onWrite : u)(
- this.typeName,
- message,
- writer,
- );
- return writer;
- }
}
/**
* @generated MessageType for protobuf message stream.video.sfu.event.JoinRequest
@@ -2625,114 +1330,6 @@ class ReconnectDetails$Type extends MessageType {
},
]);
}
- create(value?: PartialMessage): ReconnectDetails {
- const message = globalThis.Object.create(this.messagePrototype!);
- message.strategy = 0;
- message.announcedTracks = [];
- message.subscriptions = [];
- message.reconnectAttempt = 0;
- message.fromSfuId = '';
- message.previousSessionId = '';
- if (value !== undefined)
- reflectionMergePartial(this, message, value);
- return message;
- }
- internalBinaryRead(
- reader: IBinaryReader,
- length: number,
- options: BinaryReadOptions,
- target?: ReconnectDetails,
- ): ReconnectDetails {
- let message = target ?? this.create(),
- end = reader.pos + length;
- while (reader.pos < end) {
- let [fieldNo, wireType] = reader.tag();
- switch (fieldNo) {
- case /* stream.video.sfu.models.WebsocketReconnectStrategy strategy */ 1:
- message.strategy = reader.int32();
- break;
- case /* repeated stream.video.sfu.models.TrackInfo announced_tracks */ 3:
- message.announcedTracks.push(
- TrackInfo.internalBinaryRead(reader, reader.uint32(), options),
- );
- break;
- case /* repeated stream.video.sfu.signal.TrackSubscriptionDetails subscriptions */ 4:
- message.subscriptions.push(
- TrackSubscriptionDetails.internalBinaryRead(
- reader,
- reader.uint32(),
- options,
- ),
- );
- break;
- case /* uint32 reconnect_attempt */ 5:
- message.reconnectAttempt = reader.uint32();
- break;
- case /* string from_sfu_id */ 6:
- message.fromSfuId = reader.string();
- break;
- case /* string previous_session_id */ 7:
- message.previousSessionId = reader.string();
- break;
- default:
- let u = options.readUnknownField;
- if (u === 'throw')
- throw new globalThis.Error(
- `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`,
- );
- let d = reader.skip(wireType);
- if (u !== false)
- (u === true ? UnknownFieldHandler.onRead : u)(
- this.typeName,
- message,
- fieldNo,
- wireType,
- d,
- );
- }
- }
- return message;
- }
- internalBinaryWrite(
- message: ReconnectDetails,
- writer: IBinaryWriter,
- options: BinaryWriteOptions,
- ): IBinaryWriter {
- /* stream.video.sfu.models.WebsocketReconnectStrategy strategy = 1; */
- if (message.strategy !== 0)
- writer.tag(1, WireType.Varint).int32(message.strategy);
- /* repeated stream.video.sfu.models.TrackInfo announced_tracks = 3; */
- for (let i = 0; i < message.announcedTracks.length; i++)
- TrackInfo.internalBinaryWrite(
- message.announcedTracks[i],
- writer.tag(3, WireType.LengthDelimited).fork(),
- options,
- ).join();
- /* repeated stream.video.sfu.signal.TrackSubscriptionDetails subscriptions = 4; */
- for (let i = 0; i < message.subscriptions.length; i++)
- TrackSubscriptionDetails.internalBinaryWrite(
- message.subscriptions[i],
- writer.tag(4, WireType.LengthDelimited).fork(),
- options,
- ).join();
- /* uint32 reconnect_attempt = 5; */
- if (message.reconnectAttempt !== 0)
- writer.tag(5, WireType.Varint).uint32(message.reconnectAttempt);
- /* string from_sfu_id = 6; */
- if (message.fromSfuId !== '')
- writer.tag(6, WireType.LengthDelimited).string(message.fromSfuId);
- /* string previous_session_id = 7; */
- if (message.previousSessionId !== '')
- writer.tag(7, WireType.LengthDelimited).string(message.previousSessionId);
- let u = options.writeUnknownFields;
- if (u !== false)
- (u == true ? UnknownFieldHandler.onWrite : u)(
- this.typeName,
- message,
- writer,
- );
- return writer;
- }
}
/**
* @generated MessageType for protobuf message stream.video.sfu.event.ReconnectDetails
@@ -2764,93 +1361,6 @@ class Migration$Type extends MessageType {
},
]);
}
- create(value?: PartialMessage): Migration {
- const message = globalThis.Object.create(this.messagePrototype!);
- message.fromSfuId = '';
- message.announcedTracks = [];
- message.subscriptions = [];
- if (value !== undefined)
- reflectionMergePartial(this, message, value);
- return message;
- }
- internalBinaryRead(
- reader: IBinaryReader,
- length: number,
- options: BinaryReadOptions,
- target?: Migration,
- ): Migration {
- let message = target ?? this.create(),
- end = reader.pos + length;
- while (reader.pos < end) {
- let [fieldNo, wireType] = reader.tag();
- switch (fieldNo) {
- case /* string from_sfu_id */ 1:
- message.fromSfuId = reader.string();
- break;
- case /* repeated stream.video.sfu.models.TrackInfo announced_tracks */ 2:
- message.announcedTracks.push(
- TrackInfo.internalBinaryRead(reader, reader.uint32(), options),
- );
- break;
- case /* repeated stream.video.sfu.signal.TrackSubscriptionDetails subscriptions */ 3:
- message.subscriptions.push(
- TrackSubscriptionDetails.internalBinaryRead(
- reader,
- reader.uint32(),
- options,
- ),
- );
- break;
- default:
- let u = options.readUnknownField;
- if (u === 'throw')
- throw new globalThis.Error(
- `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`,
- );
- let d = reader.skip(wireType);
- if (u !== false)
- (u === true ? UnknownFieldHandler.onRead : u)(
- this.typeName,
- message,
- fieldNo,
- wireType,
- d,
- );
- }
- }
- return message;
- }
- internalBinaryWrite(
- message: Migration,
- writer: IBinaryWriter,
- options: BinaryWriteOptions,
- ): IBinaryWriter {
- /* string from_sfu_id = 1; */
- if (message.fromSfuId !== '')
- writer.tag(1, WireType.LengthDelimited).string(message.fromSfuId);
- /* repeated stream.video.sfu.models.TrackInfo announced_tracks = 2; */
- for (let i = 0; i < message.announcedTracks.length; i++)
- TrackInfo.internalBinaryWrite(
- message.announcedTracks[i],
- writer.tag(2, WireType.LengthDelimited).fork(),
- options,
- ).join();
- /* repeated stream.video.sfu.signal.TrackSubscriptionDetails subscriptions = 3; */
- for (let i = 0; i < message.subscriptions.length; i++)
- TrackSubscriptionDetails.internalBinaryWrite(
- message.subscriptions[i],
- writer.tag(3, WireType.LengthDelimited).fork(),
- options,
- ).join();
- let u = options.writeUnknownFields;
- if (u !== false)
- (u == true ? UnknownFieldHandler.onWrite : u)(
- this.typeName,
- message,
- writer,
- );
- return writer;
- }
}
/**
* @generated MessageType for protobuf message stream.video.sfu.event.Migration
@@ -2870,87 +1380,6 @@ class JoinResponse$Type extends MessageType {
},
]);
}
- create(value?: PartialMessage): JoinResponse {
- const message = globalThis.Object.create(this.messagePrototype!);
- message.reconnected = false;
- message.fastReconnectDeadlineSeconds = 0;
- if (value !== undefined)
- reflectionMergePartial(this, message, value);
- return message;
- }
- internalBinaryRead(
- reader: IBinaryReader,
- length: number,
- options: BinaryReadOptions,
- target?: JoinResponse,
- ): JoinResponse {
- let message = target ?? this.create(),
- end = reader.pos + length;
- while (reader.pos < end) {
- let [fieldNo, wireType] = reader.tag();
- switch (fieldNo) {
- case /* stream.video.sfu.models.CallState call_state */ 1:
- message.callState = CallState.internalBinaryRead(
- reader,
- reader.uint32(),
- options,
- message.callState,
- );
- break;
- case /* bool reconnected */ 2:
- message.reconnected = reader.bool();
- break;
- case /* int32 fast_reconnect_deadline_seconds */ 3:
- message.fastReconnectDeadlineSeconds = reader.int32();
- break;
- default:
- let u = options.readUnknownField;
- if (u === 'throw')
- throw new globalThis.Error(
- `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`,
- );
- let d = reader.skip(wireType);
- if (u !== false)
- (u === true ? UnknownFieldHandler.onRead : u)(
- this.typeName,
- message,
- fieldNo,
- wireType,
- d,
- );
- }
- }
- return message;
- }
- internalBinaryWrite(
- message: JoinResponse,
- writer: IBinaryWriter,
- options: BinaryWriteOptions,
- ): IBinaryWriter {
- /* stream.video.sfu.models.CallState call_state = 1; */
- if (message.callState)
- CallState.internalBinaryWrite(
- message.callState,
- writer.tag(1, WireType.LengthDelimited).fork(),
- options,
- ).join();
- /* bool reconnected = 2; */
- if (message.reconnected !== false)
- writer.tag(2, WireType.Varint).bool(message.reconnected);
- /* int32 fast_reconnect_deadline_seconds = 3; */
- if (message.fastReconnectDeadlineSeconds !== 0)
- writer
- .tag(3, WireType.Varint)
- .int32(message.fastReconnectDeadlineSeconds);
- let u = options.writeUnknownFields;
- if (u !== false)
- (u == true ? UnknownFieldHandler.onWrite : u)(
- this.typeName,
- message,
- writer,
- );
- return writer;
- }
}
/**
* @generated MessageType for protobuf message stream.video.sfu.event.JoinResponse
@@ -2964,78 +1393,6 @@ class ParticipantJoined$Type extends MessageType {
{ no: 2, name: 'participant', kind: 'message', T: () => Participant },
]);
}
- create(value?: PartialMessage): ParticipantJoined {
- const message = globalThis.Object.create(this.messagePrototype!);
- message.callCid = '';
- if (value !== undefined)
- reflectionMergePartial(this, message, value);
- return message;
- }
- internalBinaryRead(
- reader: IBinaryReader,
- length: number,
- options: BinaryReadOptions,
- target?: ParticipantJoined,
- ): ParticipantJoined {
- let message = target ?? this.create(),
- end = reader.pos + length;
- while (reader.pos < end) {
- let [fieldNo, wireType] = reader.tag();
- switch (fieldNo) {
- case /* string call_cid */ 1:
- message.callCid = reader.string();
- break;
- case /* stream.video.sfu.models.Participant participant */ 2:
- message.participant = Participant.internalBinaryRead(
- reader,
- reader.uint32(),
- options,
- message.participant,
- );
- break;
- default:
- let u = options.readUnknownField;
- if (u === 'throw')
- throw new globalThis.Error(
- `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`,
- );
- let d = reader.skip(wireType);
- if (u !== false)
- (u === true ? UnknownFieldHandler.onRead : u)(
- this.typeName,
- message,
- fieldNo,
- wireType,
- d,
- );
- }
- }
- return message;
- }
- internalBinaryWrite(
- message: ParticipantJoined,
- writer: IBinaryWriter,
- options: BinaryWriteOptions,
- ): IBinaryWriter {
- /* string call_cid = 1; */
- if (message.callCid !== '')
- writer.tag(1, WireType.LengthDelimited).string(message.callCid);
- /* stream.video.sfu.models.Participant participant = 2; */
- if (message.participant)
- Participant.internalBinaryWrite(
- message.participant,
- writer.tag(2, WireType.LengthDelimited).fork(),
- options,
- ).join();
- let u = options.writeUnknownFields;
- if (u !== false)
- (u == true ? UnknownFieldHandler.onWrite : u)(
- this.typeName,
- message,
- writer,
- );
- return writer;
- }
}
/**
* @generated MessageType for protobuf message stream.video.sfu.event.ParticipantJoined
@@ -3049,78 +1406,6 @@ class ParticipantLeft$Type extends MessageType {
{ no: 2, name: 'participant', kind: 'message', T: () => Participant },
]);
}
- create(value?: PartialMessage): ParticipantLeft {
- const message = globalThis.Object.create(this.messagePrototype!);
- message.callCid = '';
- if (value !== undefined)
- reflectionMergePartial(this, message, value);
- return message;
- }
- internalBinaryRead(
- reader: IBinaryReader,
- length: number,
- options: BinaryReadOptions,
- target?: ParticipantLeft,
- ): ParticipantLeft {
- let message = target ?? this.create(),
- end = reader.pos + length;
- while (reader.pos < end) {
- let [fieldNo, wireType] = reader.tag();
- switch (fieldNo) {
- case /* string call_cid */ 1:
- message.callCid = reader.string();
- break;
- case /* stream.video.sfu.models.Participant participant */ 2:
- message.participant = Participant.internalBinaryRead(
- reader,
- reader.uint32(),
- options,
- message.participant,
- );
- break;
- default:
- let u = options.readUnknownField;
- if (u === 'throw')
- throw new globalThis.Error(
- `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`,
- );
- let d = reader.skip(wireType);
- if (u !== false)
- (u === true ? UnknownFieldHandler.onRead : u)(
- this.typeName,
- message,
- fieldNo,
- wireType,
- d,
- );
- }
- }
- return message;
- }
- internalBinaryWrite(
- message: ParticipantLeft,
- writer: IBinaryWriter,
- options: BinaryWriteOptions,
- ): IBinaryWriter {
- /* string call_cid = 1; */
- if (message.callCid !== '')
- writer.tag(1, WireType.LengthDelimited).string(message.callCid);
- /* stream.video.sfu.models.Participant participant = 2; */
- if (message.participant)
- Participant.internalBinaryWrite(
- message.participant,
- writer.tag(2, WireType.LengthDelimited).fork(),
- options,
- ).join();
- let u = options.writeUnknownFields;
- if (u !== false)
- (u == true ? UnknownFieldHandler.onWrite : u)(
- this.typeName,
- message,
- writer,
- );
- return writer;
- }
}
/**
* @generated MessageType for protobuf message stream.video.sfu.event.ParticipantLeft
@@ -3134,78 +1419,6 @@ class ParticipantUpdated$Type extends MessageType {
{ no: 2, name: 'participant', kind: 'message', T: () => Participant },
]);
}
- create(value?: PartialMessage): ParticipantUpdated {
- const message = globalThis.Object.create(this.messagePrototype!);
- message.callCid = '';
- if (value !== undefined)
- reflectionMergePartial(this, message, value);
- return message;
- }
- internalBinaryRead(
- reader: IBinaryReader,
- length: number,
- options: BinaryReadOptions,
- target?: ParticipantUpdated,
- ): ParticipantUpdated {
- let message = target ?? this.create(),
- end = reader.pos + length;
- while (reader.pos < end) {
- let [fieldNo, wireType] = reader.tag();
- switch (fieldNo) {
- case /* string call_cid */ 1:
- message.callCid = reader.string();
- break;
- case /* stream.video.sfu.models.Participant participant */ 2:
- message.participant = Participant.internalBinaryRead(
- reader,
- reader.uint32(),
- options,
- message.participant,
- );
- break;
- default:
- let u = options.readUnknownField;
- if (u === 'throw')
- throw new globalThis.Error(
- `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`,
- );
- let d = reader.skip(wireType);
- if (u !== false)
- (u === true ? UnknownFieldHandler.onRead : u)(
- this.typeName,
- message,
- fieldNo,
- wireType,
- d,
- );
- }
- }
- return message;
- }
- internalBinaryWrite(
- message: ParticipantUpdated,
- writer: IBinaryWriter,
- options: BinaryWriteOptions,
- ): IBinaryWriter {
- /* string call_cid = 1; */
- if (message.callCid !== '')
- writer.tag(1, WireType.LengthDelimited).string(message.callCid);
- /* stream.video.sfu.models.Participant participant = 2; */
- if (message.participant)
- Participant.internalBinaryWrite(
- message.participant,
- writer.tag(2, WireType.LengthDelimited).fork(),
- options,
- ).join();
- let u = options.writeUnknownFields;
- if (u !== false)
- (u == true ? UnknownFieldHandler.onWrite : u)(
- this.typeName,
- message,
- writer,
- );
- return writer;
- }
}
/**
* @generated MessageType for protobuf message stream.video.sfu.event.ParticipantUpdated
@@ -3219,70 +1432,6 @@ class SubscriberOffer$Type extends MessageType {
{ no: 2, name: 'sdp', kind: 'scalar', T: 9 /*ScalarType.STRING*/ },
]);
}
- create(value?: PartialMessage): SubscriberOffer {
- const message = globalThis.Object.create(this.messagePrototype!);
- message.iceRestart = false;
- message.sdp = '';
- if (value !== undefined)
- reflectionMergePartial(this, message, value);
- return message;
- }
- internalBinaryRead(
- reader: IBinaryReader,
- length: number,
- options: BinaryReadOptions,
- target?: SubscriberOffer,
- ): SubscriberOffer {
- let message = target ?? this.create(),
- end = reader.pos + length;
- while (reader.pos < end) {
- let [fieldNo, wireType] = reader.tag();
- switch (fieldNo) {
- case /* bool ice_restart */ 1:
- message.iceRestart = reader.bool();
- break;
- case /* string sdp */ 2:
- message.sdp = reader.string();
- break;
- default:
- let u = options.readUnknownField;
- if (u === 'throw')
- throw new globalThis.Error(
- `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`,
- );
- let d = reader.skip(wireType);
- if (u !== false)
- (u === true ? UnknownFieldHandler.onRead : u)(
- this.typeName,
- message,
- fieldNo,
- wireType,
- d,
- );
- }
- }
- return message;
- }
- internalBinaryWrite(
- message: SubscriberOffer,
- writer: IBinaryWriter,
- options: BinaryWriteOptions,
- ): IBinaryWriter {
- /* bool ice_restart = 1; */
- if (message.iceRestart !== false)
- writer.tag(1, WireType.Varint).bool(message.iceRestart);
- /* string sdp = 2; */
- if (message.sdp !== '')
- writer.tag(2, WireType.LengthDelimited).string(message.sdp);
- let u = options.writeUnknownFields;
- if (u !== false)
- (u == true ? UnknownFieldHandler.onWrite : u)(
- this.typeName,
- message,
- writer,
- );
- return writer;
- }
}
/**
* @generated MessageType for protobuf message stream.video.sfu.event.SubscriberOffer
@@ -3295,63 +1444,6 @@ class PublisherAnswer$Type extends MessageType {
{ no: 1, name: 'sdp', kind: 'scalar', T: 9 /*ScalarType.STRING*/ },
]);
}
- create(value?: PartialMessage): PublisherAnswer {
- const message = globalThis.Object.create(this.messagePrototype!);
- message.sdp = '';
- if (value !== undefined)
- reflectionMergePartial(this, message, value);
- return message;
- }
- internalBinaryRead(
- reader: IBinaryReader,
- length: number,
- options: BinaryReadOptions,
- target?: PublisherAnswer,
- ): PublisherAnswer {
- let message = target ?? this.create(),
- end = reader.pos + length;
- while (reader.pos < end) {
- let [fieldNo, wireType] = reader.tag();
- switch (fieldNo) {
- case /* string sdp */ 1:
- message.sdp = reader.string();
- break;
- default:
- let u = options.readUnknownField;
- if (u === 'throw')
- throw new globalThis.Error(
- `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`,
- );
- let d = reader.skip(wireType);
- if (u !== false)
- (u === true ? UnknownFieldHandler.onRead : u)(
- this.typeName,
- message,
- fieldNo,
- wireType,
- d,
- );
- }
- }
- return message;
- }
- internalBinaryWrite(
- message: PublisherAnswer,
- writer: IBinaryWriter,
- options: BinaryWriteOptions,
- ): IBinaryWriter {
- /* string sdp = 1; */
- if (message.sdp !== '')
- writer.tag(1, WireType.LengthDelimited).string(message.sdp);
- let u = options.writeUnknownFields;
- if (u !== false)
- (u == true ? UnknownFieldHandler.onWrite : u)(
- this.typeName,
- message,
- writer,
- );
- return writer;
- }
}
/**
* @generated MessageType for protobuf message stream.video.sfu.event.PublisherAnswer
@@ -3370,75 +1462,6 @@ class ConnectionQualityChanged$Type extends MessageType,
- ): ConnectionQualityChanged {
- const message = globalThis.Object.create(this.messagePrototype!);
- message.connectionQualityUpdates = [];
- if (value !== undefined)
- reflectionMergePartial(this, message, value);
- return message;
- }
- internalBinaryRead(
- reader: IBinaryReader,
- length: number,
- options: BinaryReadOptions,
- target?: ConnectionQualityChanged,
- ): ConnectionQualityChanged {
- let message = target ?? this.create(),
- end = reader.pos + length;
- while (reader.pos < end) {
- let [fieldNo, wireType] = reader.tag();
- switch (fieldNo) {
- case /* repeated stream.video.sfu.event.ConnectionQualityInfo connection_quality_updates */ 1:
- message.connectionQualityUpdates.push(
- ConnectionQualityInfo.internalBinaryRead(
- reader,
- reader.uint32(),
- options,
- ),
- );
- break;
- default:
- let u = options.readUnknownField;
- if (u === 'throw')
- throw new globalThis.Error(
- `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`,
- );
- let d = reader.skip(wireType);
- if (u !== false)
- (u === true ? UnknownFieldHandler.onRead : u)(
- this.typeName,
- message,
- fieldNo,
- wireType,
- d,
- );
- }
- }
- return message;
- }
- internalBinaryWrite(
- message: ConnectionQualityChanged,
- writer: IBinaryWriter,
- options: BinaryWriteOptions,
- ): IBinaryWriter {
- /* repeated stream.video.sfu.event.ConnectionQualityInfo connection_quality_updates = 1; */
- for (let i = 0; i < message.connectionQualityUpdates.length; i++)
- ConnectionQualityInfo.internalBinaryWrite(
- message.connectionQualityUpdates[i],
- writer.tag(1, WireType.LengthDelimited).fork(),
- options,
- ).join();
- let u = options.writeUnknownFields;
- if (u !== false)
- (u == true ? UnknownFieldHandler.onWrite : u)(
- this.typeName,
- message,
- writer,
- );
- return writer;
- }
}
/**
* @generated MessageType for protobuf message stream.video.sfu.event.ConnectionQualityChanged
@@ -3462,77 +1485,6 @@ class ConnectionQualityInfo$Type extends MessageType {
},
]);
}
- create(value?: PartialMessage): ConnectionQualityInfo {
- const message = globalThis.Object.create(this.messagePrototype!);
- message.userId = '';
- message.sessionId = '';
- message.connectionQuality = 0;
- if (value !== undefined)
- reflectionMergePartial(this, message, value);
- return message;
- }
- internalBinaryRead(
- reader: IBinaryReader,
- length: number,
- options: BinaryReadOptions,
- target?: ConnectionQualityInfo,
- ): ConnectionQualityInfo {
- let message = target ?? this.create(),
- end = reader.pos + length;
- while (reader.pos < end) {
- let [fieldNo, wireType] = reader.tag();
- switch (fieldNo) {
- case /* string user_id */ 1:
- message.userId = reader.string();
- break;
- case /* string session_id */ 2:
- message.sessionId = reader.string();
- break;
- case /* stream.video.sfu.models.ConnectionQuality connection_quality */ 3:
- message.connectionQuality = reader.int32();
- break;
- default:
- let u = options.readUnknownField;
- if (u === 'throw')
- throw new globalThis.Error(
- `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`,
- );
- let d = reader.skip(wireType);
- if (u !== false)
- (u === true ? UnknownFieldHandler.onRead : u)(
- this.typeName,
- message,
- fieldNo,
- wireType,
- d,
- );
- }
- }
- return message;
- }
- internalBinaryWrite(
- message: ConnectionQualityInfo,
- writer: IBinaryWriter,
- options: BinaryWriteOptions,
- ): IBinaryWriter {
- /* string user_id = 1; */
- if (message.userId !== '')
- writer.tag(1, WireType.LengthDelimited).string(message.userId);
- /* string session_id = 2; */
- if (message.sessionId !== '')
- writer.tag(2, WireType.LengthDelimited).string(message.sessionId);
- /* stream.video.sfu.models.ConnectionQuality connection_quality = 3; */
- if (message.connectionQuality !== 0)
- writer.tag(3, WireType.Varint).int32(message.connectionQuality);
- let u = options.writeUnknownFields;
- if (u !== false)
- (u == true ? UnknownFieldHandler.onWrite : u)(
- this.typeName,
- message,
- writer,
- );
- return writer;
- }
}
/**
* @generated MessageType for protobuf message stream.video.sfu.event.ConnectionQualityInfo
@@ -3546,72 +1498,6 @@ class DominantSpeakerChanged$Type extends MessageType {
{ no: 2, name: 'session_id', kind: 'scalar', T: 9 /*ScalarType.STRING*/ },
]);
}
- create(
- value?: PartialMessage,
- ): DominantSpeakerChanged {
- const message = globalThis.Object.create(this.messagePrototype!);
- message.userId = '';
- message.sessionId = '';
- if (value !== undefined)
- reflectionMergePartial(this, message, value);
- return message;
- }
- internalBinaryRead(
- reader: IBinaryReader,
- length: number,
- options: BinaryReadOptions,
- target?: DominantSpeakerChanged,
- ): DominantSpeakerChanged {
- let message = target ?? this.create(),
- end = reader.pos + length;
- while (reader.pos < end) {
- let [fieldNo, wireType] = reader.tag();
- switch (fieldNo) {
- case /* string user_id */ 1:
- message.userId = reader.string();
- break;
- case /* string session_id */ 2:
- message.sessionId = reader.string();
- break;
- default:
- let u = options.readUnknownField;
- if (u === 'throw')
- throw new globalThis.Error(
- `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`,
- );
- let d = reader.skip(wireType);
- if (u !== false)
- (u === true ? UnknownFieldHandler.onRead : u)(
- this.typeName,
- message,
- fieldNo,
- wireType,
- d,
- );
- }
- }
- return message;
- }
- internalBinaryWrite(
- message: DominantSpeakerChanged,
- writer: IBinaryWriter,
- options: BinaryWriteOptions,
- ): IBinaryWriter {
- /* string user_id = 1; */
- if (message.userId !== '')
- writer.tag(1, WireType.LengthDelimited).string(message.userId);
- /* string session_id = 2; */
- if (message.sessionId !== '')
- writer.tag(2, WireType.LengthDelimited).string(message.sessionId);
- let u = options.writeUnknownFields;
- if (u !== false)
- (u == true ? UnknownFieldHandler.onWrite : u)(
- this.typeName,
- message,
- writer,
- );
- return writer;
- }
}
/**
* @generated MessageType for protobuf message stream.video.sfu.event.DominantSpeakerChanged
@@ -3627,83 +1513,6 @@ class AudioLevel$Type extends MessageType {
{ no: 4, name: 'is_speaking', kind: 'scalar', T: 8 /*ScalarType.BOOL*/ },
]);
}
- create(value?: PartialMessage): AudioLevel {
- const message = globalThis.Object.create(this.messagePrototype!);
- message.userId = '';
- message.sessionId = '';
- message.level = 0;
- message.isSpeaking = false;
- if (value !== undefined)
- reflectionMergePartial(this, message, value);
- return message;
- }
- internalBinaryRead(
- reader: IBinaryReader,
- length: number,
- options: BinaryReadOptions,
- target?: AudioLevel,
- ): AudioLevel {
- let message = target ?? this.create(),
- end = reader.pos + length;
- while (reader.pos < end) {
- let [fieldNo, wireType] = reader.tag();
- switch (fieldNo) {
- case /* string user_id */ 1:
- message.userId = reader.string();
- break;
- case /* string session_id */ 2:
- message.sessionId = reader.string();
- break;
- case /* float level */ 3:
- message.level = reader.float();
- break;
- case /* bool is_speaking */ 4:
- message.isSpeaking = reader.bool();
- break;
- default:
- let u = options.readUnknownField;
- if (u === 'throw')
- throw new globalThis.Error(
- `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`,
- );
- let d = reader.skip(wireType);
- if (u !== false)
- (u === true ? UnknownFieldHandler.onRead : u)(
- this.typeName,
- message,
- fieldNo,
- wireType,
- d,
- );
- }
- }
- return message;
- }
- internalBinaryWrite(
- message: AudioLevel,
- writer: IBinaryWriter,
- options: BinaryWriteOptions,
- ): IBinaryWriter {
- /* string user_id = 1; */
- if (message.userId !== '')
- writer.tag(1, WireType.LengthDelimited).string(message.userId);
- /* string session_id = 2; */
- if (message.sessionId !== '')
- writer.tag(2, WireType.LengthDelimited).string(message.sessionId);
- /* float level = 3; */
- if (message.level !== 0) writer.tag(3, WireType.Bit32).float(message.level);
- /* bool is_speaking = 4; */
- if (message.isSpeaking !== false)
- writer.tag(4, WireType.Varint).bool(message.isSpeaking);
- let u = options.writeUnknownFields;
- if (u !== false)
- (u == true ? UnknownFieldHandler.onWrite : u)(
- this.typeName,
- message,
- writer,
- );
- return writer;
- }
}
/**
* @generated MessageType for protobuf message stream.video.sfu.event.AudioLevel
@@ -3722,69 +1531,6 @@ class AudioLevelChanged$Type extends MessageType {
},
]);
}
- create(value?: PartialMessage): AudioLevelChanged {
- const message = globalThis.Object.create(this.messagePrototype!);
- message.audioLevels = [];
- if (value !== undefined)
- reflectionMergePartial(this, message, value);
- return message;
- }
- internalBinaryRead(
- reader: IBinaryReader,
- length: number,
- options: BinaryReadOptions,
- target?: AudioLevelChanged,
- ): AudioLevelChanged {
- let message = target ?? this.create(),
- end = reader.pos + length;
- while (reader.pos < end) {
- let [fieldNo, wireType] = reader.tag();
- switch (fieldNo) {
- case /* repeated stream.video.sfu.event.AudioLevel audio_levels */ 1:
- message.audioLevels.push(
- AudioLevel.internalBinaryRead(reader, reader.uint32(), options),
- );
- break;
- default:
- let u = options.readUnknownField;
- if (u === 'throw')
- throw new globalThis.Error(
- `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`,
- );
- let d = reader.skip(wireType);
- if (u !== false)
- (u === true ? UnknownFieldHandler.onRead : u)(
- this.typeName,
- message,
- fieldNo,
- wireType,
- d,
- );
- }
- }
- return message;
- }
- internalBinaryWrite(
- message: AudioLevelChanged,
- writer: IBinaryWriter,
- options: BinaryWriteOptions,
- ): IBinaryWriter {
- /* repeated stream.video.sfu.event.AudioLevel audio_levels = 1; */
- for (let i = 0; i < message.audioLevels.length; i++)
- AudioLevel.internalBinaryWrite(
- message.audioLevels[i],
- writer.tag(1, WireType.LengthDelimited).fork(),
- options,
- ).join();
- let u = options.writeUnknownFields;
- if (u !== false)
- (u == true ? UnknownFieldHandler.onWrite : u)(
- this.typeName,
- message,
- writer,
- );
- return writer;
- }
}
/**
* @generated MessageType for protobuf message stream.video.sfu.event.AudioLevelChanged
@@ -3802,63 +1548,6 @@ class AudioMediaRequest$Type extends MessageType {
},
]);
}
- create(value?: PartialMessage): AudioMediaRequest {
- const message = globalThis.Object.create(this.messagePrototype!);
- message.channelCount = 0;
- if (value !== undefined)
- reflectionMergePartial(this, message, value);
- return message;
- }
- internalBinaryRead(
- reader: IBinaryReader,
- length: number,
- options: BinaryReadOptions,
- target?: AudioMediaRequest,
- ): AudioMediaRequest {
- let message = target ?? this.create(),
- end = reader.pos + length;
- while (reader.pos < end) {
- let [fieldNo, wireType] = reader.tag();
- switch (fieldNo) {
- case /* int32 channel_count */ 1:
- message.channelCount = reader.int32();
- break;
- default:
- let u = options.readUnknownField;
- if (u === 'throw')
- throw new globalThis.Error(
- `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`,
- );
- let d = reader.skip(wireType);
- if (u !== false)
- (u === true ? UnknownFieldHandler.onRead : u)(
- this.typeName,
- message,
- fieldNo,
- wireType,
- d,
- );
- }
- }
- return message;
- }
- internalBinaryWrite(
- message: AudioMediaRequest,
- writer: IBinaryWriter,
- options: BinaryWriteOptions,
- ): IBinaryWriter {
- /* int32 channel_count = 1; */
- if (message.channelCount !== 0)
- writer.tag(1, WireType.Varint).int32(message.channelCount);
- let u = options.writeUnknownFields;
- if (u !== false)
- (u == true ? UnknownFieldHandler.onWrite : u)(
- this.typeName,
- message,
- writer,
- );
- return writer;
- }
}
/**
* @generated MessageType for protobuf message stream.video.sfu.event.AudioMediaRequest
@@ -3877,86 +1566,6 @@ class AudioSender$Type extends MessageType {
{ no: 2, name: 'codec', kind: 'message', T: () => Codec },
]);
}
- create(value?: PartialMessage): AudioSender {
- const message = globalThis.Object.create(this.messagePrototype!);
- if (value !== undefined)
- reflectionMergePartial(this, message, value);
- return message;
- }
- internalBinaryRead(
- reader: IBinaryReader,
- length: number,
- options: BinaryReadOptions,
- target?: AudioSender,
- ): AudioSender {
- let message = target ?? this.create(),
- end = reader.pos + length;
- while (reader.pos < end) {
- let [fieldNo, wireType] = reader.tag();
- switch (fieldNo) {
- case /* stream.video.sfu.event.AudioMediaRequest media_request */ 1:
- message.mediaRequest = AudioMediaRequest.internalBinaryRead(
- reader,
- reader.uint32(),
- options,
- message.mediaRequest,
- );
- break;
- case /* stream.video.sfu.models.Codec codec */ 2:
- message.codec = Codec.internalBinaryRead(
- reader,
- reader.uint32(),
- options,
- message.codec,
- );
- break;
- default:
- let u = options.readUnknownField;
- if (u === 'throw')
- throw new globalThis.Error(
- `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`,
- );
- let d = reader.skip(wireType);
- if (u !== false)
- (u === true ? UnknownFieldHandler.onRead : u)(
- this.typeName,
- message,
- fieldNo,
- wireType,
- d,
- );
- }
- }
- return message;
- }
- internalBinaryWrite(
- message: AudioSender,
- writer: IBinaryWriter,
- options: BinaryWriteOptions,
- ): IBinaryWriter {
- /* stream.video.sfu.event.AudioMediaRequest media_request = 1; */
- if (message.mediaRequest)
- AudioMediaRequest.internalBinaryWrite(
- message.mediaRequest,
- writer.tag(1, WireType.LengthDelimited).fork(),
- options,
- ).join();
- /* stream.video.sfu.models.Codec codec = 2; */
- if (message.codec)
- Codec.internalBinaryWrite(
- message.codec,
- writer.tag(2, WireType.LengthDelimited).fork(),
- options,
- ).join();
- let u = options.writeUnknownFields;
- if (u !== false)
- (u == true ? UnknownFieldHandler.onWrite : u)(
- this.typeName,
- message,
- writer,
- );
- return writer;
- }
}
/**
* @generated MessageType for protobuf message stream.video.sfu.event.AudioSender
@@ -3981,77 +1590,6 @@ class VideoMediaRequest$Type extends MessageType {
},
]);
}
- create(value?: PartialMessage): VideoMediaRequest {
- const message = globalThis.Object.create(this.messagePrototype!);
- message.idealHeight = 0;
- message.idealWidth = 0;
- message.idealFrameRate = 0;
- if (value !== undefined)
- reflectionMergePartial(this, message, value);
- return message;
- }
- internalBinaryRead(
- reader: IBinaryReader,
- length: number,
- options: BinaryReadOptions,
- target?: VideoMediaRequest,
- ): VideoMediaRequest {
- let message = target ?? this.create(),
- end = reader.pos + length;
- while (reader.pos < end) {
- let [fieldNo, wireType] = reader.tag();
- switch (fieldNo) {
- case /* int32 ideal_height */ 1:
- message.idealHeight = reader.int32();
- break;
- case /* int32 ideal_width */ 2:
- message.idealWidth = reader.int32();
- break;
- case /* int32 ideal_frame_rate */ 3:
- message.idealFrameRate = reader.int32();
- break;
- default:
- let u = options.readUnknownField;
- if (u === 'throw')
- throw new globalThis.Error(
- `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`,
- );
- let d = reader.skip(wireType);
- if (u !== false)
- (u === true ? UnknownFieldHandler.onRead : u)(
- this.typeName,
- message,
- fieldNo,
- wireType,
- d,
- );
- }
- }
- return message;
- }
- internalBinaryWrite(
- message: VideoMediaRequest,
- writer: IBinaryWriter,
- options: BinaryWriteOptions,
- ): IBinaryWriter {
- /* int32 ideal_height = 1; */
- if (message.idealHeight !== 0)
- writer.tag(1, WireType.Varint).int32(message.idealHeight);
- /* int32 ideal_width = 2; */
- if (message.idealWidth !== 0)
- writer.tag(2, WireType.Varint).int32(message.idealWidth);
- /* int32 ideal_frame_rate = 3; */
- if (message.idealFrameRate !== 0)
- writer.tag(3, WireType.Varint).int32(message.idealFrameRate);
- let u = options.writeUnknownFields;
- if (u !== false)
- (u == true ? UnknownFieldHandler.onWrite : u)(
- this.typeName,
- message,
- writer,
- );
- return writer;
- }
}
/**
* @generated MessageType for protobuf message stream.video.sfu.event.VideoMediaRequest
@@ -4089,113 +1627,6 @@ class VideoLayerSetting$Type extends MessageType {
},
]);
}
- create(value?: PartialMessage): VideoLayerSetting {
- const message = globalThis.Object.create(this.messagePrototype!);
- message.name = '';
- message.active = false;
- message.maxBitrate = 0;
- message.scaleResolutionDownBy = 0;
- message.priority = 0;
- message.maxFramerate = 0;
- if (value !== undefined)
- reflectionMergePartial(this, message, value);
- return message;
- }
- internalBinaryRead(
- reader: IBinaryReader,
- length: number,
- options: BinaryReadOptions,
- target?: VideoLayerSetting,
- ): VideoLayerSetting {
- let message = target ?? this.create(),
- end = reader.pos + length;
- while (reader.pos < end) {
- let [fieldNo, wireType] = reader.tag();
- switch (fieldNo) {
- case /* string name */ 1:
- message.name = reader.string();
- break;
- case /* bool active */ 2:
- message.active = reader.bool();
- break;
- case /* int32 max_bitrate */ 3:
- message.maxBitrate = reader.int32();
- break;
- case /* float scale_resolution_down_by */ 4:
- message.scaleResolutionDownBy = reader.float();
- break;
- case /* stream.video.sfu.event.VideoLayerSetting.Priority priority */ 5:
- message.priority = reader.int32();
- break;
- case /* stream.video.sfu.models.Codec codec */ 6:
- message.codec = Codec.internalBinaryRead(
- reader,
- reader.uint32(),
- options,
- message.codec,
- );
- break;
- case /* uint32 max_framerate */ 7:
- message.maxFramerate = reader.uint32();
- break;
- default:
- let u = options.readUnknownField;
- if (u === 'throw')
- throw new globalThis.Error(
- `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`,
- );
- let d = reader.skip(wireType);
- if (u !== false)
- (u === true ? UnknownFieldHandler.onRead : u)(
- this.typeName,
- message,
- fieldNo,
- wireType,
- d,
- );
- }
- }
- return message;
- }
- internalBinaryWrite(
- message: VideoLayerSetting,
- writer: IBinaryWriter,
- options: BinaryWriteOptions,
- ): IBinaryWriter {
- /* string name = 1; */
- if (message.name !== '')
- writer.tag(1, WireType.LengthDelimited).string(message.name);
- /* bool active = 2; */
- if (message.active !== false)
- writer.tag(2, WireType.Varint).bool(message.active);
- /* int32 max_bitrate = 3; */
- if (message.maxBitrate !== 0)
- writer.tag(3, WireType.Varint).int32(message.maxBitrate);
- /* float scale_resolution_down_by = 4; */
- if (message.scaleResolutionDownBy !== 0)
- writer.tag(4, WireType.Bit32).float(message.scaleResolutionDownBy);
- /* stream.video.sfu.event.VideoLayerSetting.Priority priority = 5; */
- if (message.priority !== 0)
- writer.tag(5, WireType.Varint).int32(message.priority);
- /* stream.video.sfu.models.Codec codec = 6; */
- if (message.codec)
- Codec.internalBinaryWrite(
- message.codec,
- writer.tag(6, WireType.LengthDelimited).fork(),
- options,
- ).join();
- /* uint32 max_framerate = 7; */
- if (message.maxFramerate !== 0)
- writer.tag(7, WireType.Varint).uint32(message.maxFramerate);
- let u = options.writeUnknownFields;
- if (u !== false)
- (u == true ? UnknownFieldHandler.onWrite : u)(
- this.typeName,
- message,
- writer,
- );
- return writer;
- }
}
/**
* @generated MessageType for protobuf message stream.video.sfu.event.VideoLayerSetting
@@ -4221,103 +1652,6 @@ class VideoSender$Type extends MessageType {
},
]);
}
- create(value?: PartialMessage): VideoSender {
- const message = globalThis.Object.create(this.messagePrototype!);
- message.layers = [];
- if (value !== undefined)
- reflectionMergePartial(this, message, value);
- return message;
- }
- internalBinaryRead(
- reader: IBinaryReader,
- length: number,
- options: BinaryReadOptions,
- target?: VideoSender,
- ): VideoSender {
- let message = target ?? this.create(),
- end = reader.pos + length;
- while (reader.pos < end) {
- let [fieldNo, wireType] = reader.tag();
- switch (fieldNo) {
- case /* stream.video.sfu.event.VideoMediaRequest media_request */ 1:
- message.mediaRequest = VideoMediaRequest.internalBinaryRead(
- reader,
- reader.uint32(),
- options,
- message.mediaRequest,
- );
- break;
- case /* stream.video.sfu.models.Codec codec */ 2:
- message.codec = Codec.internalBinaryRead(
- reader,
- reader.uint32(),
- options,
- message.codec,
- );
- break;
- case /* repeated stream.video.sfu.event.VideoLayerSetting layers */ 3:
- message.layers.push(
- VideoLayerSetting.internalBinaryRead(
- reader,
- reader.uint32(),
- options,
- ),
- );
- break;
- default:
- let u = options.readUnknownField;
- if (u === 'throw')
- throw new globalThis.Error(
- `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`,
- );
- let d = reader.skip(wireType);
- if (u !== false)
- (u === true ? UnknownFieldHandler.onRead : u)(
- this.typeName,
- message,
- fieldNo,
- wireType,
- d,
- );
- }
- }
- return message;
- }
- internalBinaryWrite(
- message: VideoSender,
- writer: IBinaryWriter,
- options: BinaryWriteOptions,
- ): IBinaryWriter {
- /* stream.video.sfu.event.VideoMediaRequest media_request = 1; */
- if (message.mediaRequest)
- VideoMediaRequest.internalBinaryWrite(
- message.mediaRequest,
- writer.tag(1, WireType.LengthDelimited).fork(),
- options,
- ).join();
- /* stream.video.sfu.models.Codec codec = 2; */
- if (message.codec)
- Codec.internalBinaryWrite(
- message.codec,
- writer.tag(2, WireType.LengthDelimited).fork(),
- options,
- ).join();
- /* repeated stream.video.sfu.event.VideoLayerSetting layers = 3; */
- for (let i = 0; i < message.layers.length; i++)
- VideoLayerSetting.internalBinaryWrite(
- message.layers[i],
- writer.tag(3, WireType.LengthDelimited).fork(),
- options,
- ).join();
- let u = options.writeUnknownFields;
- if (u !== false)
- (u == true ? UnknownFieldHandler.onWrite : u)(
- this.typeName,
- message,
- writer,
- );
- return writer;
- }
}
/**
* @generated MessageType for protobuf message stream.video.sfu.event.VideoSender
@@ -4343,82 +1677,6 @@ class ChangePublishQuality$Type extends MessageType {
},
]);
}
- create(value?: PartialMessage): ChangePublishQuality {
- const message = globalThis.Object.create(this.messagePrototype!);
- message.audioSenders = [];
- message.videoSenders = [];
- if (value !== undefined)
- reflectionMergePartial(this, message, value);
- return message;
- }
- internalBinaryRead(
- reader: IBinaryReader,
- length: number,
- options: BinaryReadOptions,
- target?: ChangePublishQuality,
- ): ChangePublishQuality {
- let message = target ?? this.create(),
- end = reader.pos + length;
- while (reader.pos < end) {
- let [fieldNo, wireType] = reader.tag();
- switch (fieldNo) {
- case /* repeated stream.video.sfu.event.AudioSender audio_senders */ 1:
- message.audioSenders.push(
- AudioSender.internalBinaryRead(reader, reader.uint32(), options),
- );
- break;
- case /* repeated stream.video.sfu.event.VideoSender video_senders */ 2:
- message.videoSenders.push(
- VideoSender.internalBinaryRead(reader, reader.uint32(), options),
- );
- break;
- default:
- let u = options.readUnknownField;
- if (u === 'throw')
- throw new globalThis.Error(
- `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`,
- );
- let d = reader.skip(wireType);
- if (u !== false)
- (u === true ? UnknownFieldHandler.onRead : u)(
- this.typeName,
- message,
- fieldNo,
- wireType,
- d,
- );
- }
- }
- return message;
- }
- internalBinaryWrite(
- message: ChangePublishQuality,
- writer: IBinaryWriter,
- options: BinaryWriteOptions,
- ): IBinaryWriter {
- /* repeated stream.video.sfu.event.AudioSender audio_senders = 1; */
- for (let i = 0; i < message.audioSenders.length; i++)
- AudioSender.internalBinaryWrite(
- message.audioSenders[i],
- writer.tag(1, WireType.LengthDelimited).fork(),
- options,
- ).join();
- /* repeated stream.video.sfu.event.VideoSender video_senders = 2; */
- for (let i = 0; i < message.videoSenders.length; i++)
- VideoSender.internalBinaryWrite(
- message.videoSenders[i],
- writer.tag(2, WireType.LengthDelimited).fork(),
- options,
- ).join();
- let u = options.writeUnknownFields;
- if (u !== false)
- (u == true ? UnknownFieldHandler.onWrite : u)(
- this.typeName,
- message,
- writer,
- );
- return writer;
- }
}
/**
* @generated MessageType for protobuf message stream.video.sfu.event.ChangePublishQuality
@@ -4432,78 +1690,6 @@ class CallGrantsUpdated$Type extends MessageType {
{ no: 2, name: 'message', kind: 'scalar', T: 9 /*ScalarType.STRING*/ },
]);
}
- create(value?: PartialMessage): CallGrantsUpdated {
- const message = globalThis.Object.create(this.messagePrototype!);
- message.message = '';
- if (value !== undefined)
- reflectionMergePartial(this, message, value);
- return message;
- }
- internalBinaryRead(
- reader: IBinaryReader,
- length: number,
- options: BinaryReadOptions,
- target?: CallGrantsUpdated,
- ): CallGrantsUpdated {
- let message = target ?? this.create(),
- end = reader.pos + length;
- while (reader.pos < end) {
- let [fieldNo, wireType] = reader.tag();
- switch (fieldNo) {
- case /* stream.video.sfu.models.CallGrants current_grants */ 1:
- message.currentGrants = CallGrants.internalBinaryRead(
- reader,
- reader.uint32(),
- options,
- message.currentGrants,
- );
- break;
- case /* string message */ 2:
- message.message = reader.string();
- break;
- default:
- let u = options.readUnknownField;
- if (u === 'throw')
- throw new globalThis.Error(
- `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`,
- );
- let d = reader.skip(wireType);
- if (u !== false)
- (u === true ? UnknownFieldHandler.onRead : u)(
- this.typeName,
- message,
- fieldNo,
- wireType,
- d,
- );
- }
- }
- return message;
- }
- internalBinaryWrite(
- message: CallGrantsUpdated,
- writer: IBinaryWriter,
- options: BinaryWriteOptions,
- ): IBinaryWriter {
- /* stream.video.sfu.models.CallGrants current_grants = 1; */
- if (message.currentGrants)
- CallGrants.internalBinaryWrite(
- message.currentGrants,
- writer.tag(1, WireType.LengthDelimited).fork(),
- options,
- ).join();
- /* string message = 2; */
- if (message.message !== '')
- writer.tag(2, WireType.LengthDelimited).string(message.message);
- let u = options.writeUnknownFields;
- if (u !== false)
- (u == true ? UnknownFieldHandler.onWrite : u)(
- this.typeName,
- message,
- writer,
- );
- return writer;
- }
}
/**
* @generated MessageType for protobuf message stream.video.sfu.event.CallGrantsUpdated
@@ -4525,63 +1711,6 @@ class GoAway$Type extends MessageType {
},
]);
}
- create(value?: PartialMessage): GoAway {
- const message = globalThis.Object.create(this.messagePrototype!);
- message.reason = 0;
- if (value !== undefined)
- reflectionMergePartial(this, message, value);
- return message;
- }
- internalBinaryRead(
- reader: IBinaryReader,
- length: number,
- options: BinaryReadOptions,
- target?: GoAway,
- ): GoAway {
- let message = target ?? this.create(),
- end = reader.pos + length;
- while (reader.pos < end) {
- let [fieldNo, wireType] = reader.tag();
- switch (fieldNo) {
- case /* stream.video.sfu.models.GoAwayReason reason */ 1:
- message.reason = reader.int32();
- break;
- default:
- let u = options.readUnknownField;
- if (u === 'throw')
- throw new globalThis.Error(
- `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`,
- );
- let d = reader.skip(wireType);
- if (u !== false)
- (u === true ? UnknownFieldHandler.onRead : u)(
- this.typeName,
- message,
- fieldNo,
- wireType,
- d,
- );
- }
- }
- return message;
- }
- internalBinaryWrite(
- message: GoAway,
- writer: IBinaryWriter,
- options: BinaryWriteOptions,
- ): IBinaryWriter {
- /* stream.video.sfu.models.GoAwayReason reason = 1; */
- if (message.reason !== 0)
- writer.tag(1, WireType.Varint).int32(message.reason);
- let u = options.writeUnknownFields;
- if (u !== false)
- (u == true ? UnknownFieldHandler.onWrite : u)(
- this.typeName,
- message,
- writer,
- );
- return writer;
- }
}
/**
* @generated MessageType for protobuf message stream.video.sfu.event.GoAway
@@ -4603,63 +1732,6 @@ class CallEnded$Type extends MessageType {
},
]);
}
- create(value?: PartialMessage): CallEnded {
- const message = globalThis.Object.create(this.messagePrototype!);
- message.reason = 0;
- if (value !== undefined)
- reflectionMergePartial(this, message, value);
- return message;
- }
- internalBinaryRead(
- reader: IBinaryReader,
- length: number,
- options: BinaryReadOptions,
- target?: CallEnded,
- ): CallEnded {
- let message = target ?? this.create(),
- end = reader.pos + length;
- while (reader.pos < end) {
- let [fieldNo, wireType] = reader.tag();
- switch (fieldNo) {
- case /* stream.video.sfu.models.CallEndedReason reason */ 1:
- message.reason = reader.int32();
- break;
- default:
- let u = options.readUnknownField;
- if (u === 'throw')
- throw new globalThis.Error(
- `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`,
- );
- let d = reader.skip(wireType);
- if (u !== false)
- (u === true ? UnknownFieldHandler.onRead : u)(
- this.typeName,
- message,
- fieldNo,
- wireType,
- d,
- );
- }
- }
- return message;
- }
- internalBinaryWrite(
- message: CallEnded,
- writer: IBinaryWriter,
- options: BinaryWriteOptions,
- ): IBinaryWriter {
- /* stream.video.sfu.models.CallEndedReason reason = 1; */
- if (message.reason !== 0)
- writer.tag(1, WireType.Varint).int32(message.reason);
- let u = options.writeUnknownFields;
- if (u !== false)
- (u == true ? UnknownFieldHandler.onWrite : u)(
- this.typeName,
- message,
- writer,
- );
- return writer;
- }
}
/**
* @generated MessageType for protobuf message stream.video.sfu.event.CallEnded
diff --git a/packages/client/src/gen/video/sfu/models/models.ts b/packages/client/src/gen/video/sfu/models/models.ts
index 073c92f842..b555626a74 100644
--- a/packages/client/src/gen/video/sfu/models/models.ts
+++ b/packages/client/src/gen/video/sfu/models/models.ts
@@ -1,20 +1,8 @@
/* eslint-disable */
-// @generated by protobuf-ts 2.9.4 with parameter long_type_string,client_generic,server_none,eslint_disable
+// @generated by protobuf-ts 2.9.4 with parameter long_type_string,client_generic,server_none,eslint_disable,optimize_code_size
// @generated from protobuf file "video/sfu/models/models.proto" (package "stream.video.sfu.models", syntax proto3)
// tslint:disable
-import type {
- BinaryReadOptions,
- BinaryWriteOptions,
- IBinaryReader,
- IBinaryWriter,
- PartialMessage,
-} from '@protobuf-ts/runtime';
-import {
- MessageType,
- reflectionMergePartial,
- UnknownFieldHandler,
- WireType,
-} from '@protobuf-ts/runtime';
+import { MessageType } from '@protobuf-ts/runtime';
import { Struct } from '../../../google/protobuf/struct';
import { Timestamp } from '../../../google/protobuf/timestamp';
@@ -812,112 +800,6 @@ class CallState$Type extends MessageType {
},
]);
}
- create(value?: PartialMessage): CallState {
- const message = globalThis.Object.create(this.messagePrototype!);
- message.participants = [];
- message.pins = [];
- if (value !== undefined)
- reflectionMergePartial(this, message, value);
- return message;
- }
- internalBinaryRead(
- reader: IBinaryReader,
- length: number,
- options: BinaryReadOptions,
- target?: CallState,
- ): CallState {
- let message = target ?? this.create(),
- end = reader.pos + length;
- while (reader.pos < end) {
- let [fieldNo, wireType] = reader.tag();
- switch (fieldNo) {
- case /* repeated stream.video.sfu.models.Participant participants */ 1:
- message.participants.push(
- Participant.internalBinaryRead(reader, reader.uint32(), options),
- );
- break;
- case /* google.protobuf.Timestamp started_at */ 2:
- message.startedAt = Timestamp.internalBinaryRead(
- reader,
- reader.uint32(),
- options,
- message.startedAt,
- );
- break;
- case /* stream.video.sfu.models.ParticipantCount participant_count */ 3:
- message.participantCount = ParticipantCount.internalBinaryRead(
- reader,
- reader.uint32(),
- options,
- message.participantCount,
- );
- break;
- case /* repeated stream.video.sfu.models.Pin pins */ 4:
- message.pins.push(
- Pin.internalBinaryRead(reader, reader.uint32(), options),
- );
- break;
- default:
- let u = options.readUnknownField;
- if (u === 'throw')
- throw new globalThis.Error(
- `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`,
- );
- let d = reader.skip(wireType);
- if (u !== false)
- (u === true ? UnknownFieldHandler.onRead : u)(
- this.typeName,
- message,
- fieldNo,
- wireType,
- d,
- );
- }
- }
- return message;
- }
- internalBinaryWrite(
- message: CallState,
- writer: IBinaryWriter,
- options: BinaryWriteOptions,
- ): IBinaryWriter {
- /* repeated stream.video.sfu.models.Participant participants = 1; */
- for (let i = 0; i < message.participants.length; i++)
- Participant.internalBinaryWrite(
- message.participants[i],
- writer.tag(1, WireType.LengthDelimited).fork(),
- options,
- ).join();
- /* google.protobuf.Timestamp started_at = 2; */
- if (message.startedAt)
- Timestamp.internalBinaryWrite(
- message.startedAt,
- writer.tag(2, WireType.LengthDelimited).fork(),
- options,
- ).join();
- /* stream.video.sfu.models.ParticipantCount participant_count = 3; */
- if (message.participantCount)
- ParticipantCount.internalBinaryWrite(
- message.participantCount,
- writer.tag(3, WireType.LengthDelimited).fork(),
- options,
- ).join();
- /* repeated stream.video.sfu.models.Pin pins = 4; */
- for (let i = 0; i < message.pins.length; i++)
- Pin.internalBinaryWrite(
- message.pins[i],
- writer.tag(4, WireType.LengthDelimited).fork(),
- options,
- ).join();
- let u = options.writeUnknownFields;
- if (u !== false)
- (u == true ? UnknownFieldHandler.onWrite : u)(
- this.typeName,
- message,
- writer,
- );
- return writer;
- }
}
/**
* @generated MessageType for protobuf message stream.video.sfu.models.CallState
@@ -931,70 +813,6 @@ class ParticipantCount$Type extends MessageType {
{ no: 2, name: 'anonymous', kind: 'scalar', T: 13 /*ScalarType.UINT32*/ },
]);
}
- create(value?: PartialMessage): ParticipantCount {
- const message = globalThis.Object.create(this.messagePrototype!);
- message.total = 0;
- message.anonymous = 0;
- if (value !== undefined)
- reflectionMergePartial(this, message, value);
- return message;
- }
- internalBinaryRead(
- reader: IBinaryReader,
- length: number,
- options: BinaryReadOptions,
- target?: ParticipantCount,
- ): ParticipantCount {
- let message = target ?? this.create(),
- end = reader.pos + length;
- while (reader.pos < end) {
- let [fieldNo, wireType] = reader.tag();
- switch (fieldNo) {
- case /* uint32 total */ 1:
- message.total = reader.uint32();
- break;
- case /* uint32 anonymous */ 2:
- message.anonymous = reader.uint32();
- break;
- default:
- let u = options.readUnknownField;
- if (u === 'throw')
- throw new globalThis.Error(
- `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`,
- );
- let d = reader.skip(wireType);
- if (u !== false)
- (u === true ? UnknownFieldHandler.onRead : u)(
- this.typeName,
- message,
- fieldNo,
- wireType,
- d,
- );
- }
- }
- return message;
- }
- internalBinaryWrite(
- message: ParticipantCount,
- writer: IBinaryWriter,
- options: BinaryWriteOptions,
- ): IBinaryWriter {
- /* uint32 total = 1; */
- if (message.total !== 0)
- writer.tag(1, WireType.Varint).uint32(message.total);
- /* uint32 anonymous = 2; */
- if (message.anonymous !== 0)
- writer.tag(2, WireType.Varint).uint32(message.anonymous);
- let u = options.writeUnknownFields;
- if (u !== false)
- (u == true ? UnknownFieldHandler.onWrite : u)(
- this.typeName,
- message,
- writer,
- );
- return writer;
- }
}
/**
* @generated MessageType for protobuf message stream.video.sfu.models.ParticipantCount
@@ -1008,69 +826,6 @@ class Pin$Type extends MessageType {
{ no: 2, name: 'session_id', kind: 'scalar', T: 9 /*ScalarType.STRING*/ },
]);
}
- create(value?: PartialMessage): Pin {
- const message = globalThis.Object.create(this.messagePrototype!);
- message.userId = '';
- message.sessionId = '';
- if (value !== undefined) reflectionMergePartial(this, message, value);
- return message;
- }
- internalBinaryRead(
- reader: IBinaryReader,
- length: number,
- options: BinaryReadOptions,
- target?: Pin,
- ): Pin {
- let message = target ?? this.create(),
- end = reader.pos + length;
- while (reader.pos < end) {
- let [fieldNo, wireType] = reader.tag();
- switch (fieldNo) {
- case /* string user_id */ 1:
- message.userId = reader.string();
- break;
- case /* string session_id */ 2:
- message.sessionId = reader.string();
- break;
- default:
- let u = options.readUnknownField;
- if (u === 'throw')
- throw new globalThis.Error(
- `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`,
- );
- let d = reader.skip(wireType);
- if (u !== false)
- (u === true ? UnknownFieldHandler.onRead : u)(
- this.typeName,
- message,
- fieldNo,
- wireType,
- d,
- );
- }
- }
- return message;
- }
- internalBinaryWrite(
- message: Pin,
- writer: IBinaryWriter,
- options: BinaryWriteOptions,
- ): IBinaryWriter {
- /* string user_id = 1; */
- if (message.userId !== '')
- writer.tag(1, WireType.LengthDelimited).string(message.userId);
- /* string session_id = 2; */
- if (message.sessionId !== '')
- writer.tag(2, WireType.LengthDelimited).string(message.sessionId);
- let u = options.writeUnknownFields;
- if (u !== false)
- (u == true ? UnknownFieldHandler.onWrite : u)(
- this.typeName,
- message,
- writer,
- );
- return writer;
- }
}
/**
* @generated MessageType for protobuf message stream.video.sfu.models.Pin
@@ -1130,170 +885,6 @@ class Participant$Type extends MessageType {
},
]);
}
- create(value?: PartialMessage): Participant {
- const message = globalThis.Object.create(this.messagePrototype!);
- message.userId = '';
- message.sessionId = '';
- message.publishedTracks = [];
- message.trackLookupPrefix = '';
- message.connectionQuality = 0;
- message.isSpeaking = false;
- message.isDominantSpeaker = false;
- message.audioLevel = 0;
- message.name = '';
- message.image = '';
- message.roles = [];
- if (value !== undefined)
- reflectionMergePartial(this, message, value);
- return message;
- }
- internalBinaryRead(
- reader: IBinaryReader,
- length: number,
- options: BinaryReadOptions,
- target?: Participant,
- ): Participant {
- let message = target ?? this.create(),
- end = reader.pos + length;
- while (reader.pos < end) {
- let [fieldNo, wireType] = reader.tag();
- switch (fieldNo) {
- case /* string user_id */ 1:
- message.userId = reader.string();
- break;
- case /* string session_id */ 2:
- message.sessionId = reader.string();
- break;
- case /* repeated stream.video.sfu.models.TrackType published_tracks */ 3:
- if (wireType === WireType.LengthDelimited)
- for (let e = reader.int32() + reader.pos; reader.pos < e; )
- message.publishedTracks.push(reader.int32());
- else message.publishedTracks.push(reader.int32());
- break;
- case /* google.protobuf.Timestamp joined_at */ 4:
- message.joinedAt = Timestamp.internalBinaryRead(
- reader,
- reader.uint32(),
- options,
- message.joinedAt,
- );
- break;
- case /* string track_lookup_prefix */ 5:
- message.trackLookupPrefix = reader.string();
- break;
- case /* stream.video.sfu.models.ConnectionQuality connection_quality */ 6:
- message.connectionQuality = reader.int32();
- break;
- case /* bool is_speaking */ 7:
- message.isSpeaking = reader.bool();
- break;
- case /* bool is_dominant_speaker */ 8:
- message.isDominantSpeaker = reader.bool();
- break;
- case /* float audio_level */ 9:
- message.audioLevel = reader.float();
- break;
- case /* string name */ 10:
- message.name = reader.string();
- break;
- case /* string image */ 11:
- message.image = reader.string();
- break;
- case /* google.protobuf.Struct custom */ 12:
- message.custom = Struct.internalBinaryRead(
- reader,
- reader.uint32(),
- options,
- message.custom,
- );
- break;
- case /* repeated string roles */ 13:
- message.roles.push(reader.string());
- break;
- default:
- let u = options.readUnknownField;
- if (u === 'throw')
- throw new globalThis.Error(
- `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`,
- );
- let d = reader.skip(wireType);
- if (u !== false)
- (u === true ? UnknownFieldHandler.onRead : u)(
- this.typeName,
- message,
- fieldNo,
- wireType,
- d,
- );
- }
- }
- return message;
- }
- internalBinaryWrite(
- message: Participant,
- writer: IBinaryWriter,
- options: BinaryWriteOptions,
- ): IBinaryWriter {
- /* string user_id = 1; */
- if (message.userId !== '')
- writer.tag(1, WireType.LengthDelimited).string(message.userId);
- /* string session_id = 2; */
- if (message.sessionId !== '')
- writer.tag(2, WireType.LengthDelimited).string(message.sessionId);
- /* repeated stream.video.sfu.models.TrackType published_tracks = 3; */
- if (message.publishedTracks.length) {
- writer.tag(3, WireType.LengthDelimited).fork();
- for (let i = 0; i < message.publishedTracks.length; i++)
- writer.int32(message.publishedTracks[i]);
- writer.join();
- }
- /* google.protobuf.Timestamp joined_at = 4; */
- if (message.joinedAt)
- Timestamp.internalBinaryWrite(
- message.joinedAt,
- writer.tag(4, WireType.LengthDelimited).fork(),
- options,
- ).join();
- /* string track_lookup_prefix = 5; */
- if (message.trackLookupPrefix !== '')
- writer.tag(5, WireType.LengthDelimited).string(message.trackLookupPrefix);
- /* stream.video.sfu.models.ConnectionQuality connection_quality = 6; */
- if (message.connectionQuality !== 0)
- writer.tag(6, WireType.Varint).int32(message.connectionQuality);
- /* bool is_speaking = 7; */
- if (message.isSpeaking !== false)
- writer.tag(7, WireType.Varint).bool(message.isSpeaking);
- /* bool is_dominant_speaker = 8; */
- if (message.isDominantSpeaker !== false)
- writer.tag(8, WireType.Varint).bool(message.isDominantSpeaker);
- /* float audio_level = 9; */
- if (message.audioLevel !== 0)
- writer.tag(9, WireType.Bit32).float(message.audioLevel);
- /* string name = 10; */
- if (message.name !== '')
- writer.tag(10, WireType.LengthDelimited).string(message.name);
- /* string image = 11; */
- if (message.image !== '')
- writer.tag(11, WireType.LengthDelimited).string(message.image);
- /* google.protobuf.Struct custom = 12; */
- if (message.custom)
- Struct.internalBinaryWrite(
- message.custom,
- writer.tag(12, WireType.LengthDelimited).fork(),
- options,
- ).join();
- /* repeated string roles = 13; */
- for (let i = 0; i < message.roles.length; i++)
- writer.tag(13, WireType.LengthDelimited).string(message.roles[i]);
- let u = options.writeUnknownFields;
- if (u !== false)
- (u == true ? UnknownFieldHandler.onWrite : u)(
- this.typeName,
- message,
- writer,
- );
- return writer;
- }
}
/**
* @generated MessageType for protobuf message stream.video.sfu.models.Participant
@@ -1316,70 +907,6 @@ class StreamQuality$Type extends MessageType {
{ no: 2, name: 'user_id', kind: 'scalar', T: 9 /*ScalarType.STRING*/ },
]);
}
- create(value?: PartialMessage): StreamQuality {
- const message = globalThis.Object.create(this.messagePrototype!);
- message.videoQuality = 0;
- message.userId = '';
- if (value !== undefined)
- reflectionMergePartial(this, message, value);
- return message;
- }
- internalBinaryRead(
- reader: IBinaryReader,
- length: number,
- options: BinaryReadOptions,
- target?: StreamQuality,
- ): StreamQuality {
- let message = target ?? this.create(),
- end = reader.pos + length;
- while (reader.pos < end) {
- let [fieldNo, wireType] = reader.tag();
- switch (fieldNo) {
- case /* stream.video.sfu.models.VideoQuality video_quality */ 1:
- message.videoQuality = reader.int32();
- break;
- case /* string user_id */ 2:
- message.userId = reader.string();
- break;
- default:
- let u = options.readUnknownField;
- if (u === 'throw')
- throw new globalThis.Error(
- `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`,
- );
- let d = reader.skip(wireType);
- if (u !== false)
- (u === true ? UnknownFieldHandler.onRead : u)(
- this.typeName,
- message,
- fieldNo,
- wireType,
- d,
- );
- }
- }
- return message;
- }
- internalBinaryWrite(
- message: StreamQuality,
- writer: IBinaryWriter,
- options: BinaryWriteOptions,
- ): IBinaryWriter {
- /* stream.video.sfu.models.VideoQuality video_quality = 1; */
- if (message.videoQuality !== 0)
- writer.tag(1, WireType.Varint).int32(message.videoQuality);
- /* string user_id = 2; */
- if (message.userId !== '')
- writer.tag(2, WireType.LengthDelimited).string(message.userId);
- let u = options.writeUnknownFields;
- if (u !== false)
- (u == true ? UnknownFieldHandler.onWrite : u)(
- this.typeName,
- message,
- writer,
- );
- return writer;
- }
}
/**
* @generated MessageType for protobuf message stream.video.sfu.models.StreamQuality
@@ -1393,70 +920,6 @@ class VideoDimension$Type extends MessageType {
{ no: 2, name: 'height', kind: 'scalar', T: 13 /*ScalarType.UINT32*/ },
]);
}
- create(value?: PartialMessage): VideoDimension {
- const message = globalThis.Object.create(this.messagePrototype!);
- message.width = 0;
- message.height = 0;
- if (value !== undefined)
- reflectionMergePartial(this, message, value);
- return message;
- }
- internalBinaryRead(
- reader: IBinaryReader,
- length: number,
- options: BinaryReadOptions,
- target?: VideoDimension,
- ): VideoDimension {
- let message = target ?? this.create(),
- end = reader.pos + length;
- while (reader.pos < end) {
- let [fieldNo, wireType] = reader.tag();
- switch (fieldNo) {
- case /* uint32 width */ 1:
- message.width = reader.uint32();
- break;
- case /* uint32 height */ 2:
- message.height = reader.uint32();
- break;
- default:
- let u = options.readUnknownField;
- if (u === 'throw')
- throw new globalThis.Error(
- `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`,
- );
- let d = reader.skip(wireType);
- if (u !== false)
- (u === true ? UnknownFieldHandler.onRead : u)(
- this.typeName,
- message,
- fieldNo,
- wireType,
- d,
- );
- }
- }
- return message;
- }
- internalBinaryWrite(
- message: VideoDimension,
- writer: IBinaryWriter,
- options: BinaryWriteOptions,
- ): IBinaryWriter {
- /* uint32 width = 1; */
- if (message.width !== 0)
- writer.tag(1, WireType.Varint).uint32(message.width);
- /* uint32 height = 2; */
- if (message.height !== 0)
- writer.tag(2, WireType.Varint).uint32(message.height);
- let u = options.writeUnknownFields;
- if (u !== false)
- (u == true ? UnknownFieldHandler.onWrite : u)(
- this.typeName,
- message,
- writer,
- );
- return writer;
- }
}
/**
* @generated MessageType for protobuf message stream.video.sfu.models.VideoDimension
@@ -1487,98 +950,6 @@ class VideoLayer$Type extends MessageType {
},
]);
}
- create(value?: PartialMessage): VideoLayer {
- const message = globalThis.Object.create(this.messagePrototype!);
- message.rid = '';
- message.bitrate = 0;
- message.fps = 0;
- message.quality = 0;
- if (value !== undefined)
- reflectionMergePartial(this, message, value);
- return message;
- }
- internalBinaryRead(
- reader: IBinaryReader,
- length: number,
- options: BinaryReadOptions,
- target?: VideoLayer,
- ): VideoLayer {
- let message = target ?? this.create(),
- end = reader.pos + length;
- while (reader.pos < end) {
- let [fieldNo, wireType] = reader.tag();
- switch (fieldNo) {
- case /* string rid */ 1:
- message.rid = reader.string();
- break;
- case /* stream.video.sfu.models.VideoDimension video_dimension */ 2:
- message.videoDimension = VideoDimension.internalBinaryRead(
- reader,
- reader.uint32(),
- options,
- message.videoDimension,
- );
- break;
- case /* uint32 bitrate */ 4:
- message.bitrate = reader.uint32();
- break;
- case /* uint32 fps */ 5:
- message.fps = reader.uint32();
- break;
- case /* stream.video.sfu.models.VideoQuality quality */ 6:
- message.quality = reader.int32();
- break;
- default:
- let u = options.readUnknownField;
- if (u === 'throw')
- throw new globalThis.Error(
- `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`,
- );
- let d = reader.skip(wireType);
- if (u !== false)
- (u === true ? UnknownFieldHandler.onRead : u)(
- this.typeName,
- message,
- fieldNo,
- wireType,
- d,
- );
- }
- }
- return message;
- }
- internalBinaryWrite(
- message: VideoLayer,
- writer: IBinaryWriter,
- options: BinaryWriteOptions,
- ): IBinaryWriter {
- /* string rid = 1; */
- if (message.rid !== '')
- writer.tag(1, WireType.LengthDelimited).string(message.rid);
- /* stream.video.sfu.models.VideoDimension video_dimension = 2; */
- if (message.videoDimension)
- VideoDimension.internalBinaryWrite(
- message.videoDimension,
- writer.tag(2, WireType.LengthDelimited).fork(),
- options,
- ).join();
- /* uint32 bitrate = 4; */
- if (message.bitrate !== 0)
- writer.tag(4, WireType.Varint).uint32(message.bitrate);
- /* uint32 fps = 5; */
- if (message.fps !== 0) writer.tag(5, WireType.Varint).uint32(message.fps);
- /* stream.video.sfu.models.VideoQuality quality = 6; */
- if (message.quality !== 0)
- writer.tag(6, WireType.Varint).int32(message.quality);
- let u = options.writeUnknownFields;
- if (u !== false)
- (u == true ? UnknownFieldHandler.onWrite : u)(
- this.typeName,
- message,
- writer,
- );
- return writer;
- }
}
/**
* @generated MessageType for protobuf message stream.video.sfu.models.VideoLayer
@@ -1617,100 +988,6 @@ class Codec$Type extends MessageType {
},
]);
}
- create(value?: PartialMessage): Codec {
- const message = globalThis.Object.create(this.messagePrototype!);
- message.payloadType = 0;
- message.name = '';
- message.fmtpLine = '';
- message.clockRate = 0;
- message.encodingParameters = '';
- message.feedbacks = [];
- if (value !== undefined)
- reflectionMergePartial(this, message, value);
- return message;
- }
- internalBinaryRead(
- reader: IBinaryReader,
- length: number,
- options: BinaryReadOptions,
- target?: Codec,
- ): Codec {
- let message = target ?? this.create(),
- end = reader.pos + length;
- while (reader.pos < end) {
- let [fieldNo, wireType] = reader.tag();
- switch (fieldNo) {
- case /* uint32 payload_type */ 1:
- message.payloadType = reader.uint32();
- break;
- case /* string name */ 2:
- message.name = reader.string();
- break;
- case /* string fmtp_line */ 3:
- message.fmtpLine = reader.string();
- break;
- case /* uint32 clock_rate */ 4:
- message.clockRate = reader.uint32();
- break;
- case /* string encoding_parameters */ 5:
- message.encodingParameters = reader.string();
- break;
- case /* repeated string feedbacks */ 6:
- message.feedbacks.push(reader.string());
- break;
- default:
- let u = options.readUnknownField;
- if (u === 'throw')
- throw new globalThis.Error(
- `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`,
- );
- let d = reader.skip(wireType);
- if (u !== false)
- (u === true ? UnknownFieldHandler.onRead : u)(
- this.typeName,
- message,
- fieldNo,
- wireType,
- d,
- );
- }
- }
- return message;
- }
- internalBinaryWrite(
- message: Codec,
- writer: IBinaryWriter,
- options: BinaryWriteOptions,
- ): IBinaryWriter {
- /* uint32 payload_type = 1; */
- if (message.payloadType !== 0)
- writer.tag(1, WireType.Varint).uint32(message.payloadType);
- /* string name = 2; */
- if (message.name !== '')
- writer.tag(2, WireType.LengthDelimited).string(message.name);
- /* string fmtp_line = 3; */
- if (message.fmtpLine !== '')
- writer.tag(3, WireType.LengthDelimited).string(message.fmtpLine);
- /* uint32 clock_rate = 4; */
- if (message.clockRate !== 0)
- writer.tag(4, WireType.Varint).uint32(message.clockRate);
- /* string encoding_parameters = 5; */
- if (message.encodingParameters !== '')
- writer
- .tag(5, WireType.LengthDelimited)
- .string(message.encodingParameters);
- /* repeated string feedbacks = 6; */
- for (let i = 0; i < message.feedbacks.length; i++)
- writer.tag(6, WireType.LengthDelimited).string(message.feedbacks[i]);
- let u = options.writeUnknownFields;
- if (u !== false)
- (u == true ? UnknownFieldHandler.onWrite : u)(
- this.typeName,
- message,
- writer,
- );
- return writer;
- }
}
/**
* @generated MessageType for protobuf message stream.video.sfu.models.Codec
@@ -1735,77 +1012,6 @@ class ICETrickle$Type extends MessageType {
{ no: 3, name: 'session_id', kind: 'scalar', T: 9 /*ScalarType.STRING*/ },
]);
}
- create(value?: PartialMessage): ICETrickle {
- const message = globalThis.Object.create(this.messagePrototype!);
- message.peerType = 0;
- message.iceCandidate = '';
- message.sessionId = '';
- if (value !== undefined)
- reflectionMergePartial(this, message, value);
- return message;
- }
- internalBinaryRead(
- reader: IBinaryReader,
- length: number,
- options: BinaryReadOptions,
- target?: ICETrickle,
- ): ICETrickle {
- let message = target ?? this.create(),
- end = reader.pos + length;
- while (reader.pos < end) {
- let [fieldNo, wireType] = reader.tag();
- switch (fieldNo) {
- case /* stream.video.sfu.models.PeerType peer_type */ 1:
- message.peerType = reader.int32();
- break;
- case /* string ice_candidate */ 2:
- message.iceCandidate = reader.string();
- break;
- case /* string session_id */ 3:
- message.sessionId = reader.string();
- break;
- default:
- let u = options.readUnknownField;
- if (u === 'throw')
- throw new globalThis.Error(
- `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`,
- );
- let d = reader.skip(wireType);
- if (u !== false)
- (u === true ? UnknownFieldHandler.onRead : u)(
- this.typeName,
- message,
- fieldNo,
- wireType,
- d,
- );
- }
- }
- return message;
- }
- internalBinaryWrite(
- message: ICETrickle,
- writer: IBinaryWriter,
- options: BinaryWriteOptions,
- ): IBinaryWriter {
- /* stream.video.sfu.models.PeerType peer_type = 1; */
- if (message.peerType !== 0)
- writer.tag(1, WireType.Varint).int32(message.peerType);
- /* string ice_candidate = 2; */
- if (message.iceCandidate !== '')
- writer.tag(2, WireType.LengthDelimited).string(message.iceCandidate);
- /* string session_id = 3; */
- if (message.sessionId !== '')
- writer.tag(3, WireType.LengthDelimited).string(message.sessionId);
- let u = options.writeUnknownFields;
- if (u !== false)
- (u == true ? UnknownFieldHandler.onWrite : u)(
- this.typeName,
- message,
- writer,
- );
- return writer;
- }
}
/**
* @generated MessageType for protobuf message stream.video.sfu.models.ICETrickle
@@ -1840,116 +1046,6 @@ class TrackInfo$Type extends MessageType {
{ no: 10, name: 'muted', kind: 'scalar', T: 8 /*ScalarType.BOOL*/ },
]);
}
- create(value?: PartialMessage): TrackInfo {
- const message = globalThis.Object.create(this.messagePrototype!);
- message.trackId = '';
- message.trackType = 0;
- message.layers = [];
- message.mid = '';
- message.dtx = false;
- message.stereo = false;
- message.red = false;
- message.muted = false;
- if (value !== undefined)
- reflectionMergePartial(this, message, value);
- return message;
- }
- internalBinaryRead(
- reader: IBinaryReader,
- length: number,
- options: BinaryReadOptions,
- target?: TrackInfo,
- ): TrackInfo {
- let message = target ?? this.create(),
- end = reader.pos + length;
- while (reader.pos < end) {
- let [fieldNo, wireType] = reader.tag();
- switch (fieldNo) {
- case /* string track_id */ 1:
- message.trackId = reader.string();
- break;
- case /* stream.video.sfu.models.TrackType track_type */ 2:
- message.trackType = reader.int32();
- break;
- case /* repeated stream.video.sfu.models.VideoLayer layers */ 5:
- message.layers.push(
- VideoLayer.internalBinaryRead(reader, reader.uint32(), options),
- );
- break;
- case /* string mid */ 6:
- message.mid = reader.string();
- break;
- case /* bool dtx */ 7:
- message.dtx = reader.bool();
- break;
- case /* bool stereo */ 8:
- message.stereo = reader.bool();
- break;
- case /* bool red */ 9:
- message.red = reader.bool();
- break;
- case /* bool muted */ 10:
- message.muted = reader.bool();
- break;
- default:
- let u = options.readUnknownField;
- if (u === 'throw')
- throw new globalThis.Error(
- `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`,
- );
- let d = reader.skip(wireType);
- if (u !== false)
- (u === true ? UnknownFieldHandler.onRead : u)(
- this.typeName,
- message,
- fieldNo,
- wireType,
- d,
- );
- }
- }
- return message;
- }
- internalBinaryWrite(
- message: TrackInfo,
- writer: IBinaryWriter,
- options: BinaryWriteOptions,
- ): IBinaryWriter {
- /* string track_id = 1; */
- if (message.trackId !== '')
- writer.tag(1, WireType.LengthDelimited).string(message.trackId);
- /* stream.video.sfu.models.TrackType track_type = 2; */
- if (message.trackType !== 0)
- writer.tag(2, WireType.Varint).int32(message.trackType);
- /* repeated stream.video.sfu.models.VideoLayer layers = 5; */
- for (let i = 0; i < message.layers.length; i++)
- VideoLayer.internalBinaryWrite(
- message.layers[i],
- writer.tag(5, WireType.LengthDelimited).fork(),
- options,
- ).join();
- /* string mid = 6; */
- if (message.mid !== '')
- writer.tag(6, WireType.LengthDelimited).string(message.mid);
- /* bool dtx = 7; */
- if (message.dtx !== false) writer.tag(7, WireType.Varint).bool(message.dtx);
- /* bool stereo = 8; */
- if (message.stereo !== false)
- writer.tag(8, WireType.Varint).bool(message.stereo);
- /* bool red = 9; */
- if (message.red !== false) writer.tag(9, WireType.Varint).bool(message.red);
- /* bool muted = 10; */
- if (message.muted !== false)
- writer.tag(10, WireType.Varint).bool(message.muted);
- let u = options.writeUnknownFields;
- if (u !== false)
- (u == true ? UnknownFieldHandler.onWrite : u)(
- this.typeName,
- message,
- writer,
- );
- return writer;
- }
}
/**
* @generated MessageType for protobuf message stream.video.sfu.models.TrackInfo
@@ -1973,76 +1069,6 @@ class Error$Type extends MessageType {
{ no: 3, name: 'should_retry', kind: 'scalar', T: 8 /*ScalarType.BOOL*/ },
]);
}
- create(value?: PartialMessage): Error {
- const message = globalThis.Object.create(this.messagePrototype!);
- message.code = 0;
- message.message = '';
- message.shouldRetry = false;
- if (value !== undefined)
- reflectionMergePartial(this, message, value);
- return message;
- }
- internalBinaryRead(
- reader: IBinaryReader,
- length: number,
- options: BinaryReadOptions,
- target?: Error,
- ): Error {
- let message = target ?? this.create(),
- end = reader.pos + length;
- while (reader.pos < end) {
- let [fieldNo, wireType] = reader.tag();
- switch (fieldNo) {
- case /* stream.video.sfu.models.ErrorCode code */ 1:
- message.code = reader.int32();
- break;
- case /* string message */ 2:
- message.message = reader.string();
- break;
- case /* bool should_retry */ 3:
- message.shouldRetry = reader.bool();
- break;
- default:
- let u = options.readUnknownField;
- if (u === 'throw')
- throw new globalThis.Error(
- `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`,
- );
- let d = reader.skip(wireType);
- if (u !== false)
- (u === true ? UnknownFieldHandler.onRead : u)(
- this.typeName,
- message,
- fieldNo,
- wireType,
- d,
- );
- }
- }
- return message;
- }
- internalBinaryWrite(
- message: Error,
- writer: IBinaryWriter,
- options: BinaryWriteOptions,
- ): IBinaryWriter {
- /* stream.video.sfu.models.ErrorCode code = 1; */
- if (message.code !== 0) writer.tag(1, WireType.Varint).int32(message.code);
- /* string message = 2; */
- if (message.message !== '')
- writer.tag(2, WireType.LengthDelimited).string(message.message);
- /* bool should_retry = 3; */
- if (message.shouldRetry !== false)
- writer.tag(3, WireType.Varint).bool(message.shouldRetry);
- let u = options.writeUnknownFields;
- if (u !== false)
- (u == true ? UnknownFieldHandler.onWrite : u)(
- this.typeName,
- message,
- writer,
- );
- return writer;
- }
}
/**
* @generated MessageType for protobuf message stream.video.sfu.models.Error
@@ -2058,116 +1084,6 @@ class ClientDetails$Type extends MessageType {
{ no: 4, name: 'device', kind: 'message', T: () => Device },
]);
}
- create(value?: PartialMessage): ClientDetails {
- const message = globalThis.Object.create(this.messagePrototype!);
- if (value !== undefined)
- reflectionMergePartial(this, message, value);
- return message;
- }
- internalBinaryRead(
- reader: IBinaryReader,
- length: number,
- options: BinaryReadOptions,
- target?: ClientDetails,
- ): ClientDetails {
- let message = target ?? this.create(),
- end = reader.pos + length;
- while (reader.pos < end) {
- let [fieldNo, wireType] = reader.tag();
- switch (fieldNo) {
- case /* stream.video.sfu.models.Sdk sdk */ 1:
- message.sdk = Sdk.internalBinaryRead(
- reader,
- reader.uint32(),
- options,
- message.sdk,
- );
- break;
- case /* stream.video.sfu.models.OS os */ 2:
- message.os = OS.internalBinaryRead(
- reader,
- reader.uint32(),
- options,
- message.os,
- );
- break;
- case /* stream.video.sfu.models.Browser browser */ 3:
- message.browser = Browser.internalBinaryRead(
- reader,
- reader.uint32(),
- options,
- message.browser,
- );
- break;
- case /* stream.video.sfu.models.Device device */ 4:
- message.device = Device.internalBinaryRead(
- reader,
- reader.uint32(),
- options,
- message.device,
- );
- break;
- default:
- let u = options.readUnknownField;
- if (u === 'throw')
- throw new globalThis.Error(
- `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`,
- );
- let d = reader.skip(wireType);
- if (u !== false)
- (u === true ? UnknownFieldHandler.onRead : u)(
- this.typeName,
- message,
- fieldNo,
- wireType,
- d,
- );
- }
- }
- return message;
- }
- internalBinaryWrite(
- message: ClientDetails,
- writer: IBinaryWriter,
- options: BinaryWriteOptions,
- ): IBinaryWriter {
- /* stream.video.sfu.models.Sdk sdk = 1; */
- if (message.sdk)
- Sdk.internalBinaryWrite(
- message.sdk,
- writer.tag(1, WireType.LengthDelimited).fork(),
- options,
- ).join();
- /* stream.video.sfu.models.OS os = 2; */
- if (message.os)
- OS.internalBinaryWrite(
- message.os,
- writer.tag(2, WireType.LengthDelimited).fork(),
- options,
- ).join();
- /* stream.video.sfu.models.Browser browser = 3; */
- if (message.browser)
- Browser.internalBinaryWrite(
- message.browser,
- writer.tag(3, WireType.LengthDelimited).fork(),
- options,
- ).join();
- /* stream.video.sfu.models.Device device = 4; */
- if (message.device)
- Device.internalBinaryWrite(
- message.device,
- writer.tag(4, WireType.LengthDelimited).fork(),
- options,
- ).join();
- let u = options.writeUnknownFields;
- if (u !== false)
- (u == true ? UnknownFieldHandler.onWrite : u)(
- this.typeName,
- message,
- writer,
- );
- return writer;
- }
}
/**
* @generated MessageType for protobuf message stream.video.sfu.models.ClientDetails
@@ -2188,82 +1104,6 @@ class Sdk$Type extends MessageType {
{ no: 4, name: 'patch', kind: 'scalar', T: 9 /*ScalarType.STRING*/ },
]);
}
- create(value?: PartialMessage): Sdk {
- const message = globalThis.Object.create(this.messagePrototype!);
- message.type = 0;
- message.major = '';
- message.minor = '';
- message.patch = '';
- if (value !== undefined) reflectionMergePartial(this, message, value);
- return message;
- }
- internalBinaryRead(
- reader: IBinaryReader,
- length: number,
- options: BinaryReadOptions,
- target?: Sdk,
- ): Sdk {
- let message = target ?? this.create(),
- end = reader.pos + length;
- while (reader.pos < end) {
- let [fieldNo, wireType] = reader.tag();
- switch (fieldNo) {
- case /* stream.video.sfu.models.SdkType type */ 1:
- message.type = reader.int32();
- break;
- case /* string major */ 2:
- message.major = reader.string();
- break;
- case /* string minor */ 3:
- message.minor = reader.string();
- break;
- case /* string patch */ 4:
- message.patch = reader.string();
- break;
- default:
- let u = options.readUnknownField;
- if (u === 'throw')
- throw new globalThis.Error(
- `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`,
- );
- let d = reader.skip(wireType);
- if (u !== false)
- (u === true ? UnknownFieldHandler.onRead : u)(
- this.typeName,
- message,
- fieldNo,
- wireType,
- d,
- );
- }
- }
- return message;
- }
- internalBinaryWrite(
- message: Sdk,
- writer: IBinaryWriter,
- options: BinaryWriteOptions,
- ): IBinaryWriter {
- /* stream.video.sfu.models.SdkType type = 1; */
- if (message.type !== 0) writer.tag(1, WireType.Varint).int32(message.type);
- /* string major = 2; */
- if (message.major !== '')
- writer.tag(2, WireType.LengthDelimited).string(message.major);
- /* string minor = 3; */
- if (message.minor !== '')
- writer.tag(3, WireType.LengthDelimited).string(message.minor);
- /* string patch = 4; */
- if (message.patch !== '')
- writer.tag(4, WireType.LengthDelimited).string(message.patch);
- let u = options.writeUnknownFields;
- if (u !== false)
- (u == true ? UnknownFieldHandler.onWrite : u)(
- this.typeName,
- message,
- writer,
- );
- return writer;
- }
}
/**
* @generated MessageType for protobuf message stream.video.sfu.models.Sdk
@@ -2283,76 +1123,6 @@ class OS$Type extends MessageType {
},
]);
}
- create(value?: PartialMessage): OS {
- const message = globalThis.Object.create(this.messagePrototype!);
- message.name = '';
- message.version = '';
- message.architecture = '';
- if (value !== undefined) reflectionMergePartial(this, message, value);
- return message;
- }
- internalBinaryRead(
- reader: IBinaryReader,
- length: number,
- options: BinaryReadOptions,
- target?: OS,
- ): OS {
- let message = target ?? this.create(),
- end = reader.pos + length;
- while (reader.pos < end) {
- let [fieldNo, wireType] = reader.tag();
- switch (fieldNo) {
- case /* string name */ 1:
- message.name = reader.string();
- break;
- case /* string version */ 2:
- message.version = reader.string();
- break;
- case /* string architecture */ 3:
- message.architecture = reader.string();
- break;
- default:
- let u = options.readUnknownField;
- if (u === 'throw')
- throw new globalThis.Error(
- `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`,
- );
- let d = reader.skip(wireType);
- if (u !== false)
- (u === true ? UnknownFieldHandler.onRead : u)(
- this.typeName,
- message,
- fieldNo,
- wireType,
- d,
- );
- }
- }
- return message;
- }
- internalBinaryWrite(
- message: OS,
- writer: IBinaryWriter,
- options: BinaryWriteOptions,
- ): IBinaryWriter {
- /* string name = 1; */
- if (message.name !== '')
- writer.tag(1, WireType.LengthDelimited).string(message.name);
- /* string version = 2; */
- if (message.version !== '')
- writer.tag(2, WireType.LengthDelimited).string(message.version);
- /* string architecture = 3; */
- if (message.architecture !== '')
- writer.tag(3, WireType.LengthDelimited).string(message.architecture);
- let u = options.writeUnknownFields;
- if (u !== false)
- (u == true ? UnknownFieldHandler.onWrite : u)(
- this.typeName,
- message,
- writer,
- );
- return writer;
- }
}
/**
* @generated MessageType for protobuf message stream.video.sfu.models.OS
@@ -2366,70 +1136,6 @@ class Browser$Type extends MessageType {
{ no: 2, name: 'version', kind: 'scalar', T: 9 /*ScalarType.STRING*/ },
]);
}
- create(value?: PartialMessage): Browser {
- const message = globalThis.Object.create(this.messagePrototype!);
- message.name = '';
- message.version = '';
- if (value !== undefined)
- reflectionMergePartial(this, message, value);
- return message;
- }
- internalBinaryRead(
- reader: IBinaryReader,
- length: number,
- options: BinaryReadOptions,
- target?: Browser,
- ): Browser {
- let message = target ?? this.create(),
- end = reader.pos + length;
- while (reader.pos < end) {
- let [fieldNo, wireType] = reader.tag();
- switch (fieldNo) {
- case /* string name */ 1:
- message.name = reader.string();
- break;
- case /* string version */ 2:
- message.version = reader.string();
- break;
- default:
- let u = options.readUnknownField;
- if (u === 'throw')
- throw new globalThis.Error(
- `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`,
- );
- let d = reader.skip(wireType);
- if (u !== false)
- (u === true ? UnknownFieldHandler.onRead : u)(
- this.typeName,
- message,
- fieldNo,
- wireType,
- d,
- );
- }
- }
- return message;
- }
- internalBinaryWrite(
- message: Browser,
- writer: IBinaryWriter,
- options: BinaryWriteOptions,
- ): IBinaryWriter {
- /* string name = 1; */
- if (message.name !== '')
- writer.tag(1, WireType.LengthDelimited).string(message.name);
- /* string version = 2; */
- if (message.version !== '')
- writer.tag(2, WireType.LengthDelimited).string(message.version);
- let u = options.writeUnknownFields;
- if (u !== false)
- (u == true ? UnknownFieldHandler.onWrite : u)(
- this.typeName,
- message,
- writer,
- );
- return writer;
- }
}
/**
* @generated MessageType for protobuf message stream.video.sfu.models.Browser
@@ -2443,70 +1149,6 @@ class Device$Type extends MessageType {
{ no: 2, name: 'version', kind: 'scalar', T: 9 /*ScalarType.STRING*/ },
]);
}
- create(value?: PartialMessage): Device {
- const message = globalThis.Object.create(this.messagePrototype!);
- message.name = '';
- message.version = '';
- if (value !== undefined)
- reflectionMergePartial(this, message, value);
- return message;
- }
- internalBinaryRead(
- reader: IBinaryReader,
- length: number,
- options: BinaryReadOptions,
- target?: Device,
- ): Device {
- let message = target ?? this.create(),
- end = reader.pos + length;
- while (reader.pos < end) {
- let [fieldNo, wireType] = reader.tag();
- switch (fieldNo) {
- case /* string name */ 1:
- message.name = reader.string();
- break;
- case /* string version */ 2:
- message.version = reader.string();
- break;
- default:
- let u = options.readUnknownField;
- if (u === 'throw')
- throw new globalThis.Error(
- `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`,
- );
- let d = reader.skip(wireType);
- if (u !== false)
- (u === true ? UnknownFieldHandler.onRead : u)(
- this.typeName,
- message,
- fieldNo,
- wireType,
- d,
- );
- }
- }
- return message;
- }
- internalBinaryWrite(
- message: Device,
- writer: IBinaryWriter,
- options: BinaryWriteOptions,
- ): IBinaryWriter {
- /* string name = 1; */
- if (message.name !== '')
- writer.tag(1, WireType.LengthDelimited).string(message.name);
- /* string version = 2; */
- if (message.version !== '')
- writer.tag(2, WireType.LengthDelimited).string(message.version);
- let u = options.writeUnknownFields;
- if (u !== false)
- (u == true ? UnknownFieldHandler.onWrite : u)(
- this.typeName,
- message,
- writer,
- );
- return writer;
- }
}
/**
* @generated MessageType for protobuf message stream.video.sfu.models.Device
@@ -2535,128 +1177,6 @@ class Call$Type extends MessageType {
{ no: 7, name: 'updated_at', kind: 'message', T: () => Timestamp },
]);
}
- create(value?: PartialMessage): Call {
- const message = globalThis.Object.create(this.messagePrototype!);
- message.type = '';
- message.id = '';
- message.createdByUserId = '';
- message.hostUserId = '';
- if (value !== undefined) reflectionMergePartial(this, message, value);
- return message;
- }
- internalBinaryRead(
- reader: IBinaryReader,
- length: number,
- options: BinaryReadOptions,
- target?: Call,
- ): Call {
- let message = target ?? this.create(),
- end = reader.pos + length;
- while (reader.pos < end) {
- let [fieldNo, wireType] = reader.tag();
- switch (fieldNo) {
- case /* string type */ 1:
- message.type = reader.string();
- break;
- case /* string id */ 2:
- message.id = reader.string();
- break;
- case /* string created_by_user_id */ 3:
- message.createdByUserId = reader.string();
- break;
- case /* string host_user_id */ 4:
- message.hostUserId = reader.string();
- break;
- case /* google.protobuf.Struct custom */ 5:
- message.custom = Struct.internalBinaryRead(
- reader,
- reader.uint32(),
- options,
- message.custom,
- );
- break;
- case /* google.protobuf.Timestamp created_at */ 6:
- message.createdAt = Timestamp.internalBinaryRead(
- reader,
- reader.uint32(),
- options,
- message.createdAt,
- );
- break;
- case /* google.protobuf.Timestamp updated_at */ 7:
- message.updatedAt = Timestamp.internalBinaryRead(
- reader,
- reader.uint32(),
- options,
- message.updatedAt,
- );
- break;
- default:
- let u = options.readUnknownField;
- if (u === 'throw')
- throw new globalThis.Error(
- `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`,
- );
- let d = reader.skip(wireType);
- if (u !== false)
- (u === true ? UnknownFieldHandler.onRead : u)(
- this.typeName,
- message,
- fieldNo,
- wireType,
- d,
- );
- }
- }
- return message;
- }
- internalBinaryWrite(
- message: Call,
- writer: IBinaryWriter,
- options: BinaryWriteOptions,
- ): IBinaryWriter {
- /* string type = 1; */
- if (message.type !== '')
- writer.tag(1, WireType.LengthDelimited).string(message.type);
- /* string id = 2; */
- if (message.id !== '')
- writer.tag(2, WireType.LengthDelimited).string(message.id);
- /* string created_by_user_id = 3; */
- if (message.createdByUserId !== '')
- writer.tag(3, WireType.LengthDelimited).string(message.createdByUserId);
- /* string host_user_id = 4; */
- if (message.hostUserId !== '')
- writer.tag(4, WireType.LengthDelimited).string(message.hostUserId);
- /* google.protobuf.Struct custom = 5; */
- if (message.custom)
- Struct.internalBinaryWrite(
- message.custom,
- writer.tag(5, WireType.LengthDelimited).fork(),
- options,
- ).join();
- /* google.protobuf.Timestamp created_at = 6; */
- if (message.createdAt)
- Timestamp.internalBinaryWrite(
- message.createdAt,
- writer.tag(6, WireType.LengthDelimited).fork(),
- options,
- ).join();
- /* google.protobuf.Timestamp updated_at = 7; */
- if (message.updatedAt)
- Timestamp.internalBinaryWrite(
- message.updatedAt,
- writer.tag(7, WireType.LengthDelimited).fork(),
- options,
- ).join();
- let u = options.writeUnknownFields;
- if (u !== false)
- (u == true ? UnknownFieldHandler.onWrite : u)(
- this.typeName,
- message,
- writer,
- );
- return writer;
- }
}
/**
* @generated MessageType for protobuf message stream.video.sfu.models.Call
@@ -2686,77 +1206,6 @@ class CallGrants$Type extends MessageType {
},
]);
}
- create(value?: PartialMessage): CallGrants {
- const message = globalThis.Object.create(this.messagePrototype!);
- message.canPublishAudio = false;
- message.canPublishVideo = false;
- message.canScreenshare = false;
- if (value !== undefined)
- reflectionMergePartial(this, message, value);
- return message;
- }
- internalBinaryRead(
- reader: IBinaryReader,
- length: number,
- options: BinaryReadOptions,
- target?: CallGrants,
- ): CallGrants {
- let message = target ?? this.create(),
- end = reader.pos + length;
- while (reader.pos < end) {
- let [fieldNo, wireType] = reader.tag();
- switch (fieldNo) {
- case /* bool can_publish_audio */ 1:
- message.canPublishAudio = reader.bool();
- break;
- case /* bool can_publish_video */ 2:
- message.canPublishVideo = reader.bool();
- break;
- case /* bool can_screenshare */ 3:
- message.canScreenshare = reader.bool();
- break;
- default:
- let u = options.readUnknownField;
- if (u === 'throw')
- throw new globalThis.Error(
- `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`,
- );
- let d = reader.skip(wireType);
- if (u !== false)
- (u === true ? UnknownFieldHandler.onRead : u)(
- this.typeName,
- message,
- fieldNo,
- wireType,
- d,
- );
- }
- }
- return message;
- }
- internalBinaryWrite(
- message: CallGrants,
- writer: IBinaryWriter,
- options: BinaryWriteOptions,
- ): IBinaryWriter {
- /* bool can_publish_audio = 1; */
- if (message.canPublishAudio !== false)
- writer.tag(1, WireType.Varint).bool(message.canPublishAudio);
- /* bool can_publish_video = 2; */
- if (message.canPublishVideo !== false)
- writer.tag(2, WireType.Varint).bool(message.canPublishVideo);
- /* bool can_screenshare = 3; */
- if (message.canScreenshare !== false)
- writer.tag(3, WireType.Varint).bool(message.canScreenshare);
- let u = options.writeUnknownFields;
- if (u !== false)
- (u == true ? UnknownFieldHandler.onWrite : u)(
- this.typeName,
- message,
- writer,
- );
- return writer;
- }
}
/**
* @generated MessageType for protobuf message stream.video.sfu.models.CallGrants
diff --git a/packages/client/src/gen/video/sfu/signal_rpc/signal.client.ts b/packages/client/src/gen/video/sfu/signal_rpc/signal.client.ts
index 005b2f94c9..501fadf4c6 100644
--- a/packages/client/src/gen/video/sfu/signal_rpc/signal.client.ts
+++ b/packages/client/src/gen/video/sfu/signal_rpc/signal.client.ts
@@ -1,5 +1,5 @@
/* eslint-disable */
-// @generated by protobuf-ts 2.9.4 with parameter long_type_string,client_generic,server_none,eslint_disable
+// @generated by protobuf-ts 2.9.4 with parameter long_type_string,client_generic,server_none,eslint_disable,optimize_code_size
// @generated from protobuf file "video/sfu/signal_rpc/signal.proto" (package "stream.video.sfu.signal", syntax proto3)
// tslint:disable
import type {
diff --git a/packages/client/src/gen/video/sfu/signal_rpc/signal.ts b/packages/client/src/gen/video/sfu/signal_rpc/signal.ts
index 6c4a225f79..5c726a2396 100644
--- a/packages/client/src/gen/video/sfu/signal_rpc/signal.ts
+++ b/packages/client/src/gen/video/sfu/signal_rpc/signal.ts
@@ -1,5 +1,5 @@
/* eslint-disable */
-// @generated by protobuf-ts 2.9.4 with parameter long_type_string,client_generic,server_none,eslint_disable
+// @generated by protobuf-ts 2.9.4 with parameter long_type_string,client_generic,server_none,eslint_disable,optimize_code_size
// @generated from protobuf file "video/sfu/signal_rpc/signal.proto" (package "stream.video.sfu.signal", syntax proto3)
// tslint:disable
import {
@@ -11,19 +11,7 @@ import {
VideoDimension,
} from '../models/models';
import { ServiceType } from '@protobuf-ts/runtime-rpc';
-import type {
- BinaryReadOptions,
- BinaryWriteOptions,
- IBinaryReader,
- IBinaryWriter,
- PartialMessage,
-} from '@protobuf-ts/runtime';
-import {
- MessageType,
- reflectionMergePartial,
- UnknownFieldHandler,
- WireType,
-} from '@protobuf-ts/runtime';
+import { MessageType } from '@protobuf-ts/runtime';
/**
* @generated from protobuf message stream.video.sfu.signal.StartNoiseCancellationRequest
@@ -301,69 +289,6 @@ class StartNoiseCancellationRequest$Type extends MessageType,
- ): StartNoiseCancellationRequest {
- const message = globalThis.Object.create(this.messagePrototype!);
- message.sessionId = '';
- if (value !== undefined)
- reflectionMergePartial(
- this,
- message,
- value,
- );
- return message;
- }
- internalBinaryRead(
- reader: IBinaryReader,
- length: number,
- options: BinaryReadOptions,
- target?: StartNoiseCancellationRequest,
- ): StartNoiseCancellationRequest {
- let message = target ?? this.create(),
- end = reader.pos + length;
- while (reader.pos < end) {
- let [fieldNo, wireType] = reader.tag();
- switch (fieldNo) {
- case /* string session_id */ 1:
- message.sessionId = reader.string();
- break;
- default:
- let u = options.readUnknownField;
- if (u === 'throw')
- throw new globalThis.Error(
- `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`,
- );
- let d = reader.skip(wireType);
- if (u !== false)
- (u === true ? UnknownFieldHandler.onRead : u)(
- this.typeName,
- message,
- fieldNo,
- wireType,
- d,
- );
- }
- }
- return message;
- }
- internalBinaryWrite(
- message: StartNoiseCancellationRequest,
- writer: IBinaryWriter,
- options: BinaryWriteOptions,
- ): IBinaryWriter {
- /* string session_id = 1; */
- if (message.sessionId !== '')
- writer.tag(1, WireType.LengthDelimited).string(message.sessionId);
- let u = options.writeUnknownFields;
- if (u !== false)
- (u == true ? UnknownFieldHandler.onWrite : u)(
- this.typeName,
- message,
- writer,
- );
- return writer;
- }
}
/**
* @generated MessageType for protobuf message stream.video.sfu.signal.StartNoiseCancellationRequest
@@ -377,77 +302,6 @@ class StartNoiseCancellationResponse$Type extends MessageType Error },
]);
}
- create(
- value?: PartialMessage,
- ): StartNoiseCancellationResponse {
- const message = globalThis.Object.create(this.messagePrototype!);
- if (value !== undefined)
- reflectionMergePartial(
- this,
- message,
- value,
- );
- return message;
- }
- internalBinaryRead(
- reader: IBinaryReader,
- length: number,
- options: BinaryReadOptions,
- target?: StartNoiseCancellationResponse,
- ): StartNoiseCancellationResponse {
- let message = target ?? this.create(),
- end = reader.pos + length;
- while (reader.pos < end) {
- let [fieldNo, wireType] = reader.tag();
- switch (fieldNo) {
- case /* stream.video.sfu.models.Error error */ 1:
- message.error = Error.internalBinaryRead(
- reader,
- reader.uint32(),
- options,
- message.error,
- );
- break;
- default:
- let u = options.readUnknownField;
- if (u === 'throw')
- throw new globalThis.Error(
- `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`,
- );
- let d = reader.skip(wireType);
- if (u !== false)
- (u === true ? UnknownFieldHandler.onRead : u)(
- this.typeName,
- message,
- fieldNo,
- wireType,
- d,
- );
- }
- }
- return message;
- }
- internalBinaryWrite(
- message: StartNoiseCancellationResponse,
- writer: IBinaryWriter,
- options: BinaryWriteOptions,
- ): IBinaryWriter {
- /* stream.video.sfu.models.Error error = 1; */
- if (message.error)
- Error.internalBinaryWrite(
- message.error,
- writer.tag(1, WireType.LengthDelimited).fork(),
- options,
- ).join();
- let u = options.writeUnknownFields;
- if (u !== false)
- (u == true ? UnknownFieldHandler.onWrite : u)(
- this.typeName,
- message,
- writer,
- );
- return writer;
- }
}
/**
* @generated MessageType for protobuf message stream.video.sfu.signal.StartNoiseCancellationResponse
@@ -461,69 +315,6 @@ class StopNoiseCancellationRequest$Type extends MessageType,
- ): StopNoiseCancellationRequest {
- const message = globalThis.Object.create(this.messagePrototype!);
- message.sessionId = '';
- if (value !== undefined)
- reflectionMergePartial(
- this,
- message,
- value,
- );
- return message;
- }
- internalBinaryRead(
- reader: IBinaryReader,
- length: number,
- options: BinaryReadOptions,
- target?: StopNoiseCancellationRequest,
- ): StopNoiseCancellationRequest {
- let message = target ?? this.create(),
- end = reader.pos + length;
- while (reader.pos < end) {
- let [fieldNo, wireType] = reader.tag();
- switch (fieldNo) {
- case /* string session_id */ 1:
- message.sessionId = reader.string();
- break;
- default:
- let u = options.readUnknownField;
- if (u === 'throw')
- throw new globalThis.Error(
- `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`,
- );
- let d = reader.skip(wireType);
- if (u !== false)
- (u === true ? UnknownFieldHandler.onRead : u)(
- this.typeName,
- message,
- fieldNo,
- wireType,
- d,
- );
- }
- }
- return message;
- }
- internalBinaryWrite(
- message: StopNoiseCancellationRequest,
- writer: IBinaryWriter,
- options: BinaryWriteOptions,
- ): IBinaryWriter {
- /* string session_id = 1; */
- if (message.sessionId !== '')
- writer.tag(1, WireType.LengthDelimited).string(message.sessionId);
- let u = options.writeUnknownFields;
- if (u !== false)
- (u == true ? UnknownFieldHandler.onWrite : u)(
- this.typeName,
- message,
- writer,
- );
- return writer;
- }
}
/**
* @generated MessageType for protobuf message stream.video.sfu.signal.StopNoiseCancellationRequest
@@ -537,77 +328,6 @@ class StopNoiseCancellationResponse$Type extends MessageType Error },
]);
}
- create(
- value?: PartialMessage,
- ): StopNoiseCancellationResponse {
- const message = globalThis.Object.create(this.messagePrototype!);
- if (value !== undefined)
- reflectionMergePartial(
- this,
- message,
- value,
- );
- return message;
- }
- internalBinaryRead(
- reader: IBinaryReader,
- length: number,
- options: BinaryReadOptions,
- target?: StopNoiseCancellationResponse,
- ): StopNoiseCancellationResponse {
- let message = target ?? this.create(),
- end = reader.pos + length;
- while (reader.pos < end) {
- let [fieldNo, wireType] = reader.tag();
- switch (fieldNo) {
- case /* stream.video.sfu.models.Error error */ 1:
- message.error = Error.internalBinaryRead(
- reader,
- reader.uint32(),
- options,
- message.error,
- );
- break;
- default:
- let u = options.readUnknownField;
- if (u === 'throw')
- throw new globalThis.Error(
- `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`,
- );
- let d = reader.skip(wireType);
- if (u !== false)
- (u === true ? UnknownFieldHandler.onRead : u)(
- this.typeName,
- message,
- fieldNo,
- wireType,
- d,
- );
- }
- }
- return message;
- }
- internalBinaryWrite(
- message: StopNoiseCancellationResponse,
- writer: IBinaryWriter,
- options: BinaryWriteOptions,
- ): IBinaryWriter {
- /* stream.video.sfu.models.Error error = 1; */
- if (message.error)
- Error.internalBinaryWrite(
- message.error,
- writer.tag(1, WireType.LengthDelimited).fork(),
- options,
- ).join();
- let u = options.writeUnknownFields;
- if (u !== false)
- (u == true ? UnknownFieldHandler.onWrite : u)(
- this.typeName,
- message,
- writer,
- );
- return writer;
- }
}
/**
* @generated MessageType for protobuf message stream.video.sfu.signal.StopNoiseCancellationResponse
@@ -646,98 +366,6 @@ class SendStatsRequest$Type extends MessageType {
},
]);
}
- create(value?: PartialMessage): SendStatsRequest {
- const message = globalThis.Object.create(this.messagePrototype!);
- message.sessionId = '';
- message.subscriberStats = '';
- message.publisherStats = '';
- message.webrtcVersion = '';
- message.sdk = '';
- message.sdkVersion = '';
- if (value !== undefined)
- reflectionMergePartial(this, message, value);
- return message;
- }
- internalBinaryRead(
- reader: IBinaryReader,
- length: number,
- options: BinaryReadOptions,
- target?: SendStatsRequest,
- ): SendStatsRequest {
- let message = target ?? this.create(),
- end = reader.pos + length;
- while (reader.pos < end) {
- let [fieldNo, wireType] = reader.tag();
- switch (fieldNo) {
- case /* string session_id */ 1:
- message.sessionId = reader.string();
- break;
- case /* string subscriber_stats */ 2:
- message.subscriberStats = reader.string();
- break;
- case /* string publisher_stats */ 3:
- message.publisherStats = reader.string();
- break;
- case /* string webrtc_version */ 4:
- message.webrtcVersion = reader.string();
- break;
- case /* string sdk */ 5:
- message.sdk = reader.string();
- break;
- case /* string sdk_version */ 6:
- message.sdkVersion = reader.string();
- break;
- default:
- let u = options.readUnknownField;
- if (u === 'throw')
- throw new globalThis.Error(
- `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`,
- );
- let d = reader.skip(wireType);
- if (u !== false)
- (u === true ? UnknownFieldHandler.onRead : u)(
- this.typeName,
- message,
- fieldNo,
- wireType,
- d,
- );
- }
- }
- return message;
- }
- internalBinaryWrite(
- message: SendStatsRequest,
- writer: IBinaryWriter,
- options: BinaryWriteOptions,
- ): IBinaryWriter {
- /* string session_id = 1; */
- if (message.sessionId !== '')
- writer.tag(1, WireType.LengthDelimited).string(message.sessionId);
- /* string subscriber_stats = 2; */
- if (message.subscriberStats !== '')
- writer.tag(2, WireType.LengthDelimited).string(message.subscriberStats);
- /* string publisher_stats = 3; */
- if (message.publisherStats !== '')
- writer.tag(3, WireType.LengthDelimited).string(message.publisherStats);
- /* string webrtc_version = 4; */
- if (message.webrtcVersion !== '')
- writer.tag(4, WireType.LengthDelimited).string(message.webrtcVersion);
- /* string sdk = 5; */
- if (message.sdk !== '')
- writer.tag(5, WireType.LengthDelimited).string(message.sdk);
- /* string sdk_version = 6; */
- if (message.sdkVersion !== '')
- writer.tag(6, WireType.LengthDelimited).string(message.sdkVersion);
- let u = options.writeUnknownFields;
- if (u !== false)
- (u == true ? UnknownFieldHandler.onWrite : u)(
- this.typeName,
- message,
- writer,
- );
- return writer;
- }
}
/**
* @generated MessageType for protobuf message stream.video.sfu.signal.SendStatsRequest
@@ -750,71 +378,6 @@ class SendStatsResponse$Type extends MessageType {
{ no: 1, name: 'error', kind: 'message', T: () => Error },
]);
}
- create(value?: PartialMessage): SendStatsResponse {
- const message = globalThis.Object.create(this.messagePrototype!);
- if (value !== undefined)
- reflectionMergePartial(this, message, value);
- return message;
- }
- internalBinaryRead(
- reader: IBinaryReader,
- length: number,
- options: BinaryReadOptions,
- target?: SendStatsResponse,
- ): SendStatsResponse {
- let message = target ?? this.create(),
- end = reader.pos + length;
- while (reader.pos < end) {
- let [fieldNo, wireType] = reader.tag();
- switch (fieldNo) {
- case /* stream.video.sfu.models.Error error */ 1:
- message.error = Error.internalBinaryRead(
- reader,
- reader.uint32(),
- options,
- message.error,
- );
- break;
- default:
- let u = options.readUnknownField;
- if (u === 'throw')
- throw new globalThis.Error(
- `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`,
- );
- let d = reader.skip(wireType);
- if (u !== false)
- (u === true ? UnknownFieldHandler.onRead : u)(
- this.typeName,
- message,
- fieldNo,
- wireType,
- d,
- );
- }
- }
- return message;
- }
- internalBinaryWrite(
- message: SendStatsResponse,
- writer: IBinaryWriter,
- options: BinaryWriteOptions,
- ): IBinaryWriter {
- /* stream.video.sfu.models.Error error = 1; */
- if (message.error)
- Error.internalBinaryWrite(
- message.error,
- writer.tag(1, WireType.LengthDelimited).fork(),
- options,
- ).join();
- let u = options.writeUnknownFields;
- if (u !== false)
- (u == true ? UnknownFieldHandler.onWrite : u)(
- this.typeName,
- message,
- writer,
- );
- return writer;
- }
}
/**
* @generated MessageType for protobuf message stream.video.sfu.signal.SendStatsResponse
@@ -833,70 +396,6 @@ class ICERestartRequest$Type extends MessageType {
},
]);
}
- create(value?: PartialMessage): ICERestartRequest {
- const message = globalThis.Object.create(this.messagePrototype!);
- message.sessionId = '';
- message.peerType = 0;
- if (value !== undefined)
- reflectionMergePartial(this, message, value);
- return message;
- }
- internalBinaryRead(
- reader: IBinaryReader,
- length: number,
- options: BinaryReadOptions,
- target?: ICERestartRequest,
- ): ICERestartRequest {
- let message = target ?? this.create(),
- end = reader.pos + length;
- while (reader.pos < end) {
- let [fieldNo, wireType] = reader.tag();
- switch (fieldNo) {
- case /* string session_id */ 1:
- message.sessionId = reader.string();
- break;
- case /* stream.video.sfu.models.PeerType peer_type */ 2:
- message.peerType = reader.int32();
- break;
- default:
- let u = options.readUnknownField;
- if (u === 'throw')
- throw new globalThis.Error(
- `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`,
- );
- let d = reader.skip(wireType);
- if (u !== false)
- (u === true ? UnknownFieldHandler.onRead : u)(
- this.typeName,
- message,
- fieldNo,
- wireType,
- d,
- );
- }
- }
- return message;
- }
- internalBinaryWrite(
- message: ICERestartRequest,
- writer: IBinaryWriter,
- options: BinaryWriteOptions,
- ): IBinaryWriter {
- /* string session_id = 1; */
- if (message.sessionId !== '')
- writer.tag(1, WireType.LengthDelimited).string(message.sessionId);
- /* stream.video.sfu.models.PeerType peer_type = 2; */
- if (message.peerType !== 0)
- writer.tag(2, WireType.Varint).int32(message.peerType);
- let u = options.writeUnknownFields;
- if (u !== false)
- (u == true ? UnknownFieldHandler.onWrite : u)(
- this.typeName,
- message,
- writer,
- );
- return writer;
- }
}
/**
* @generated MessageType for protobuf message stream.video.sfu.signal.ICERestartRequest
@@ -909,71 +408,6 @@ class ICERestartResponse$Type extends MessageType {
{ no: 1, name: 'error', kind: 'message', T: () => Error },
]);
}
- create(value?: PartialMessage): ICERestartResponse {
- const message = globalThis.Object.create(this.messagePrototype!);
- if (value !== undefined)
- reflectionMergePartial(this, message, value);
- return message;
- }
- internalBinaryRead(
- reader: IBinaryReader,
- length: number,
- options: BinaryReadOptions,
- target?: ICERestartResponse,
- ): ICERestartResponse {
- let message = target ?? this.create(),
- end = reader.pos + length;
- while (reader.pos < end) {
- let [fieldNo, wireType] = reader.tag();
- switch (fieldNo) {
- case /* stream.video.sfu.models.Error error */ 1:
- message.error = Error.internalBinaryRead(
- reader,
- reader.uint32(),
- options,
- message.error,
- );
- break;
- default:
- let u = options.readUnknownField;
- if (u === 'throw')
- throw new globalThis.Error(
- `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`,
- );
- let d = reader.skip(wireType);
- if (u !== false)
- (u === true ? UnknownFieldHandler.onRead : u)(
- this.typeName,
- message,
- fieldNo,
- wireType,
- d,
- );
- }
- }
- return message;
- }
- internalBinaryWrite(
- message: ICERestartResponse,
- writer: IBinaryWriter,
- options: BinaryWriteOptions,
- ): IBinaryWriter {
- /* stream.video.sfu.models.Error error = 1; */
- if (message.error)
- Error.internalBinaryWrite(
- message.error,
- writer.tag(1, WireType.LengthDelimited).fork(),
- options,
- ).join();
- let u = options.writeUnknownFields;
- if (u !== false)
- (u == true ? UnknownFieldHandler.onWrite : u)(
- this.typeName,
- message,
- writer,
- );
- return writer;
- }
}
/**
* @generated MessageType for protobuf message stream.video.sfu.signal.ICERestartResponse
@@ -993,78 +427,6 @@ class UpdateMuteStatesRequest$Type extends MessageType
},
]);
}
- create(
- value?: PartialMessage,
- ): UpdateMuteStatesRequest {
- const message = globalThis.Object.create(this.messagePrototype!);
- message.sessionId = '';
- message.muteStates = [];
- if (value !== undefined)
- reflectionMergePartial(this, message, value);
- return message;
- }
- internalBinaryRead(
- reader: IBinaryReader,
- length: number,
- options: BinaryReadOptions,
- target?: UpdateMuteStatesRequest,
- ): UpdateMuteStatesRequest {
- let message = target ?? this.create(),
- end = reader.pos + length;
- while (reader.pos < end) {
- let [fieldNo, wireType] = reader.tag();
- switch (fieldNo) {
- case /* string session_id */ 1:
- message.sessionId = reader.string();
- break;
- case /* repeated stream.video.sfu.signal.TrackMuteState mute_states */ 3:
- message.muteStates.push(
- TrackMuteState.internalBinaryRead(reader, reader.uint32(), options),
- );
- break;
- default:
- let u = options.readUnknownField;
- if (u === 'throw')
- throw new globalThis.Error(
- `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`,
- );
- let d = reader.skip(wireType);
- if (u !== false)
- (u === true ? UnknownFieldHandler.onRead : u)(
- this.typeName,
- message,
- fieldNo,
- wireType,
- d,
- );
- }
- }
- return message;
- }
- internalBinaryWrite(
- message: UpdateMuteStatesRequest,
- writer: IBinaryWriter,
- options: BinaryWriteOptions,
- ): IBinaryWriter {
- /* string session_id = 1; */
- if (message.sessionId !== '')
- writer.tag(1, WireType.LengthDelimited).string(message.sessionId);
- /* repeated stream.video.sfu.signal.TrackMuteState mute_states = 3; */
- for (let i = 0; i < message.muteStates.length; i++)
- TrackMuteState.internalBinaryWrite(
- message.muteStates[i],
- writer.tag(3, WireType.LengthDelimited).fork(),
- options,
- ).join();
- let u = options.writeUnknownFields;
- if (u !== false)
- (u == true ? UnknownFieldHandler.onWrite : u)(
- this.typeName,
- message,
- writer,
- );
- return writer;
- }
}
/**
* @generated MessageType for protobuf message stream.video.sfu.signal.UpdateMuteStatesRequest
@@ -1077,73 +439,6 @@ class UpdateMuteStatesResponse$Type extends MessageType Error },
]);
}
- create(
- value?: PartialMessage,
- ): UpdateMuteStatesResponse {
- const message = globalThis.Object.create(this.messagePrototype!);
- if (value !== undefined)
- reflectionMergePartial(this, message, value);
- return message;
- }
- internalBinaryRead(
- reader: IBinaryReader,
- length: number,
- options: BinaryReadOptions,
- target?: UpdateMuteStatesResponse,
- ): UpdateMuteStatesResponse {
- let message = target ?? this.create(),
- end = reader.pos + length;
- while (reader.pos < end) {
- let [fieldNo, wireType] = reader.tag();
- switch (fieldNo) {
- case /* stream.video.sfu.models.Error error */ 4:
- message.error = Error.internalBinaryRead(
- reader,
- reader.uint32(),
- options,
- message.error,
- );
- break;
- default:
- let u = options.readUnknownField;
- if (u === 'throw')
- throw new globalThis.Error(
- `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`,
- );
- let d = reader.skip(wireType);
- if (u !== false)
- (u === true ? UnknownFieldHandler.onRead : u)(
- this.typeName,
- message,
- fieldNo,
- wireType,
- d,
- );
- }
- }
- return message;
- }
- internalBinaryWrite(
- message: UpdateMuteStatesResponse,
- writer: IBinaryWriter,
- options: BinaryWriteOptions,
- ): IBinaryWriter {
- /* stream.video.sfu.models.Error error = 4; */
- if (message.error)
- Error.internalBinaryWrite(
- message.error,
- writer.tag(4, WireType.LengthDelimited).fork(),
- options,
- ).join();
- let u = options.writeUnknownFields;
- if (u !== false)
- (u == true ? UnknownFieldHandler.onWrite : u)(
- this.typeName,
- message,
- writer,
- );
- return writer;
- }
}
/**
* @generated MessageType for protobuf message stream.video.sfu.signal.UpdateMuteStatesResponse
@@ -1166,70 +461,6 @@ class TrackMuteState$Type extends MessageType {
{ no: 2, name: 'muted', kind: 'scalar', T: 8 /*ScalarType.BOOL*/ },
]);
}
- create(value?: PartialMessage): TrackMuteState {
- const message = globalThis.Object.create(this.messagePrototype!);
- message.trackType = 0;
- message.muted = false;
- if (value !== undefined)
- reflectionMergePartial(this, message, value);
- return message;
- }
- internalBinaryRead(
- reader: IBinaryReader,
- length: number,
- options: BinaryReadOptions,
- target?: TrackMuteState,
- ): TrackMuteState {
- let message = target ?? this.create(),
- end = reader.pos + length;
- while (reader.pos < end) {
- let [fieldNo, wireType] = reader.tag();
- switch (fieldNo) {
- case /* stream.video.sfu.models.TrackType track_type */ 1:
- message.trackType = reader.int32();
- break;
- case /* bool muted */ 2:
- message.muted = reader.bool();
- break;
- default:
- let u = options.readUnknownField;
- if (u === 'throw')
- throw new globalThis.Error(
- `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`,
- );
- let d = reader.skip(wireType);
- if (u !== false)
- (u === true ? UnknownFieldHandler.onRead : u)(
- this.typeName,
- message,
- fieldNo,
- wireType,
- d,
- );
- }
- }
- return message;
- }
- internalBinaryWrite(
- message: TrackMuteState,
- writer: IBinaryWriter,
- options: BinaryWriteOptions,
- ): IBinaryWriter {
- /* stream.video.sfu.models.TrackType track_type = 1; */
- if (message.trackType !== 0)
- writer.tag(1, WireType.Varint).int32(message.trackType);
- /* bool muted = 2; */
- if (message.muted !== false)
- writer.tag(2, WireType.Varint).bool(message.muted);
- let u = options.writeUnknownFields;
- if (u !== false)
- (u == true ? UnknownFieldHandler.onWrite : u)(
- this.typeName,
- message,
- writer,
- );
- return writer;
- }
}
/**
* @generated MessageType for protobuf message stream.video.sfu.signal.TrackMuteState
@@ -1242,63 +473,6 @@ class AudioMuteChanged$Type extends MessageType {
{ no: 1, name: 'muted', kind: 'scalar', T: 8 /*ScalarType.BOOL*/ },
]);
}
- create(value?: PartialMessage): AudioMuteChanged {
- const message = globalThis.Object.create(this.messagePrototype!);
- message.muted = false;
- if (value !== undefined)
- reflectionMergePartial(this, message, value);
- return message;
- }
- internalBinaryRead(
- reader: IBinaryReader,
- length: number,
- options: BinaryReadOptions,
- target?: AudioMuteChanged,
- ): AudioMuteChanged {
- let message = target ?? this.create(),
- end = reader.pos + length;
- while (reader.pos < end) {
- let [fieldNo, wireType] = reader.tag();
- switch (fieldNo) {
- case /* bool muted */ 1:
- message.muted = reader.bool();
- break;
- default:
- let u = options.readUnknownField;
- if (u === 'throw')
- throw new globalThis.Error(
- `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`,
- );
- let d = reader.skip(wireType);
- if (u !== false)
- (u === true ? UnknownFieldHandler.onRead : u)(
- this.typeName,
- message,
- fieldNo,
- wireType,
- d,
- );
- }
- }
- return message;
- }
- internalBinaryWrite(
- message: AudioMuteChanged,
- writer: IBinaryWriter,
- options: BinaryWriteOptions,
- ): IBinaryWriter {
- /* bool muted = 1; */
- if (message.muted !== false)
- writer.tag(1, WireType.Varint).bool(message.muted);
- let u = options.writeUnknownFields;
- if (u !== false)
- (u == true ? UnknownFieldHandler.onWrite : u)(
- this.typeName,
- message,
- writer,
- );
- return writer;
- }
}
/**
* @generated MessageType for protobuf message stream.video.sfu.signal.AudioMuteChanged
@@ -1311,63 +485,6 @@ class VideoMuteChanged$Type extends MessageType {
{ no: 2, name: 'muted', kind: 'scalar', T: 8 /*ScalarType.BOOL*/ },
]);
}
- create(value?: PartialMessage): VideoMuteChanged {
- const message = globalThis.Object.create(this.messagePrototype!);
- message.muted = false;
- if (value !== undefined)
- reflectionMergePartial(this, message, value);
- return message;
- }
- internalBinaryRead(
- reader: IBinaryReader,
- length: number,
- options: BinaryReadOptions,
- target?: VideoMuteChanged,
- ): VideoMuteChanged {
- let message = target ?? this.create(),
- end = reader.pos + length;
- while (reader.pos < end) {
- let [fieldNo, wireType] = reader.tag();
- switch (fieldNo) {
- case /* bool muted */ 2:
- message.muted = reader.bool();
- break;
- default:
- let u = options.readUnknownField;
- if (u === 'throw')
- throw new globalThis.Error(
- `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`,
- );
- let d = reader.skip(wireType);
- if (u !== false)
- (u === true ? UnknownFieldHandler.onRead : u)(
- this.typeName,
- message,
- fieldNo,
- wireType,
- d,
- );
- }
- }
- return message;
- }
- internalBinaryWrite(
- message: VideoMuteChanged,
- writer: IBinaryWriter,
- options: BinaryWriteOptions,
- ): IBinaryWriter {
- /* bool muted = 2; */
- if (message.muted !== false)
- writer.tag(2, WireType.Varint).bool(message.muted);
- let u = options.writeUnknownFields;
- if (u !== false)
- (u == true ? UnknownFieldHandler.onWrite : u)(
- this.typeName,
- message,
- writer,
- );
- return writer;
- }
}
/**
* @generated MessageType for protobuf message stream.video.sfu.signal.VideoMuteChanged
@@ -1387,82 +504,6 @@ class UpdateSubscriptionsRequest$Type extends MessageType,
- ): UpdateSubscriptionsRequest {
- const message = globalThis.Object.create(this.messagePrototype!);
- message.sessionId = '';
- message.tracks = [];
- if (value !== undefined)
- reflectionMergePartial(this, message, value);
- return message;
- }
- internalBinaryRead(
- reader: IBinaryReader,
- length: number,
- options: BinaryReadOptions,
- target?: UpdateSubscriptionsRequest,
- ): UpdateSubscriptionsRequest {
- let message = target ?? this.create(),
- end = reader.pos + length;
- while (reader.pos < end) {
- let [fieldNo, wireType] = reader.tag();
- switch (fieldNo) {
- case /* string session_id */ 2:
- message.sessionId = reader.string();
- break;
- case /* repeated stream.video.sfu.signal.TrackSubscriptionDetails tracks */ 3:
- message.tracks.push(
- TrackSubscriptionDetails.internalBinaryRead(
- reader,
- reader.uint32(),
- options,
- ),
- );
- break;
- default:
- let u = options.readUnknownField;
- if (u === 'throw')
- throw new globalThis.Error(
- `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`,
- );
- let d = reader.skip(wireType);
- if (u !== false)
- (u === true ? UnknownFieldHandler.onRead : u)(
- this.typeName,
- message,
- fieldNo,
- wireType,
- d,
- );
- }
- }
- return message;
- }
- internalBinaryWrite(
- message: UpdateSubscriptionsRequest,
- writer: IBinaryWriter,
- options: BinaryWriteOptions,
- ): IBinaryWriter {
- /* string session_id = 2; */
- if (message.sessionId !== '')
- writer.tag(2, WireType.LengthDelimited).string(message.sessionId);
- /* repeated stream.video.sfu.signal.TrackSubscriptionDetails tracks = 3; */
- for (let i = 0; i < message.tracks.length; i++)
- TrackSubscriptionDetails.internalBinaryWrite(
- message.tracks[i],
- writer.tag(3, WireType.LengthDelimited).fork(),
- options,
- ).join();
- let u = options.writeUnknownFields;
- if (u !== false)
- (u == true ? UnknownFieldHandler.onWrite : u)(
- this.typeName,
- message,
- writer,
- );
- return writer;
- }
}
/**
* @generated MessageType for protobuf message stream.video.sfu.signal.UpdateSubscriptionsRequest
@@ -1475,73 +516,6 @@ class UpdateSubscriptionsResponse$Type extends MessageType Error },
]);
}
- create(
- value?: PartialMessage,
- ): UpdateSubscriptionsResponse {
- const message = globalThis.Object.create(this.messagePrototype!);
- if (value !== undefined)
- reflectionMergePartial(this, message, value);
- return message;
- }
- internalBinaryRead(
- reader: IBinaryReader,
- length: number,
- options: BinaryReadOptions,
- target?: UpdateSubscriptionsResponse,
- ): UpdateSubscriptionsResponse {
- let message = target ?? this.create(),
- end = reader.pos + length;
- while (reader.pos < end) {
- let [fieldNo, wireType] = reader.tag();
- switch (fieldNo) {
- case /* stream.video.sfu.models.Error error */ 4:
- message.error = Error.internalBinaryRead(
- reader,
- reader.uint32(),
- options,
- message.error,
- );
- break;
- default:
- let u = options.readUnknownField;
- if (u === 'throw')
- throw new globalThis.Error(
- `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`,
- );
- let d = reader.skip(wireType);
- if (u !== false)
- (u === true ? UnknownFieldHandler.onRead : u)(
- this.typeName,
- message,
- fieldNo,
- wireType,
- d,
- );
- }
- }
- return message;
- }
- internalBinaryWrite(
- message: UpdateSubscriptionsResponse,
- writer: IBinaryWriter,
- options: BinaryWriteOptions,
- ): IBinaryWriter {
- /* stream.video.sfu.models.Error error = 4; */
- if (message.error)
- Error.internalBinaryWrite(
- message.error,
- writer.tag(4, WireType.LengthDelimited).fork(),
- options,
- ).join();
- let u = options.writeUnknownFields;
- if (u !== false)
- (u == true ? UnknownFieldHandler.onWrite : u)(
- this.typeName,
- message,
- writer,
- );
- return writer;
- }
}
/**
* @generated MessageType for protobuf message stream.video.sfu.signal.UpdateSubscriptionsResponse
@@ -1567,94 +541,6 @@ class TrackSubscriptionDetails$Type extends MessageType VideoDimension },
]);
}
- create(
- value?: PartialMessage,
- ): TrackSubscriptionDetails {
- const message = globalThis.Object.create(this.messagePrototype!);
- message.userId = '';
- message.sessionId = '';
- message.trackType = 0;
- if (value !== undefined)
- reflectionMergePartial(this, message, value);
- return message;
- }
- internalBinaryRead(
- reader: IBinaryReader,
- length: number,
- options: BinaryReadOptions,
- target?: TrackSubscriptionDetails,
- ): TrackSubscriptionDetails {
- let message = target ?? this.create(),
- end = reader.pos + length;
- while (reader.pos < end) {
- let [fieldNo, wireType] = reader.tag();
- switch (fieldNo) {
- case /* string user_id */ 1:
- message.userId = reader.string();
- break;
- case /* string session_id */ 2:
- message.sessionId = reader.string();
- break;
- case /* stream.video.sfu.models.TrackType track_type */ 3:
- message.trackType = reader.int32();
- break;
- case /* stream.video.sfu.models.VideoDimension dimension */ 4:
- message.dimension = VideoDimension.internalBinaryRead(
- reader,
- reader.uint32(),
- options,
- message.dimension,
- );
- break;
- default:
- let u = options.readUnknownField;
- if (u === 'throw')
- throw new globalThis.Error(
- `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`,
- );
- let d = reader.skip(wireType);
- if (u !== false)
- (u === true ? UnknownFieldHandler.onRead : u)(
- this.typeName,
- message,
- fieldNo,
- wireType,
- d,
- );
- }
- }
- return message;
- }
- internalBinaryWrite(
- message: TrackSubscriptionDetails,
- writer: IBinaryWriter,
- options: BinaryWriteOptions,
- ): IBinaryWriter {
- /* string user_id = 1; */
- if (message.userId !== '')
- writer.tag(1, WireType.LengthDelimited).string(message.userId);
- /* string session_id = 2; */
- if (message.sessionId !== '')
- writer.tag(2, WireType.LengthDelimited).string(message.sessionId);
- /* stream.video.sfu.models.TrackType track_type = 3; */
- if (message.trackType !== 0)
- writer.tag(3, WireType.Varint).int32(message.trackType);
- /* stream.video.sfu.models.VideoDimension dimension = 4; */
- if (message.dimension)
- VideoDimension.internalBinaryWrite(
- message.dimension,
- writer.tag(4, WireType.LengthDelimited).fork(),
- options,
- ).join();
- let u = options.writeUnknownFields;
- if (u !== false)
- (u == true ? UnknownFieldHandler.onWrite : u)(
- this.typeName,
- message,
- writer,
- );
- return writer;
- }
}
/**
* @generated MessageType for protobuf message stream.video.sfu.signal.TrackSubscriptionDetails
@@ -1674,77 +560,6 @@ class SendAnswerRequest$Type extends MessageType {
{ no: 3, name: 'session_id', kind: 'scalar', T: 9 /*ScalarType.STRING*/ },
]);
}
- create(value?: PartialMessage): SendAnswerRequest {
- const message = globalThis.Object.create(this.messagePrototype!);
- message.peerType = 0;
- message.sdp = '';
- message.sessionId = '';
- if (value !== undefined)
- reflectionMergePartial(this, message, value);
- return message;
- }
- internalBinaryRead(
- reader: IBinaryReader,
- length: number,
- options: BinaryReadOptions,
- target?: SendAnswerRequest,
- ): SendAnswerRequest {
- let message = target ?? this.create(),
- end = reader.pos + length;
- while (reader.pos < end) {
- let [fieldNo, wireType] = reader.tag();
- switch (fieldNo) {
- case /* stream.video.sfu.models.PeerType peer_type */ 1:
- message.peerType = reader.int32();
- break;
- case /* string sdp */ 2:
- message.sdp = reader.string();
- break;
- case /* string session_id */ 3:
- message.sessionId = reader.string();
- break;
- default:
- let u = options.readUnknownField;
- if (u === 'throw')
- throw new globalThis.Error(
- `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`,
- );
- let d = reader.skip(wireType);
- if (u !== false)
- (u === true ? UnknownFieldHandler.onRead : u)(
- this.typeName,
- message,
- fieldNo,
- wireType,
- d,
- );
- }
- }
- return message;
- }
- internalBinaryWrite(
- message: SendAnswerRequest,
- writer: IBinaryWriter,
- options: BinaryWriteOptions,
- ): IBinaryWriter {
- /* stream.video.sfu.models.PeerType peer_type = 1; */
- if (message.peerType !== 0)
- writer.tag(1, WireType.Varint).int32(message.peerType);
- /* string sdp = 2; */
- if (message.sdp !== '')
- writer.tag(2, WireType.LengthDelimited).string(message.sdp);
- /* string session_id = 3; */
- if (message.sessionId !== '')
- writer.tag(3, WireType.LengthDelimited).string(message.sessionId);
- let u = options.writeUnknownFields;
- if (u !== false)
- (u == true ? UnknownFieldHandler.onWrite : u)(
- this.typeName,
- message,
- writer,
- );
- return writer;
- }
}
/**
* @generated MessageType for protobuf message stream.video.sfu.signal.SendAnswerRequest
@@ -1757,71 +572,6 @@ class SendAnswerResponse$Type extends MessageType {
{ no: 4, name: 'error', kind: 'message', T: () => Error },
]);
}
- create(value?: PartialMessage): SendAnswerResponse {
- const message = globalThis.Object.create(this.messagePrototype!);
- if (value !== undefined)
- reflectionMergePartial(this, message, value);
- return message;
- }
- internalBinaryRead(
- reader: IBinaryReader,
- length: number,
- options: BinaryReadOptions,
- target?: SendAnswerResponse,
- ): SendAnswerResponse {
- let message = target ?? this.create(),
- end = reader.pos + length;
- while (reader.pos < end) {
- let [fieldNo, wireType] = reader.tag();
- switch (fieldNo) {
- case /* stream.video.sfu.models.Error error */ 4:
- message.error = Error.internalBinaryRead(
- reader,
- reader.uint32(),
- options,
- message.error,
- );
- break;
- default:
- let u = options.readUnknownField;
- if (u === 'throw')
- throw new globalThis.Error(
- `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`,
- );
- let d = reader.skip(wireType);
- if (u !== false)
- (u === true ? UnknownFieldHandler.onRead : u)(
- this.typeName,
- message,
- fieldNo,
- wireType,
- d,
- );
- }
- }
- return message;
- }
- internalBinaryWrite(
- message: SendAnswerResponse,
- writer: IBinaryWriter,
- options: BinaryWriteOptions,
- ): IBinaryWriter {
- /* stream.video.sfu.models.Error error = 4; */
- if (message.error)
- Error.internalBinaryWrite(
- message.error,
- writer.tag(4, WireType.LengthDelimited).fork(),
- options,
- ).join();
- let u = options.writeUnknownFields;
- if (u !== false)
- (u == true ? UnknownFieldHandler.onWrite : u)(
- this.typeName,
- message,
- writer,
- );
- return writer;
- }
}
/**
* @generated MessageType for protobuf message stream.video.sfu.signal.SendAnswerResponse
@@ -1834,71 +584,6 @@ class ICETrickleResponse$Type extends MessageType {
{ no: 4, name: 'error', kind: 'message', T: () => Error },
]);
}
- create(value?: PartialMessage): ICETrickleResponse {
- const message = globalThis.Object.create(this.messagePrototype!);
- if (value !== undefined)
- reflectionMergePartial(this, message, value);
- return message;
- }
- internalBinaryRead(
- reader: IBinaryReader,
- length: number,
- options: BinaryReadOptions,
- target?: ICETrickleResponse,
- ): ICETrickleResponse {
- let message = target ?? this.create(),
- end = reader.pos + length;
- while (reader.pos < end) {
- let [fieldNo, wireType] = reader.tag();
- switch (fieldNo) {
- case /* stream.video.sfu.models.Error error */ 4:
- message.error = Error.internalBinaryRead(
- reader,
- reader.uint32(),
- options,
- message.error,
- );
- break;
- default:
- let u = options.readUnknownField;
- if (u === 'throw')
- throw new globalThis.Error(
- `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`,
- );
- let d = reader.skip(wireType);
- if (u !== false)
- (u === true ? UnknownFieldHandler.onRead : u)(
- this.typeName,
- message,
- fieldNo,
- wireType,
- d,
- );
- }
- }
- return message;
- }
- internalBinaryWrite(
- message: ICETrickleResponse,
- writer: IBinaryWriter,
- options: BinaryWriteOptions,
- ): IBinaryWriter {
- /* stream.video.sfu.models.Error error = 4; */
- if (message.error)
- Error.internalBinaryWrite(
- message.error,
- writer.tag(4, WireType.LengthDelimited).fork(),
- options,
- ).join();
- let u = options.writeUnknownFields;
- if (u !== false)
- (u == true ? UnknownFieldHandler.onWrite : u)(
- this.typeName,
- message,
- writer,
- );
- return writer;
- }
}
/**
* @generated MessageType for protobuf message stream.video.sfu.signal.ICETrickleResponse
@@ -1919,83 +604,6 @@ class SetPublisherRequest$Type extends MessageType {
},
]);
}
- create(value?: PartialMessage): SetPublisherRequest {
- const message = globalThis.Object.create(this.messagePrototype!);
- message.sdp = '';
- message.sessionId = '';
- message.tracks = [];
- if (value !== undefined)
- reflectionMergePartial(this, message, value);
- return message;
- }
- internalBinaryRead(
- reader: IBinaryReader,
- length: number,
- options: BinaryReadOptions,
- target?: SetPublisherRequest,
- ): SetPublisherRequest {
- let message = target ?? this.create(),
- end = reader.pos + length;
- while (reader.pos < end) {
- let [fieldNo, wireType] = reader.tag();
- switch (fieldNo) {
- case /* string sdp */ 1:
- message.sdp = reader.string();
- break;
- case /* string session_id */ 2:
- message.sessionId = reader.string();
- break;
- case /* repeated stream.video.sfu.models.TrackInfo tracks */ 3:
- message.tracks.push(
- TrackInfo.internalBinaryRead(reader, reader.uint32(), options),
- );
- break;
- default:
- let u = options.readUnknownField;
- if (u === 'throw')
- throw new globalThis.Error(
- `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`,
- );
- let d = reader.skip(wireType);
- if (u !== false)
- (u === true ? UnknownFieldHandler.onRead : u)(
- this.typeName,
- message,
- fieldNo,
- wireType,
- d,
- );
- }
- }
- return message;
- }
- internalBinaryWrite(
- message: SetPublisherRequest,
- writer: IBinaryWriter,
- options: BinaryWriteOptions,
- ): IBinaryWriter {
- /* string sdp = 1; */
- if (message.sdp !== '')
- writer.tag(1, WireType.LengthDelimited).string(message.sdp);
- /* string session_id = 2; */
- if (message.sessionId !== '')
- writer.tag(2, WireType.LengthDelimited).string(message.sessionId);
- /* repeated stream.video.sfu.models.TrackInfo tracks = 3; */
- for (let i = 0; i < message.tracks.length; i++)
- TrackInfo.internalBinaryWrite(
- message.tracks[i],
- writer.tag(3, WireType.LengthDelimited).fork(),
- options,
- ).join();
- let u = options.writeUnknownFields;
- if (u !== false)
- (u == true ? UnknownFieldHandler.onWrite : u)(
- this.typeName,
- message,
- writer,
- );
- return writer;
- }
}
/**
* @generated MessageType for protobuf message stream.video.sfu.signal.SetPublisherRequest
@@ -2011,92 +619,6 @@ class SetPublisherResponse$Type extends MessageType {
{ no: 4, name: 'error', kind: 'message', T: () => Error },
]);
}
- create(value?: PartialMessage): SetPublisherResponse {
- const message = globalThis.Object.create(this.messagePrototype!);
- message.sdp = '';
- message.sessionId = '';
- message.iceRestart = false;
- if (value !== undefined)
- reflectionMergePartial(this, message, value);
- return message;
- }
- internalBinaryRead(
- reader: IBinaryReader,
- length: number,
- options: BinaryReadOptions,
- target?: SetPublisherResponse,
- ): SetPublisherResponse {
- let message = target ?? this.create(),
- end = reader.pos + length;
- while (reader.pos < end) {
- let [fieldNo, wireType] = reader.tag();
- switch (fieldNo) {
- case /* string sdp */ 1:
- message.sdp = reader.string();
- break;
- case /* string session_id */ 2:
- message.sessionId = reader.string();
- break;
- case /* bool ice_restart */ 3:
- message.iceRestart = reader.bool();
- break;
- case /* stream.video.sfu.models.Error error */ 4:
- message.error = Error.internalBinaryRead(
- reader,
- reader.uint32(),
- options,
- message.error,
- );
- break;
- default:
- let u = options.readUnknownField;
- if (u === 'throw')
- throw new globalThis.Error(
- `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`,
- );
- let d = reader.skip(wireType);
- if (u !== false)
- (u === true ? UnknownFieldHandler.onRead : u)(
- this.typeName,
- message,
- fieldNo,
- wireType,
- d,
- );
- }
- }
- return message;
- }
- internalBinaryWrite(
- message: SetPublisherResponse,
- writer: IBinaryWriter,
- options: BinaryWriteOptions,
- ): IBinaryWriter {
- /* string sdp = 1; */
- if (message.sdp !== '')
- writer.tag(1, WireType.LengthDelimited).string(message.sdp);
- /* string session_id = 2; */
- if (message.sessionId !== '')
- writer.tag(2, WireType.LengthDelimited).string(message.sessionId);
- /* bool ice_restart = 3; */
- if (message.iceRestart !== false)
- writer.tag(3, WireType.Varint).bool(message.iceRestart);
- /* stream.video.sfu.models.Error error = 4; */
- if (message.error)
- Error.internalBinaryWrite(
- message.error,
- writer.tag(4, WireType.LengthDelimited).fork(),
- options,
- ).join();
- let u = options.writeUnknownFields;
- if (u !== false)
- (u == true ? UnknownFieldHandler.onWrite : u)(
- this.typeName,
- message,
- writer,
- );
- return writer;
- }
}
/**
* @generated MessageType for protobuf message stream.video.sfu.signal.SetPublisherResponse
diff --git a/packages/client/src/rtc/Publisher.ts b/packages/client/src/rtc/Publisher.ts
index fecdd58bb2..8ef17b23a8 100644
--- a/packages/client/src/rtc/Publisher.ts
+++ b/packages/client/src/rtc/Publisher.ts
@@ -13,7 +13,7 @@ import {
findOptimalVideoLayers,
OptimalVideoLayer,
} from './videoLayers';
-import { getPreferredCodecs } from './codecs';
+import { getPreferredCodecs, getRNOptimalCodec } from './codecs';
import { trackTypeToParticipantStreamKey } from './helpers/tracks';
import { CallingState, CallState } from '../store';
import { PublishOptions } from '../types';
@@ -22,7 +22,6 @@ import { enableHighQualityAudio, toggleDtx } from '../helpers/sdp-munging';
import { Logger } from '../coordinator/connection/types';
import { getLogger } from '../logger';
import { Dispatcher } from './Dispatcher';
-import { getOSInfo } from '../client-details';
import { VideoLayerSetting } from '../gen/video/sfu/event/events';
import { TargetResolutionResponse } from '../gen/shims';
@@ -264,26 +263,9 @@ export class Publisher {
trackType === TrackType.VIDEO
? findOptimalVideoLayers(track, targetResolution, opts)
: trackType === TrackType.SCREEN_SHARE
- ? findOptimalScreenSharingLayers(
- track,
- opts.screenShareSettings,
- screenShareBitrate,
- )
+ ? findOptimalScreenSharingLayers(track, opts, screenShareBitrate)
: undefined;
- let preferredCodec = opts.preferredCodec;
- if (!preferredCodec && trackType === TrackType.VIDEO && isReactNative()) {
- const osName = getOSInfo()?.name.toLowerCase();
- if (osName === 'ipados') {
- // in ipads it was noticed that if vp8 codec is used
- // then the bytes sent is 0 in the outbound-rtp
- // so we are forcing h264 codec for ipads
- preferredCodec = 'H264';
- } else if (osName === 'android') {
- preferredCodec = 'VP8';
- }
- }
-
// listen for 'ended' event on the track as it might be ended abruptly
// by an external factor as permission revokes, device disconnected, etc.
// keep in mind that `track.stop()` doesn't trigger this event.
@@ -306,9 +288,15 @@ export class Publisher {
this.transceiverRegistry[trackType] = transceiver;
this.publishOptionsPerTrackType.set(trackType, opts);
+ const { preferredCodec } = opts;
+ const codec =
+ isReactNative() && trackType === TrackType.VIDEO && !preferredCodec
+ ? getRNOptimalCodec()
+ : preferredCodec;
+
const codecPreferences =
'setCodecPreferences' in transceiver
- ? this.getCodecPreferences(trackType, preferredCodec)
+ ? this.getCodecPreferences(trackType, codec)
: undefined;
if (codecPreferences) {
this.logger(
@@ -721,12 +709,9 @@ export class Publisher {
const publishOpts = this.publishOptionsPerTrackType.get(trackType);
optimalLayers =
trackType === TrackType.VIDEO
- ? findOptimalVideoLayers(track, targetResolution, undefined)
+ ? findOptimalVideoLayers(track, targetResolution, publishOpts)
: trackType === TrackType.SCREEN_SHARE
- ? findOptimalScreenSharingLayers(
- track,
- publishOpts?.screenShareSettings,
- )
+ ? findOptimalScreenSharingLayers(track, publishOpts)
: [];
this.trackLayersCache[trackType] = optimalLayers;
} else {
diff --git a/packages/client/src/rtc/__tests__/Publisher.test.ts b/packages/client/src/rtc/__tests__/Publisher.test.ts
index 7e79c0b710..1777a5e3d3 100644
--- a/packages/client/src/rtc/__tests__/Publisher.test.ts
+++ b/packages/client/src/rtc/__tests__/Publisher.test.ts
@@ -8,6 +8,7 @@ import { DispatchableMessage, Dispatcher } from '../Dispatcher';
import { PeerType, TrackType } from '../../gen/video/sfu/models/models';
import { SfuEvent } from '../../gen/video/sfu/event/events';
import { IceTrickleBuffer } from '../IceTrickleBuffer';
+import { StreamClient } from '../../coordinator/connection/client';
vi.mock('../../StreamSfuClient', () => {
console.log('MOCKING StreamSfuClient');
@@ -41,6 +42,7 @@ describe('Publisher', () => {
sfuClient = new StreamSfuClient({
dispatcher,
sessionId: 'session-id-test',
+ streamClient: new StreamClient('abc'),
credentials: {
server: {
url: 'https://getstream.io/',
diff --git a/packages/client/src/rtc/__tests__/Subscriber.test.ts b/packages/client/src/rtc/__tests__/Subscriber.test.ts
index cdd87153e1..d8b16ca886 100644
--- a/packages/client/src/rtc/__tests__/Subscriber.test.ts
+++ b/packages/client/src/rtc/__tests__/Subscriber.test.ts
@@ -8,6 +8,7 @@ import { CallState } from '../../store';
import { SfuEvent } from '../../gen/video/sfu/event/events';
import { PeerType, TrackType } from '../../gen/video/sfu/models/models';
import { IceTrickleBuffer } from '../IceTrickleBuffer';
+import { StreamClient } from '../../coordinator/connection/client';
vi.mock('../../StreamSfuClient', () => {
console.log('MOCKING StreamSfuClient');
@@ -27,6 +28,7 @@ describe('Subscriber', () => {
sfuClient = new StreamSfuClient({
dispatcher,
sessionId: 'sessionId',
+ streamClient: new StreamClient('abc'),
logTag: 'logTag',
credentials: {
server: {
diff --git a/packages/client/src/rtc/__tests__/codecs.test.ts b/packages/client/src/rtc/__tests__/codecs.test.ts
new file mode 100644
index 0000000000..afa8a1be94
--- /dev/null
+++ b/packages/client/src/rtc/__tests__/codecs.test.ts
@@ -0,0 +1,145 @@
+import { describe, expect, it, vi } from 'vitest';
+import { getPreferredCodecs } from '../codecs';
+import './mocks/webrtc.mocks';
+
+describe('codecs', () => {
+ it('should return preferred audio codec', () => {
+ RTCRtpReceiver.getCapabilities = vi.fn().mockReturnValue(audioCodecs);
+ const codecs = getPreferredCodecs('audio', 'red');
+ expect(codecs).toBeDefined();
+ expect(codecs?.map((c) => c.mimeType)).toEqual([
+ 'audio/red',
+ 'audio/opus',
+ 'audio/G722',
+ 'audio/PCMU',
+ 'audio/PCMA',
+ 'audio/CN',
+ 'audio/telephone-event',
+ ]);
+ });
+
+ it('should return preferred video codec', () => {
+ RTCRtpReceiver.getCapabilities = vi.fn().mockReturnValue(videoCodecs);
+ const codecs = getPreferredCodecs('video', 'vp8');
+ expect(codecs).toBeDefined();
+ // prettier-ignore
+ expect(codecs?.map((c) => [c.mimeType, c.sdpFmtpLine])).toEqual([
+ ['video/VP8', undefined],
+ ['video/H264', 'level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=640c1f'],
+ ['video/rtx', undefined],
+ ['video/H264', 'level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01f'],
+ ['video/H264', 'level-asymmetry-allowed=1;packetization-mode=0;profile-level-id=640c1f'],
+ ['video/H264', 'level-asymmetry-allowed=1;packetization-mode=0;profile-level-id=42e01f'],
+ ['video/VP9', 'profile-id=0'],
+ ['video/VP9', 'profile-id=2'],
+ ['video/red', undefined],
+ ['video/ulpfec', undefined],
+ ['video/flexfec-03', 'repair-window=10000000'],
+ ]);
+ });
+
+ it('should pick the baseline H264 codec', () => {
+ RTCRtpReceiver.getCapabilities = vi.fn().mockReturnValue(videoCodecs);
+ const codecs = getPreferredCodecs('video', 'h264');
+ expect(codecs).toBeDefined();
+ // prettier-ignore
+ expect(codecs?.map((c) => [c.mimeType, c.sdpFmtpLine])).toEqual([
+ ['video/H264', 'level-asymmetry-allowed=1;packetization-mode=0;profile-level-id=42e01f'],
+ ['video/H264', 'level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01f'],
+ ['video/H264', 'level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=640c1f'],
+ ['video/H264', 'level-asymmetry-allowed=1;packetization-mode=0;profile-level-id=640c1f'],
+ ['video/rtx', undefined],
+ ['video/VP8', undefined],
+ ['video/VP9', 'profile-id=0'],
+ ['video/VP9', 'profile-id=2'],
+ ['video/red', undefined],
+ ['video/ulpfec', undefined],
+ ['video/flexfec-03', 'repair-window=10000000'],
+ ]);
+ });
+
+ it('should pick the baseline H264 codec with optional packetization-mode', () => {
+ RTCRtpReceiver.getCapabilities = vi
+ .fn()
+ .mockReturnValue(videoCodecsFirefox);
+ const codecs = getPreferredCodecs('video', 'h264');
+ expect(codecs).toBeDefined();
+ // prettier-ignore
+ expect(codecs?.map((c) => [c.mimeType, c.sdpFmtpLine])).toEqual([
+ ['video/H264', 'profile-level-id=42e01f;level-asymmetry-allowed=1'],
+ ['video/H264', 'profile-level-id=42e01f;level-asymmetry-allowed=1;packetization-mode=1'],
+ ['video/VP8', 'max-fs=12288;max-fr=60'],
+ ['video/rtx', undefined],
+ ['video/VP9', 'max-fs=12288;max-fr=60'],
+ ['video/ulpfec', undefined],
+ ['video/red', undefined],
+ ]);
+ });
+});
+
+// prettier-ignore
+const videoCodecsFirefox: RTCRtpCapabilities = {
+ codecs: [
+ { mimeType: 'video/VP8', sdpFmtpLine: 'max-fs=12288;max-fr=60', clockRate: 90000 },
+ { mimeType: 'video/rtx', clockRate: 90000 },
+ { mimeType: 'video/VP9', sdpFmtpLine: 'max-fs=12288;max-fr=60', clockRate: 90000 },
+ { mimeType: 'video/H264', sdpFmtpLine: 'profile-level-id=42e01f;level-asymmetry-allowed=1;packetization-mode=1', clockRate: 90000 },
+ { mimeType: 'video/H264', sdpFmtpLine: 'profile-level-id=42e01f;level-asymmetry-allowed=1', clockRate: 90000 },
+ { mimeType: 'video/ulpfec', clockRate: 90000 },
+ { mimeType: 'video/red', clockRate: 90000 },
+ ],
+ headerExtensions: [
+ { uri: 'urn:ietf:params:rtp-hdrext:sdes:mid' },
+ { uri: 'http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time' },
+ { uri: 'urn:ietf:params:rtp-hdrext:toffset' },
+ { uri: 'http://www.webrtc.org/experiments/rtp-hdrext/playout-delay' },
+ ],
+};
+
+// prettier-ignore
+const videoCodecs: RTCRtpCapabilities = {
+ codecs: [
+ { mimeType: 'video/H264', sdpFmtpLine: 'level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=640c1f', clockRate: 90000 },
+ { mimeType: 'video/rtx', clockRate: 90000 },
+ { mimeType: 'video/H264', sdpFmtpLine: 'level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01f', clockRate: 90000 },
+ { mimeType: 'video/H264', sdpFmtpLine: 'level-asymmetry-allowed=1;packetization-mode=0;profile-level-id=640c1f', clockRate: 90000 },
+ { mimeType: 'video/H264', sdpFmtpLine: 'level-asymmetry-allowed=1;packetization-mode=0;profile-level-id=42e01f', clockRate: 90000 },
+ { mimeType: 'video/VP8', clockRate: 90000 },
+ { mimeType: 'video/VP9', sdpFmtpLine: 'profile-id=0', clockRate: 90000 },
+ { mimeType: 'video/VP9', sdpFmtpLine: 'profile-id=2', clockRate: 90000 },
+ { mimeType: 'video/red', clockRate: 90000 },
+ { mimeType: 'video/ulpfec', clockRate: 90000 },
+ { mimeType: 'video/flexfec-03', sdpFmtpLine: 'repair-window=10000000', clockRate: 90000 },
+ ],
+ headerExtensions: [
+ { uri: 'urn:ietf:params:rtp-hdrext:toffset' },
+ { uri: 'http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time' },
+ { uri: 'urn:3gpp:video-orientation' },
+ { uri: 'http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01' },
+ { uri: 'http://www.webrtc.org/experiments/rtp-hdrext/playout-delay' },
+ { uri: 'http://www.webrtc.org/experiments/rtp-hdrext/video-content-type' },
+ { uri: 'http://www.webrtc.org/experiments/rtp-hdrext/video-timing' },
+ { uri: 'http://www.webrtc.org/experiments/rtp-hdrext/color-space' },
+ { uri: 'urn:ietf:params:rtp-hdrext:sdes:mid' },
+ { uri: 'urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id' },
+ { uri: 'urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id' },
+ ],
+};
+
+// prettier-ignore
+const audioCodecs: RTCRtpCapabilities = {
+ codecs: [
+ { mimeType: 'audio/opus', sdpFmtpLine: 'minptime=10;useinbandfec=1', clockRate: 48000 },
+ { mimeType: 'audio/red', sdpFmtpLine: '=111/111', clockRate: 48000 },
+ { mimeType: 'audio/G722', clockRate: 8000, channels: 1 },
+ { mimeType: 'audio/PCMU', clockRate: 8000, channels: 1 },
+ { mimeType: 'audio/PCMA', clockRate: 8000, channels: 1 },
+ { mimeType: 'audio/CN', clockRate: 8000, channels: 1 },
+ { mimeType: 'audio/telephone-event', clockRate: 8000, channels: 1 },
+ ],
+ headerExtensions: [
+ { uri: 'urn:ietf:params:rtp-hdrext:ssrc-audio-level' },
+ { uri: 'http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time' },
+ { uri: 'urn:ietf:params:rtp-hdrext:sdes:mid' },
+ ],
+};
diff --git a/packages/client/src/rtc/__tests__/mocks/webrtc.mocks.ts b/packages/client/src/rtc/__tests__/mocks/webrtc.mocks.ts
index 1bc4017d14..8143bfc4a7 100644
--- a/packages/client/src/rtc/__tests__/mocks/webrtc.mocks.ts
+++ b/packages/client/src/rtc/__tests__/mocks/webrtc.mocks.ts
@@ -60,3 +60,10 @@ const RTCTrackEvent = vi.fn(
},
);
vi.stubGlobal('RTCTrackEvent', RTCTrackEvent);
+
+const RTCRtpReceiverMock = vi.fn((): Partial => {
+ return {
+ getCapabilities: vi.fn(),
+ };
+});
+vi.stubGlobal('RTCRtpReceiver', RTCRtpReceiverMock);
diff --git a/packages/client/src/rtc/__tests__/videoLayers.test.ts b/packages/client/src/rtc/__tests__/videoLayers.test.ts
index e2826b1e6d..fccc65e7d1 100644
--- a/packages/client/src/rtc/__tests__/videoLayers.test.ts
+++ b/packages/client/src/rtc/__tests__/videoLayers.test.ts
@@ -138,7 +138,12 @@ describe('videoLayers', () => {
describe('getComputedMaxBitrate', () => {
it('should scale target bitrate down if resolution is smaller than target resolution', () => {
const targetResolution = { width: 1920, height: 1080, bitrate: 3000000 };
- const scaledBitrate = getComputedMaxBitrate(targetResolution, 1280, 720);
+ const scaledBitrate = getComputedMaxBitrate(
+ targetResolution,
+ 1280,
+ 720,
+ undefined,
+ );
expect(scaledBitrate).toBe(1333333);
});
@@ -148,7 +153,12 @@ describe('videoLayers', () => {
const targetBitrates = ['f', 'h', 'q'].map((rid) => {
const width = targetResolution.width / downscaleFactor;
const height = targetResolution.height / downscaleFactor;
- const bitrate = getComputedMaxBitrate(targetResolution, width, height);
+ const bitrate = getComputedMaxBitrate(
+ targetResolution,
+ width,
+ height,
+ undefined,
+ );
downscaleFactor *= 2;
return {
rid,
@@ -166,25 +176,45 @@ describe('videoLayers', () => {
it('should not scale target bitrate if resolution is larger than target resolution', () => {
const targetResolution = { width: 1280, height: 720, bitrate: 1000000 };
- const scaledBitrate = getComputedMaxBitrate(targetResolution, 2560, 1440);
+ const scaledBitrate = getComputedMaxBitrate(
+ targetResolution,
+ 2560,
+ 1440,
+ undefined,
+ );
expect(scaledBitrate).toBe(1000000);
});
it('should not scale target bitrate if resolution is equal to target resolution', () => {
const targetResolution = { width: 1280, height: 720, bitrate: 1000000 };
- const scaledBitrate = getComputedMaxBitrate(targetResolution, 1280, 720);
+ const scaledBitrate = getComputedMaxBitrate(
+ targetResolution,
+ 1280,
+ 720,
+ undefined,
+ );
expect(scaledBitrate).toBe(1000000);
});
it('should handle 0 width and height', () => {
const targetResolution = { width: 1280, height: 720, bitrate: 1000000 };
- const scaledBitrate = getComputedMaxBitrate(targetResolution, 0, 0);
+ const scaledBitrate = getComputedMaxBitrate(
+ targetResolution,
+ 0,
+ 0,
+ undefined,
+ );
expect(scaledBitrate).toBe(0);
});
it('should handle 4k target resolution', () => {
const targetResolution = { width: 3840, height: 2160, bitrate: 15000000 };
- const scaledBitrate = getComputedMaxBitrate(targetResolution, 1280, 720);
+ const scaledBitrate = getComputedMaxBitrate(
+ targetResolution,
+ 1280,
+ 720,
+ undefined,
+ );
expect(scaledBitrate).toBe(1666667);
});
});
diff --git a/packages/client/src/rtc/codecs.ts b/packages/client/src/rtc/codecs.ts
index cba5ce924d..3e46db9751 100644
--- a/packages/client/src/rtc/codecs.ts
+++ b/packages/client/src/rtc/codecs.ts
@@ -1,54 +1,88 @@
-import { getLogger } from '../logger';
+import { getOSInfo } from '../client-details';
+/**
+ * Returns back a list of sorted codecs, with the preferred codec first.
+ *
+ * @param kind the kind of codec to get.
+ * @param preferredCodec the codec to prioritize (vp8, h264, vp9, av1...).
+ * @param codecToRemove the codec to exclude from the list.
+ */
export const getPreferredCodecs = (
kind: 'audio' | 'video',
preferredCodec: string,
codecToRemove?: string,
): RTCRtpCodecCapability[] | undefined => {
- const logger = getLogger(['codecs']);
- if (!('getCapabilities' in RTCRtpReceiver)) {
- logger('warn', 'RTCRtpReceiver.getCapabilities is not supported');
- return;
- }
- const cap = RTCRtpReceiver.getCapabilities(kind);
- if (!cap) return;
- const matched: RTCRtpCodecCapability[] = [];
- const partialMatched: RTCRtpCodecCapability[] = [];
- const unmatched: RTCRtpCodecCapability[] = [];
- cap.codecs.forEach((c) => {
- const codec = c.mimeType.toLowerCase();
- logger('debug', `Found supported codec: ${codec}`);
- const shouldRemoveCodec =
- codecToRemove && codec === `${kind}/${codecToRemove.toLowerCase()}`;
- if (shouldRemoveCodec) return;
- const matchesCodec = codec === `${kind}/${preferredCodec.toLowerCase()}`;
- if (!matchesCodec) {
- unmatched.push(c);
- return;
+ if (!('getCapabilities' in RTCRtpReceiver)) return;
+
+ const capabilities = RTCRtpReceiver.getCapabilities(kind);
+ if (!capabilities) return;
+
+ const preferred: RTCRtpCodecCapability[] = [];
+ const partiallyPreferred: RTCRtpCodecCapability[] = [];
+ const unpreferred: RTCRtpCodecCapability[] = [];
+
+ const preferredCodecMimeType = `${kind}/${preferredCodec.toLowerCase()}`;
+ const codecToRemoveMimeType =
+ codecToRemove && `${kind}/${codecToRemove.toLowerCase()}`;
+
+ for (const codec of capabilities.codecs) {
+ const codecMimeType = codec.mimeType.toLowerCase();
+
+ const shouldRemoveCodec = codecMimeType === codecToRemoveMimeType;
+ if (shouldRemoveCodec) continue; // skip this codec
+
+ const isPreferredCodec = codecMimeType === preferredCodecMimeType;
+ if (!isPreferredCodec) {
+ unpreferred.push(codec);
+ continue;
+ }
+
+ // h264 is a special case, we want to prioritize the baseline codec with
+ // profile-level-id is 42e01f and packetization-mode=0 for maximum
+ // cross-browser compatibility.
+ // this branch covers the other cases, such as vp8.
+ if (codecMimeType !== 'video/h264') {
+ preferred.push(codec);
+ continue;
}
- // for h264 codecs that have sdpFmtpLine available, use only if the
- // profile-level-id is 42e01f for cross-browser compatibility
- if (codec === 'h264') {
- if (c.sdpFmtpLine && c.sdpFmtpLine.includes('profile-level-id=42e01f')) {
- matched.push(c);
- } else {
- partialMatched.push(c);
- }
- return;
+
+ const sdpFmtpLine = codec.sdpFmtpLine;
+ if (!sdpFmtpLine || !sdpFmtpLine.includes('profile-level-id=42e01f')) {
+ // this is not the baseline h264 codec, prioritize it lower
+ partiallyPreferred.push(codec);
+ continue;
}
- matched.push(c);
- });
- return [...matched, ...partialMatched, ...unmatched];
+ // packetization-mode mode is optional; when not present it defaults to 0:
+ // https://datatracker.ietf.org/doc/html/rfc6184#section-6.2
+ if (
+ sdpFmtpLine.includes('packetization-mode=0') ||
+ !sdpFmtpLine.includes('packetization-mode')
+ ) {
+ preferred.unshift(codec);
+ } else {
+ preferred.push(codec);
+ }
+ }
+
+ // return a sorted list of codecs, with the preferred codecs first
+ return [...preferred, ...partiallyPreferred, ...unpreferred];
};
+/**
+ * Returns a generic SDP for the given direction.
+ * We use this SDP to send it as part of our JoinRequest so that the SFU
+ * can use it to determine client's codec capabilities.
+ *
+ * @param direction the direction of the transceiver.
+ */
export const getGenericSdp = async (direction: RTCRtpTransceiverDirection) => {
const tempPc = new RTCPeerConnection();
tempPc.addTransceiver('video', { direction });
tempPc.addTransceiver('audio', { direction });
const offer = await tempPc.createOffer();
- let sdp = offer.sdp ?? '';
+ const sdp = offer.sdp ?? '';
tempPc.getTransceivers().forEach((t) => {
t.stop?.();
@@ -56,3 +90,16 @@ export const getGenericSdp = async (direction: RTCRtpTransceiverDirection) => {
tempPc.close();
return sdp;
};
+
+/**
+ * Returns the optimal codec for RN.
+ */
+export const getRNOptimalCodec = () => {
+ const osName = getOSInfo()?.name.toLowerCase();
+ // in ipads it was noticed that if vp8 codec is used
+ // then the bytes sent is 0 in the outbound-rtp
+ // so we are forcing h264 codec for ipads
+ if (osName === 'ipados') return 'h264';
+ if (osName === 'android') return 'vp8';
+ return undefined;
+};
diff --git a/packages/client/src/rtc/videoLayers.ts b/packages/client/src/rtc/videoLayers.ts
index 80c83014d6..445c2752c6 100644
--- a/packages/client/src/rtc/videoLayers.ts
+++ b/packages/client/src/rtc/videoLayers.ts
@@ -1,4 +1,4 @@
-import { PublishOptions, ScreenShareSettings } from '../types';
+import { PublishOptions } from '../types';
import { TargetResolutionResponse } from '../gen/shims';
export type OptimalVideoLayer = RTCRtpEncodingParameters & {
@@ -25,20 +25,30 @@ const defaultBitratePerRid: Record = {
*
* @param videoTrack the video track to find optimal layers for.
* @param targetResolution the expected target resolution.
- * @param options the publish options.
+ * @param publishOptions the publish options for the track.
*/
export const findOptimalVideoLayers = (
videoTrack: MediaStreamTrack,
targetResolution: TargetResolutionResponse = defaultTargetResolution,
- options: PublishOptions = {},
+ publishOptions?: PublishOptions,
) => {
const optimalVideoLayers: OptimalVideoLayer[] = [];
const settings = videoTrack.getSettings();
const { width: w = 0, height: h = 0 } = settings;
-
- const maxBitrate = getComputedMaxBitrate(targetResolution, w, h);
+ const {
+ preferredCodec,
+ scalabilityMode,
+ preferredBitrate,
+ bitrateDownscaleFactor = 2,
+ } = publishOptions || {};
+ const maxBitrate = getComputedMaxBitrate(
+ targetResolution,
+ w,
+ h,
+ preferredBitrate,
+ );
let downscaleFactor = 1;
- const { preferredCodec, scalabilityMode } = options;
+ let bitrateFactor = 1;
(preferredCodec === 'vp9' || preferredCodec === 'av1'
? ['q']
: ['f', 'h', 'q']
@@ -52,7 +62,7 @@ export const findOptimalVideoLayers = (
width: Math.round(w / downscaleFactor),
height: Math.round(h / downscaleFactor),
maxBitrate:
- Math.round(maxBitrate / downscaleFactor) || defaultBitratePerRid[rid],
+ Math.round(maxBitrate / bitrateFactor) || defaultBitratePerRid[rid],
scaleResolutionDownBy: downscaleFactor,
maxFramerate: 30,
...(preferredCodec === 'vp9' || preferredCodec === 'av1'
@@ -60,6 +70,7 @@ export const findOptimalVideoLayers = (
: null),
});
downscaleFactor *= 2;
+ bitrateFactor *= bitrateDownscaleFactor;
});
// for simplicity, we start with all layers enabled, then this function
@@ -77,22 +88,29 @@ export const findOptimalVideoLayers = (
* @param targetResolution the target resolution.
* @param currentWidth the current width of the track.
* @param currentHeight the current height of the track.
+ * @param preferredBitrate the preferred bitrate for the track.
*/
export const getComputedMaxBitrate = (
targetResolution: TargetResolutionResponse,
currentWidth: number,
currentHeight: number,
+ preferredBitrate: number | undefined,
): number => {
// if the current resolution is lower than the target resolution,
// we want to proportionally reduce the target bitrate
- const { width: targetWidth, height: targetHeight } = targetResolution;
+ const {
+ width: targetWidth,
+ height: targetHeight,
+ bitrate: targetBitrate,
+ } = targetResolution;
+ const bitrate = preferredBitrate || targetBitrate;
if (currentWidth < targetWidth || currentHeight < targetHeight) {
const currentPixels = currentWidth * currentHeight;
const targetPixels = targetWidth * targetHeight;
const reductionFactor = currentPixels / targetPixels;
- return Math.round(targetResolution.bitrate * reductionFactor);
+ return Math.round(bitrate * reductionFactor);
}
- return targetResolution.bitrate;
+ return bitrate;
};
/**
@@ -130,9 +148,10 @@ const withSimulcastConstraints = (
export const findOptimalScreenSharingLayers = (
videoTrack: MediaStreamTrack,
- preferences?: ScreenShareSettings,
+ publishOptions?: PublishOptions,
defaultMaxBitrate = 3000000,
): OptimalVideoLayer[] => {
+ const { screenShareSettings: preferences } = publishOptions || {};
const settings = videoTrack.getSettings();
return [
{
diff --git a/packages/client/src/stats/stateStoreStatsReporter.ts b/packages/client/src/stats/stateStoreStatsReporter.ts
index 99a4af0562..b3bfa4a1ec 100644
--- a/packages/client/src/stats/stateStoreStatsReporter.ts
+++ b/packages/client/src/stats/stateStoreStatsReporter.ts
@@ -252,7 +252,7 @@ const transform = (
const codec = stats.find(
(s) => s.type === 'codec' && s.id === rtcStreamStats.codecId,
- ) as { mimeType: string } | undefined; // FIXME OL: incorrect type!
+ ) as RTCRtpCodec | undefined;
const transport = stats.find(
(s) => s.type === 'transport' && s.id === rtcStreamStats.transportId,
@@ -303,6 +303,7 @@ const getEmptyStats = (stats?: StatsReport): AggregatedStatsReport => {
highestFrameWidth: 0,
highestFrameHeight: 0,
highestFramesPerSecond: 0,
+ codec: '',
timestamp: Date.now(),
};
};
@@ -346,6 +347,8 @@ const aggregate = (stats: StatsReport): AggregatedStatsReport => {
report.averageRoundTripTimeInMs = Math.round(
(report.averageRoundTripTimeInMs / streams.length) * 1000,
);
+ // we take the first codec we find, as it should be the same for all streams
+ report.codec = streams[0].codec || '';
}
const qualityLimitationReason = [
diff --git a/packages/client/src/stats/types.ts b/packages/client/src/stats/types.ts
index 1697777cec..6a1914e6fa 100644
--- a/packages/client/src/stats/types.ts
+++ b/packages/client/src/stats/types.ts
@@ -29,6 +29,7 @@ export type AggregatedStatsReport = {
highestFrameWidth: number;
highestFrameHeight: number;
highestFramesPerSecond: number;
+ codec: string;
timestamp: number;
rawReport: StatsReport;
};
diff --git a/packages/client/src/store/CallState.ts b/packages/client/src/store/CallState.ts
index 897bb5cee9..8aa0ccf99e 100644
--- a/packages/client/src/store/CallState.ts
+++ b/packages/client/src/store/CallState.ts
@@ -698,6 +698,14 @@ export class CallState {
return this.getCurrentValue(this.endedAt$);
}
+ /**
+ * Sets the time when this call has been ended.
+ * @param endedAt the time when this call has been ended.
+ */
+ setEndedAt = (endedAt: Patch) => {
+ return this.setCurrentValue(this.endedAtSubject, endedAt);
+ };
+
/**
* Will provide the time when this call has been scheduled to start.
*/
@@ -1008,10 +1016,7 @@ export class CallState {
this.startsAtSubject,
call.starts_at ? new Date(call.starts_at) : undefined,
);
- this.setCurrentValue(
- this.endedAtSubject,
- call.ended_at ? new Date(call.ended_at) : undefined,
- );
+ this.setEndedAt(call.ended_at ? new Date(call.ended_at) : undefined);
this.setCurrentValue(this.createdBySubject, call.created_by);
this.setCurrentValue(this.customSubject, call.custom);
this.setCurrentValue(this.egressSubject, call.egress);
diff --git a/packages/client/src/types.ts b/packages/client/src/types.ts
index 1950e6ae9c..b495b1f434 100644
--- a/packages/client/src/types.ts
+++ b/packages/client/src/types.ts
@@ -146,9 +146,17 @@ export type SubscriptionChanges = {
[sessionId: string]: SubscriptionChange;
};
+/**
+ * A preferred codec to use when publishing a video track.
+ * @internal
+ */
+export type PreferredCodec = 'vp8' | 'h264' | 'vp9' | 'av1' | string;
+
export type PublishOptions = {
- preferredCodec?: string;
+ preferredCodec?: PreferredCodec | null;
scalabilityMode?: string;
+ preferredBitrate?: number;
+ bitrateDownscaleFactor?: number;
screenShareSettings?: ScreenShareSettings;
};
diff --git a/packages/react-bindings/CHANGELOG.md b/packages/react-bindings/CHANGELOG.md
index 2a8f12efb7..bd1586deb6 100644
--- a/packages/react-bindings/CHANGELOG.md
+++ b/packages/react-bindings/CHANGELOG.md
@@ -2,6 +2,62 @@
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
+## [1.0.9](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-bindings-1.0.8...@stream-io/video-react-bindings-1.0.9) (2024-09-24)
+
+### Dependency Updates
+
+* `@stream-io/video-client` updated to version `1.7.3`
+## [1.0.8](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-bindings-1.0.7...@stream-io/video-react-bindings-1.0.8) (2024-09-20)
+
+### Dependency Updates
+
+* `@stream-io/video-client` updated to version `1.7.2`
+## [1.0.7](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-bindings-1.0.6...@stream-io/video-react-bindings-1.0.7) (2024-09-20)
+
+### Dependency Updates
+
+* `@stream-io/video-client` updated to version `1.7.1`
+
+* `preMajor: false` for stable packages ([#1491](https://github.com/GetStream/stream-video-js/issues/1491)) ([6ed27b9](https://github.com/GetStream/stream-video-js/commit/6ed27b9d1dfebeb9a241f6aa0b55912cce87eef5))
+
+## [1.0.6](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-bindings-1.0.5...@stream-io/video-react-bindings-1.0.6) (2024-09-19)
+
+### Dependency Updates
+
+* `@stream-io/video-client` updated to version `1.7.0`
+
+### Features
+
+* React SDK cold-start optimizations ([#1488](https://github.com/GetStream/stream-video-js/issues/1488)) ([972e579](https://github.com/GetStream/stream-video-js/commit/972e5792b5a131a212b1031ade76dcb383897a46))
+
+## [1.0.5](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-bindings-1.0.4...@stream-io/video-react-bindings-1.0.5) (2024-09-19)
+
+### Dependency Updates
+
+* `@stream-io/video-client` updated to version `1.6.5`
+## [1.0.4](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-bindings-1.0.3...@stream-io/video-react-bindings-1.0.4) (2024-09-13)
+
+### Dependency Updates
+
+* `@stream-io/video-client` updated to version `1.6.4`
+## [1.0.3](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-bindings-1.0.2...@stream-io/video-react-bindings-1.0.3) (2024-09-11)
+
+### Dependency Updates
+
+* `@stream-io/video-client` updated to version `1.6.3`
+## [1.0.2](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-bindings-1.0.1...@stream-io/video-react-bindings-1.0.2) (2024-09-09)
+
+### Dependency Updates
+
+* `@stream-io/video-client` updated to version `1.6.2`
+## [1.0.1](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-bindings-1.0.0...@stream-io/video-react-bindings-1.0.1) (2024-09-05)
+
+### Dependency Updates
+
+* `@stream-io/video-client` updated to version `1.6.1`
+
+* reset releaseAs tags [skip ci] ([6161687](https://github.com/GetStream/stream-video-js/commit/61616870178d6bbc29b22ca3b1a354e5e172c9c3))
+
## [1.0.0](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-bindings-0.4.56...@stream-io/video-react-bindings-1.0.0) (2024-09-03)
diff --git a/packages/react-bindings/package.json b/packages/react-bindings/package.json
index ce4a6fa9a6..451a8701ea 100644
--- a/packages/react-bindings/package.json
+++ b/packages/react-bindings/package.json
@@ -1,6 +1,6 @@
{
"name": "@stream-io/video-react-bindings",
- "version": "1.0.0",
+ "version": "1.0.9",
"packageManager": "yarn@3.2.4",
"main": "./dist/index.cjs.js",
"module": "./dist/index.es.js",
@@ -11,6 +11,7 @@
"start": "rollup -c -w",
"build": "NODE_ENV=production rollup -c"
},
+ "sideEffects": false,
"files": [
"dist",
"src",
@@ -34,7 +35,7 @@
"@types/react": "^18.3.2",
"react": "^18.3.1",
"rimraf": "^5.0.7",
- "rollup": "^3.29.4",
+ "rollup": "^4.22.0",
"typescript": "^5.5.2"
}
}
diff --git a/packages/react-bindings/project.json b/packages/react-bindings/project.json
index 6a4646f1c0..39f0b8705e 100644
--- a/packages/react-bindings/project.json
+++ b/packages/react-bindings/project.json
@@ -9,16 +9,16 @@
"baseBranch": "main",
"preset": {
"name": "conventionalcommits",
- "preMajor": true,
+ "preMajor": false,
"types": [
- {"type": "feat", "section": "Features"},
- {"type": "fix", "section": "Bug Fixes"},
- {"type": "chore", "hidden": false},
- {"type": "docs", "hidden": true},
- {"type": "style", "hidden": true},
- {"type": "refactor", "hidden": true},
- {"type": "perf", "section": "Features"},
- {"type": "test", "hidden": true}
+ { "type": "feat", "section": "Features" },
+ { "type": "fix", "section": "Bug Fixes" },
+ { "type": "chore", "hidden": false },
+ { "type": "docs", "hidden": true },
+ { "type": "style", "hidden": true },
+ { "type": "refactor", "hidden": true },
+ { "type": "perf", "section": "Features" },
+ { "type": "test", "hidden": true }
]
},
"trackDeps": true,
diff --git a/packages/react-native-sdk/CHANGELOG.md b/packages/react-native-sdk/CHANGELOG.md
index 19772aef86..17083c2476 100644
--- a/packages/react-native-sdk/CHANGELOG.md
+++ b/packages/react-native-sdk/CHANGELOG.md
@@ -2,6 +2,103 @@
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
+## [1.0.13](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-native-sdk-1.0.12...@stream-io/video-react-native-sdk-1.0.13) (2024-09-24)
+
+### Dependency Updates
+
+* `@stream-io/video-client` updated to version `1.7.3`
+* `@stream-io/video-react-bindings` updated to version `1.0.9`
+## [1.0.12](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-native-sdk-1.0.11...@stream-io/video-react-native-sdk-1.0.12) (2024-09-20)
+
+### Dependency Updates
+
+* `@stream-io/video-client` updated to version `1.7.2`
+* `@stream-io/video-react-bindings` updated to version `1.0.8`
+## [1.0.11](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-native-sdk-1.0.10...@stream-io/video-react-native-sdk-1.0.11) (2024-09-20)
+
+### Dependency Updates
+
+* `@stream-io/video-client` updated to version `1.7.1`
+* `@stream-io/video-react-bindings` updated to version `1.0.7`
+
+* `preMajor: false` for stable packages ([#1491](https://github.com/GetStream/stream-video-js/issues/1491)) ([6ed27b9](https://github.com/GetStream/stream-video-js/commit/6ed27b9d1dfebeb9a241f6aa0b55912cce87eef5))
+
+## [1.0.10](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-native-sdk-1.0.9...@stream-io/video-react-native-sdk-1.0.10) (2024-09-19)
+
+### Dependency Updates
+
+* `@stream-io/video-client` updated to version `1.7.0`
+* `@stream-io/video-react-bindings` updated to version `1.0.6`
+## [1.0.9](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-native-sdk-1.0.8...@stream-io/video-react-native-sdk-1.0.9) (2024-09-19)
+
+### Dependency Updates
+
+* `@stream-io/video-client` updated to version `1.6.5`
+* `@stream-io/video-react-bindings` updated to version `1.0.5`
+## [1.0.8](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-native-sdk-1.0.7...@stream-io/video-react-native-sdk-1.0.8) (2024-09-13)
+
+### Dependency Updates
+
+* `@stream-io/video-client` updated to version `1.6.4`
+* `@stream-io/video-react-bindings` updated to version `1.0.4`
+## [1.0.7](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-native-sdk-1.0.6...@stream-io/video-react-native-sdk-1.0.7) (2024-09-11)
+
+
+### Bug Fixes
+
+* replace dataSync with shortService for android foreground service type ([#1485](https://github.com/GetStream/stream-video-js/issues/1485)) ([2681535](https://github.com/GetStream/stream-video-js/commit/26815357f66b43f94e1d939fb30a6cdb85c77a5f))
+
+## [1.0.6](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-native-sdk-1.0.5...@stream-io/video-react-native-sdk-1.0.6) (2024-09-11)
+
+### Dependency Updates
+
+* `@stream-io/video-client` updated to version `1.6.3`
+* `@stream-io/video-react-bindings` updated to version `1.0.3`
+## [1.0.5](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-native-sdk-1.0.4...@stream-io/video-react-native-sdk-1.0.5) (2024-09-10)
+
+### Dependency Updates
+
+* `@stream-io/video-filters-react-native` updated to version `0.2.4`
+
+### Bug Fixes
+
+* broken ios autolinking on react native 0.68 ([#1483](https://github.com/GetStream/stream-video-js/issues/1483)) ([734a361](https://github.com/GetStream/stream-video-js/commit/734a3615bc185fc17c7d7afc812c662a9bec92e7))
+
+## [1.0.4](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-native-sdk-1.0.3...@stream-io/video-react-native-sdk-1.0.4) (2024-09-09)
+
+### Dependency Updates
+
+* `@stream-io/video-client` updated to version `1.6.2`
+* `@stream-io/video-react-bindings` updated to version `1.0.2`
+## [1.0.3](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-native-sdk-1.0.2...@stream-io/video-react-native-sdk-1.0.3) (2024-09-06)
+
+### Dependency Updates
+
+* `@stream-io/video-filters-react-native` updated to version `0.2.3`
+
+### Bug Fixes
+
+* set min ios version to 13.0 for the podspecs ([b6d8c16](https://github.com/GetStream/stream-video-js/commit/b6d8c163b66f75e12d0316abe46eebc6b017c29a))
+
+## [1.0.2](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-native-sdk-1.0.1...@stream-io/video-react-native-sdk-1.0.2) (2024-09-05)
+
+### Dependency Updates
+
+* `@stream-io/video-client` updated to version `1.6.1`
+* `@stream-io/video-react-bindings` updated to version `1.0.1`
+## [1.0.1](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-native-sdk-1.0.0...@stream-io/video-react-native-sdk-1.0.1) (2024-09-05)
+
+### Dependency Updates
+
+* `@stream-io/video-filters-react-native` updated to version `0.2.2`
+
+* reset releaseAs tags [skip ci] ([6161687](https://github.com/GetStream/stream-video-js/commit/61616870178d6bbc29b22ca3b1a354e5e172c9c3))
+
+
+### Bug Fixes
+
+* **ios:** if min ios version is not present default to 12 ([9279d59](https://github.com/GetStream/stream-video-js/commit/9279d59e861a51c723a0f17229c39dae946ee664))
+
## [1.0.0](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-native-sdk-0.10.6...@stream-io/video-react-native-sdk-1.0.0) (2024-09-03)
diff --git a/packages/react-native-sdk/docusaurus/docs/reactnative/03-core/03-calling-state-and-lifecycle.mdx b/packages/react-native-sdk/docusaurus/docs/reactnative/03-core/03-calling-state-and-lifecycle.mdx
index 5b596a5cb3..da275db188 100644
--- a/packages/react-native-sdk/docusaurus/docs/reactnative/03-core/03-calling-state-and-lifecycle.mdx
+++ b/packages/react-native-sdk/docusaurus/docs/reactnative/03-core/03-calling-state-and-lifecycle.mdx
@@ -123,40 +123,23 @@ there are few more states that you should handle.
To understand these values better, here is a hypothetical example of how these values can be mapped:
```tsx
-import { CallingState, useCallStateHooks } from '@stream-io/video-react-sdk';
+import { CallingState, useCallStateHooks, CallContent } from '@stream-io/video-react-native-sdk';
+
+const call = useCall();
+const isCallCreatedByMe = call?.isCreatedByMe;
const { useCallCallingState } = useCallStateHooks();
const callingState = useCallCallingState();
switch (callingState) {
- case CallingState.UNKNOWN:
- case CallingState.IDLE:
- return ;
-
case CallingState.RINGING:
- return ;
-
- case CallingState.JOINING:
- return ;
-
- case CallingState.JOINED:
- return ;
-
+ return isCallCreatedByMe
+ ? :
case CallingState.LEFT:
- return ;
-
- case CallingState.RECONNECTING:
- case CallingState.MIGRATING:
- return ;
-
- case CallingState.RECONNECTING_FAILED:
- return ;
-
- case CallingState.OFFLINE:
- return ;
-
+ return
+ case CallingState.IDLE:
+ return
default:
- const exhaustiveCheck: never = callingState;
- throw new Error(`Unknown calling state: ${exhaustiveCheck}`);
+ return
}
```
diff --git a/packages/react-native-sdk/docusaurus/docs/reactnative/03-core/06-querying-calls.mdx b/packages/react-native-sdk/docusaurus/docs/reactnative/03-core/06-querying-calls.mdx
index 66dc59dca5..e0603d9234 100644
--- a/packages/react-native-sdk/docusaurus/docs/reactnative/03-core/06-querying-calls.mdx
+++ b/packages/react-native-sdk/docusaurus/docs/reactnative/03-core/06-querying-calls.mdx
@@ -89,7 +89,7 @@ const { calls } = await client.queryCalls({
});
```
-### Calls that live / currently have participants
+### Calls that are ongoing / currently have participants
```typescript
import { StreamVideoClient } from '@stream-io/video-react-native-sdk';
diff --git a/packages/react-native-sdk/docusaurus/docs/reactnative/03-core/07-query-call-members.mdx b/packages/react-native-sdk/docusaurus/docs/reactnative/03-core/07-query-call-members.mdx
new file mode 100644
index 0000000000..8ff806876d
--- /dev/null
+++ b/packages/react-native-sdk/docusaurus/docs/reactnative/03-core/07-query-call-members.mdx
@@ -0,0 +1,58 @@
+---
+id: querying-call-members
+title: Querying Call Members
+description: How to query call members
+---
+
+import FilterConditions from '../../../shared/_filter-operators.mdx';
+import CallMemberFilters from '../../../shared/video/_call-member-filters.mdx';
+import CallMemberSort from '../../../shared/video/_call-member-sort-fields.mdx';
+
+When you create or join a call you get a list of call members, however this can return at most 100 members:
+
+```typescript
+// The maximum limit is 100
+// The default limit is 25
+await call.getOrCreate({ members_limit: 100 });
+
+// or
+await call.join({ members_limit: 100 });
+```
+
+To get the complete list of call members the Stream API allows you to query, filter and sort members of a call using a paginated list.
+
+## Examples
+
+Below are a few examples of how to use this API:
+
+```typescript
+const result = await call.queryMembers();
+
+// sorting and pagination
+const queryMembersReq = {
+ sort: [{ field: 'user_id', direction: 1 }],
+ limit: 2,
+};
+const result = await call.queryMembers(queryMembersReq);
+
+// loading the next page
+const result = await call.queryMembers({
+ ...queryMembersReq,
+ next: result.next,
+});
+
+// filtering
+const result = await call.queryMembers({
+ filter_conditions: { role: { $eq: 'admin' } },
+});
+```
+
+## Sort options
+
+
+
+## Filter options
+
+
+
+
diff --git a/packages/react-native-sdk/docusaurus/docs/reactnative/03-core/07-keeping-call-alive.mdx b/packages/react-native-sdk/docusaurus/docs/reactnative/03-core/08-keeping-call-alive.mdx
similarity index 100%
rename from packages/react-native-sdk/docusaurus/docs/reactnative/03-core/07-keeping-call-alive.mdx
rename to packages/react-native-sdk/docusaurus/docs/reactnative/03-core/08-keeping-call-alive.mdx
diff --git a/packages/react-native-sdk/docusaurus/docs/reactnative/06-advanced/04-push-notifications/03-ringing-setup/01-react-native.mdx b/packages/react-native-sdk/docusaurus/docs/reactnative/06-advanced/04-push-notifications/03-ringing-setup/01-react-native.mdx
index 2b50e6c44e..b8683c361b 100644
--- a/packages/react-native-sdk/docusaurus/docs/reactnative/06-advanced/04-push-notifications/03-ringing-setup/01-react-native.mdx
+++ b/packages/react-native-sdk/docusaurus/docs/reactnative/06-advanced/04-push-notifications/03-ringing-setup/01-react-native.mdx
@@ -25,15 +25,16 @@ Please follow the below guides for adding appropriate push providers to Stream:
```bash title=Terminal
yarn add @react-native-firebase/app
yarn add @react-native-firebase/messaging
+yarn add @notifee/react-native
yarn add react-native-callkeep
yarn add react-native-voip-push-notification
-yarn add @notifee/react-native
npx pod-install
```
So what did we install precisely?
- `@react-native-firebase/app` and `@react-native-firebase/messaging` for handling incoming [Firebase Cloud Messaging](https://firebase.google.com/docs/cloud-messaging) notifications on Android.
+- `@notifee/react-native` - is used to customize and display push notifications.
- `react-native-voip-push-notification` for handling incoming [PushKit](https://developer.apple.com/documentation/pushkit) notifications on iOS.
- `react-native-callkeep` for reporting incoming calls to iOS [CallKit](https://developer.apple.com/documentation/callkit).
@@ -77,13 +78,12 @@ Add the following in `AndroidManifest.xml`:
-
+ android:foregroundServiceType="shortService" />
```
### Request for notification permissions
diff --git a/packages/react-native-sdk/docusaurus/docs/reactnative/06-advanced/04-push-notifications/03-ringing-setup/02-expo.mdx b/packages/react-native-sdk/docusaurus/docs/reactnative/06-advanced/04-push-notifications/03-ringing-setup/02-expo.mdx
index 33e5aaf947..c0643bf71f 100644
--- a/packages/react-native-sdk/docusaurus/docs/reactnative/06-advanced/04-push-notifications/03-ringing-setup/02-expo.mdx
+++ b/packages/react-native-sdk/docusaurus/docs/reactnative/06-advanced/04-push-notifications/03-ringing-setup/02-expo.mdx
@@ -25,16 +25,17 @@ Please follow the below guides for adding appropriate push providers to Stream:
```bash title=Terminal
npx expo install @react-native-firebase/app
npx expo install @react-native-firebase/messaging
-npx expo install react-native-voip-push-notification
-npx expo install react-native-callkeep
npx expo install @notifee/react-native
+npx expo install react-native-voip-push-notification
+npx expo install react-native-callkeep @config-plugins/react-native-callkeep
```
So what did we install precisely?
- `@react-native-firebase/app` and `@react-native-firebase/messaging` for handling incoming [Firebase Cloud Messaging](https://firebase.google.com/docs/cloud-messaging) notifications on Android.
+- `@notifee/react-native` - is used to customize and display push notifications.
- `react-native-voip-push-notification` for handling incoming [PushKit](https://developer.apple.com/documentation/pushkit) notifications on iOS.
-- `react-native-callkeep` for reporting incoming calls to iOS [CallKit](https://developer.apple.com/documentation/callkit).
+- `react-native-callkeep` and `@config-plugins/react-native-callkeep` for reporting incoming calls to iOS [CallKit](https://developer.apple.com/documentation/callkit).
## Add Firebase credentials
diff --git a/packages/react-native-sdk/docusaurus/docs/reactnative/06-advanced/04-push-notifications/04-other-than-ringing-setup/01-react-native.mdx b/packages/react-native-sdk/docusaurus/docs/reactnative/06-advanced/04-push-notifications/04-other-than-ringing-setup/01-react-native.mdx
index aaaffc498e..92f8cb4bf7 100644
--- a/packages/react-native-sdk/docusaurus/docs/reactnative/06-advanced/04-push-notifications/04-other-than-ringing-setup/01-react-native.mdx
+++ b/packages/react-native-sdk/docusaurus/docs/reactnative/06-advanced/04-push-notifications/04-other-than-ringing-setup/01-react-native.mdx
@@ -19,14 +19,15 @@ Please follow the below guides for adding appropriate push providers to Stream:
```bash title=Terminal
yarn add @react-native-firebase/app
yarn add @react-native-firebase/messaging
-yarn add @react-native-community/push-notification-ios
yarn add @notifee/react-native
+yarn add @react-native-community/push-notification-ios
npx pod-install
```
So what did we install precisely?
- `@react-native-firebase/app` and `@react-native-firebase/messaging` for handling incoming [Firebase Cloud Messaging](https://firebase.google.com/docs/cloud-messaging) notifications on Android.
+- `@notifee/react-native` - is used to customize and display push notifications.
- `@react-native-community/push-notification-ios` for handling [Apple Push Notification service (APNs)](https://developer.apple.com/documentation/usernotifications/registering_your_app_with_apns) notifications on iOS.
## Android-specific setup
diff --git a/packages/react-native-sdk/docusaurus/docs/reactnative/06-advanced/04-push-notifications/04-other-than-ringing-setup/02-expo.mdx b/packages/react-native-sdk/docusaurus/docs/reactnative/06-advanced/04-push-notifications/04-other-than-ringing-setup/02-expo.mdx
index e7c26e00d2..a322e721ae 100644
--- a/packages/react-native-sdk/docusaurus/docs/reactnative/06-advanced/04-push-notifications/04-other-than-ringing-setup/02-expo.mdx
+++ b/packages/react-native-sdk/docusaurus/docs/reactnative/06-advanced/04-push-notifications/04-other-than-ringing-setup/02-expo.mdx
@@ -25,6 +25,7 @@ npx expo install @notifee/react-native
So what did we install precisely?
- `expo-notifications` and `expo-task-manager` for handling incoming [Firebase Cloud Messaging](https://firebase.google.com/docs/cloud-messaging) notifications on Android and iOS.
+- `@notifee/react-native` - is used to customize and display push notifications.
## Add Firebase credentials
diff --git a/packages/react-native-sdk/expo-config-plugin/README.md b/packages/react-native-sdk/expo-config-plugin/README.md
index d0c609fef0..8cf1e3f9d4 100644
--- a/packages/react-native-sdk/expo-config-plugin/README.md
+++ b/packages/react-native-sdk/expo-config-plugin/README.md
@@ -45,10 +45,10 @@ public class MainApplication extends Application implements ReactApplication {
Add service named `app.notifee.core.ForegroundService`.
```xml
-
+
```
-The `@stream-io/video-react-native-sdk` also adds the appropriate android permissions such as `POST_NOTIFICATIONS`, `FOREGROUND_SERVICE`, `FOREGROUND_SERVICE_MICROPHONE`, `BLUETOOTH`, `BLUETOOTH_ADMIN` and `BLUETOOTH_CONNECT` to the `AndroidManifest.xml`.
+The `@stream-io/video-react-native-sdk` also adds the appropriate android permissions such as `POST_NOTIFICATIONS`, `FOREGROUND_SERVICE`, `BLUETOOTH`, `BLUETOOTH_ADMIN` and `BLUETOOTH_CONNECT` to the `AndroidManifest.xml`.
### iOS
diff --git a/packages/react-native-sdk/expo-config-plugin/__tests__/withAndroidPermissions.test.ts b/packages/react-native-sdk/expo-config-plugin/__tests__/withAndroidPermissions.test.ts
index 9be3c33dca..3814ad46c6 100644
--- a/packages/react-native-sdk/expo-config-plugin/__tests__/withAndroidPermissions.test.ts
+++ b/packages/react-native-sdk/expo-config-plugin/__tests__/withAndroidPermissions.test.ts
@@ -27,7 +27,6 @@ describe('withStreamVideoReactNativeSDKAndroidPermissions', () => {
expect.arrayContaining([
'android.permission.POST_NOTIFICATIONS',
'android.permission.FOREGROUND_SERVICE',
- 'android.permission.FOREGROUND_SERVICE_DATA_SYNC',
'android.permission.FOREGROUND_SERVICE_MEDIA_PROJECTION',
'android.permission.BLUETOOTH',
'android.permission.BLUETOOTH_CONNECT',
diff --git a/packages/react-native-sdk/expo-config-plugin/src/withAndroidManifest.ts b/packages/react-native-sdk/expo-config-plugin/src/withAndroidManifest.ts
index 0ef7f9a60d..0d5087763d 100644
--- a/packages/react-native-sdk/expo-config-plugin/src/withAndroidManifest.ts
+++ b/packages/react-native-sdk/expo-config-plugin/src/withAndroidManifest.ts
@@ -20,9 +20,9 @@ function getNotifeeService() {
+ android:foregroundServiceType="shortService" />
*/
- const foregroundServiceType = 'dataSync';
+ const foregroundServiceType = 'shortService';
let head = prefixAndroidKeys({
name: 'app.notifee.core.ForegroundService',
stopWithTask: 'true',
diff --git a/packages/react-native-sdk/expo-config-plugin/src/withAndroidPermissions.ts b/packages/react-native-sdk/expo-config-plugin/src/withAndroidPermissions.ts
index 1f0b1fc7aa..ed2fddbcae 100644
--- a/packages/react-native-sdk/expo-config-plugin/src/withAndroidPermissions.ts
+++ b/packages/react-native-sdk/expo-config-plugin/src/withAndroidPermissions.ts
@@ -14,9 +14,6 @@ const withStreamVideoReactNativeSDKAndroidPermissions: ConfigPlugin<
'android.permission.POST_NOTIFICATIONS',
'android.permission.FOREGROUND_SERVICE'
);
- if (props?.ringingPushNotifications) {
- permissions.push('android.permission.FOREGROUND_SERVICE_DATA_SYNC');
- }
if (props?.enableScreenshare) {
permissions.push(
'android.permission.FOREGROUND_SERVICE_MEDIA_PROJECTION'
diff --git a/packages/react-native-sdk/ios/StreamVideoReactNative.xcodeproj/project.pbxproj b/packages/react-native-sdk/ios/StreamVideoReactNative.xcodeproj/project.pbxproj
new file mode 100644
index 0000000000..b4e9b00ec1
--- /dev/null
+++ b/packages/react-native-sdk/ios/StreamVideoReactNative.xcodeproj/project.pbxproj
@@ -0,0 +1,324 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 46;
+ objects = {
+
+/* Begin PBXCopyFilesBuildPhase section */
+ 58B511D91A9E6C8500147676 /* CopyFiles */ = {
+ isa = PBXCopyFilesBuildPhase;
+ buildActionMask = 2147483647;
+ dstPath = "include/$(PRODUCT_NAME)";
+ dstSubfolderSpec = 16;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXCopyFilesBuildPhase section */
+
+/* Begin PBXFileReference section */
+ 134814201AA4EA6300B7C361 /* libStreamVideoReactNative.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libStreamVideoReactNative.a; sourceTree = BUILT_PRODUCTS_DIR; };
+ B3E7B5891CC2AC0600A0062D /* StreamVideoReactNative.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = StreamVideoReactNative.m; sourceTree = ""; };
+ D7A6507C28C3C54500AC4DB2 /* StreamVideoReactNative.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = StreamVideoReactNative.h; sourceTree = ""; };
+ DDCF7DC92C90359D00420842 /* RTCViewPipManager.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = RTCViewPipManager.mm; sourceTree = ""; };
+ DDCF7DCA2C90359D00420842 /* RTCViewPip.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RTCViewPip.swift; sourceTree = ""; };
+ DDCF7DCB2C90359D00420842 /* RTCViewPipManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RTCViewPipManager.swift; sourceTree = ""; };
+ DDCF7DCD2C90359D00420842 /* StreamPixelBufferPool.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StreamPixelBufferPool.swift; sourceTree = ""; };
+ DDCF7DCE2C90359D00420842 /* StreamPictureInPictureController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StreamPictureInPictureController.swift; sourceTree = "