Skip to content

Commit

Permalink
Desktop: Allow VideoSupport to accept a MediaStream
Browse files Browse the repository at this point in the history
  • Loading branch information
indutny-signal authored Sep 18, 2024
1 parent e895f1d commit a1d00e2
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/node/ringrtc/VideoSupport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ export class GumVideoCaptureOptions {
maxFramerate = 30;
preferredDeviceId?: string;
screenShareSourceId?: string;
mediaStream?: MediaStream;
}

interface GumConstraints extends MediaStreamConstraints {
Expand Down Expand Up @@ -192,7 +193,14 @@ export class GumVideoCapturer {
return cameras;
}

private getUserMedia(options: GumVideoCaptureOptions): Promise<MediaStream> {
private async getUserMedia(
options: GumVideoCaptureOptions
): Promise<MediaStream> {
// Return provided media stream
if (options.mediaStream) {
return options.mediaStream;
}

const constraints: GumConstraints = {
audio: false,
video: {
Expand Down

0 comments on commit a1d00e2

Please sign in to comment.