LocalMediaHandler
Provides access to methods for managing actions related to local media. Instances of this class are obtained calling Call#getLocalMediaHandler or Conference#getLocalMediaHandler
Events
videoStream
- Emitted every time videoStream changes.*
- Emitted every time a change that can affect to any property happens.
Member Summary
Public Members | ||
public |
emitter: EventEmitter |
Method Summary
Public Methods | ||
public |
Updates media types adding video when screen is false or adds an internal mark to know video must be enabled when screen sharing ends. |
|
public |
Indicates if it is possible to change to a different camera |
|
public |
Indicates if video can be enabled or disabled |
|
public |
Returns the list of available audio input devices |
|
public |
Returns the list of available audio output devices |
|
public |
Returns the list of available video input devices |
|
public |
getCurrentMediaConstraints(param: {mediaTypes: ?MediaTypes, mediaConstraints: ?MediaStreamConstraints}): MediaStreamConstraints Obtains current enabled media stream constraints. |
|
public |
Return the media constraints configured for the call |
|
public |
Return the media types configured for the call |
|
public |
Returns the local video stream |
|
public |
Returns a boolean value indicating if the call has a local audio track |
|
public |
Returns a boolean value indicating if the call has a local video track |
|
public |
Returns a boolean value indicating if local audio is muted |
|
public |
Returns a boolean value indication if local video is muted |
|
public |
Mutes or unmutes the audio. |
|
public |
Mutes or unmutes the video. |
|
public |
setActiveAudioInputDevice(audioInputDevice: MediaDeviceInfo): Promise Updates the audio input device in used to the specified one |
|
public |
setActiveVideoInputDevice(videoInputDevice: MediaDeviceInfo): Promise Updates the video input device in used to the specified one |
|
public |
setAvailableAudioInputDevices(availableAudioInputDevices: MediaDeviceInfo[]): Promise Replaces the list of available audio input devices |
|
public |
setAvailableVideoInputDevices(availableVideoInputDevices: MediaDeviceInfo[]): Promise Replaces the list of available video input devices |
|
public |
async setMediaConstraints(mediaConstraints: MediaStreamConstraints) Update constraints of local media. |
|
public |
async setMediaTypes(mediaTypes: MediaTypes) Update the enabled local media. |
|
public |
Changes the local video stream to the next available camera. |
|
public |
async toggleScreen(screen: boolean) Shares the screen. |
|
public |
toggleVideo(video: boolean): Promise Enables or disables the video. |
Public Members
public emitter: EventEmitter source
Public Methods
public async addVideo(): Promise<void> source
Updates media types adding video when screen is false or adds an internal mark to know video must be enabled when screen sharing ends.
public canToggleCamera(): boolean source
Indicates if it is possible to change to a different camera
public getAvailableAudioInputDevices(): MediaDeviceInfo[] source
Returns the list of available audio input devices
public getAvailableAudioOutputDevices(): MediaDeviceInfo[] source
Returns the list of available audio output devices
public getAvailableVideoInputDevices(): MediaDeviceInfo[] source
Returns the list of available video input devices
public getCurrentMediaConstraints(param: {mediaTypes: ?MediaTypes, mediaConstraints: ?MediaStreamConstraints}): MediaStreamConstraints source
Obtains current enabled media stream constraints. This is a combination of the media stream constraints configured for the call and the current media types.
Params:
Name | Type | Attribute | Description |
param | {mediaTypes: ?MediaTypes, mediaConstraints: ?MediaStreamConstraints} |
public getMediaConstraints(): MediaStreamConstraints source
Return the media constraints configured for the call
public hasAudioTrack(): boolean source
Returns a boolean value indicating if the call has a local audio track
public hasVideoTrack(): boolean source
Returns a boolean value indicating if the call has a local video track
public muteAudio(mute: boolean) source
Mutes or unmutes the audio. If no parameter is specified it toggles current value.
Params:
Name | Type | Attribute | Description |
mute | boolean |
|
If specified forces audio to be mute or unmute |
public muteVideo(mute: boolean) source
Mutes or unmutes the video. If no parameter is specified it toggles current value.
Params:
Name | Type | Attribute | Description |
mute | boolean |
|
When specified forces video to be mute or unmute |
public setActiveAudioInputDevice(audioInputDevice: MediaDeviceInfo): Promise source
Updates the audio input device in used to the specified one
Params:
Name | Type | Attribute | Description |
audioInputDevice | MediaDeviceInfo |
|
If no value is specified the default one is selected |
public setActiveVideoInputDevice(videoInputDevice: MediaDeviceInfo): Promise source
Updates the video input device in used to the specified one
Params:
Name | Type | Attribute | Description |
videoInputDevice | MediaDeviceInfo |
|
If no value is specified the default one is selected |
public setAvailableAudioInputDevices(availableAudioInputDevices: MediaDeviceInfo[]): Promise source
Replaces the list of available audio input devices
Params:
Name | Type | Attribute | Description |
availableAudioInputDevices | MediaDeviceInfo[] | The list of MediaDeviceInfo objects to be used as audio input |
public setAvailableVideoInputDevices(availableVideoInputDevices: MediaDeviceInfo[]): Promise source
Replaces the list of available video input devices
Params:
Name | Type | Attribute | Description |
availableVideoInputDevices | MediaDeviceInfo[] | The list of MediaDeviceInfo objects to be used as audio input |
public async setMediaConstraints(mediaConstraints: MediaStreamConstraints) source
Update constraints of local media. This feature is only available when the call has already been connected if "media-update" capability is present.
Params:
Name | Type | Attribute | Description |
mediaConstraints | MediaStreamConstraints | The requested media constraints |
Example:
const audio = true;
const video = {
height: 256,
width: 256,
};
await call.setMediaConstraints({audio, video});
console.log("media updated");
public async setMediaTypes(mediaTypes: MediaTypes) source
Update the enabled local media. This feature is only available when the call has already been connected if "media-update" capability is present.
Params:
Name | Type | Attribute | Description |
mediaTypes | MediaTypes | The requested media |
Example:
await call.setMediaTypes({audio: true, video: false, screen: false});
console.log("media updated");