MediaRenderer
It is the wrapper for the HTMLMediaElement and its MediaStream. You can get this object on the HardwareEvents.MediaRendererAdded and HardwareEvents.MediaRendererRemoved for local media. For remote media sources, you can get an instance of this object from Endpoint or EndpointEvents.RemoteMediaAdded or EndpointEvents.RemoteMediaRemoved
Methods
disable
disable(): void
Stops receiving incoming media stream from the server. Trigger the EndpointEvents.MediaRenderDisabled event with the reason MediaRenderDisablingReason.Manual
Returns
type:
void
enable
enable(): void
Starts receiving incoming media stream from the server if the one has been disabled via MediaRenderer.disable
Returns
type:
void
playElement
playElement(): void
Returns
type:
void
render
render(container: HTMLElement
): void
Render (display) current instance of MediaRenderer to the HTMLElement in the DOM tree. If the container paramater is not specified, the method appends rendering to the body element. The method allows to render manually in cases of:
- Default rendering is turned off. If you subscribe to the EndpointEvents.RemoteMediaAdded event, Web SDK no longer renders the remote audio/video stream automatically so you have to call this method with optional container parameter.
- default rendering is active, but you want to change rendering container. Call the method with the specified HTMLElement.
Parameters
container:
HTMLElement
Optionalplace for rendering.
Returns
type:
void
requestVideoSize
requestVideoSize(width: number
, height: number
): Promise<void>
Returns the nearest simulcast layer to the requested resolution. Only for conferences in the simulcast mode.
Parameters
width:
number
height:
number
Returns
type:
Promise<void>
setVolume
setVolume(level: number
): void
Set current MediaRenderer output volume. The range is from 0 to 1.
Parameters
level:
number
Returns
type:
void
useAudioOutput
useAudioOutput(id: string
): Promise<void>
Set the output audio device for current MediaRenderer. ID can be retrieved via the AudioDeviceManager.getOutputDevices method.
Parameters
id:
string
Returns
type:
Promise<void>
Props
element
element: HTMLMediaElement
HTML element where rendering is executed.
enabled
enabled: boolean
id
id: string
Unique ID of MediaRender
isLocal
isLocal: boolean
Source of the media stream. Set to "true" for the local streams, "false" for the remote streams.
kind
kind:
Describe the tag and type of media that is placed in this container.
- Kind "audio" means <audio> HTML element and sound-only media stream
- Kind "video" means <video> HTML element and either video-only or audio plus video media stream
- Kind "sharing" the same as kind "video", but literally tell you "This is screen sharing"
receiverTransform
receiverTransform: TransformStream
simulcastMode
simulcastMode: auto
| manual
stream
stream: MediaStream
A source stream sended from/to some Endpoint. The type of a stream is specified via the MediaRenderer.kind property. You can use the property for modifying and filtering source streams. E.g. for face masks and CV (computer vision).
videoSize
videoSize: {height: number, width: number}