Interface CreateLocalMediaOptions

CreateLocalMediaOptions provide a way to configure local user media.

These options are for use with getUserMedia and getDisplayMedia.

For example, if you want a users video but not audio:

getUserMedia({video: true});

This will return you a LocalTrack with a LocalTrack.source of TrackSource.Camera and a LocalTrack.kind of TrackKind.Video.

If you wanted a user's audio but not video:

getUserMedia({audio: true});

This will return you a LocalTrack with a LocalTrack.source of TrackSource.Microphone and a LocalTrack.kind of TrackKind.Audio.

If you want video and audio with specific deviceIds:

getUserMedia({
audio: {deviceId: {exact: AUDIO_DEVICE_ID}}
video: {deviceId: {exact: VIDEO_DEVICE_ID}}
});

You may also specify a name to be used for a LocalTrack, so it may appear on the RemoteTrack.name property for the RemoteParticipant.

getUserMedia({
audio: {name: 'Named Microphone'}
video: {name: 'Named Webcam'}
});

Hierarchy

  • CreateLocalMediaOptions

Properties

Properties

audio?: boolean | LocalTrackOptions

options for configuring local audio

video?: boolean | LocalTrackOptions

options for configuring local video

Generated using TypeDoc