Skip to content

Commit 010f54e

Browse files
[IMP] discuss: wip recording
see: #27
1 parent a183da5 commit 010f54e

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/client.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -269,28 +269,28 @@ export class SfuClient extends EventTarget {
269269
await Promise.all(proms);
270270
return stats;
271271
}
272-
async startRecording() {
272+
async startRecording(): Promise<boolean> {
273273
if (this.state !== SfuClientState.CONNECTED) {
274-
return;
274+
throw new Error("Cannot start recording when not connected");
275275
}
276276
return this._bus?.request(
277277
{
278278
name: CLIENT_REQUEST.START_RECORDING
279279
},
280280
{ batch: true }
281-
);
281+
) as Promise<boolean>;
282282
}
283283

284-
async stopRecording() {
284+
async stopRecording(): Promise<boolean> {
285285
if (this.state !== SfuClientState.CONNECTED) {
286-
return;
286+
throw new Error("Cannot stop recording when not connected");
287287
}
288288
return this._bus?.request(
289289
{
290290
name: CLIENT_REQUEST.STOP_RECORDING
291291
},
292292
{ batch: true }
293-
);
293+
) as Promise<boolean>;
294294
}
295295

296296
/**

0 commit comments

Comments
 (0)