Rate this page:

MediaRenderer

It is the wrapper for the HTMLMediaElement and its MediaStream. You can get this object on the HardwareEvents.MediaRendererAddedand HardwareEvents.MediaRendererRemovedfor local media. For remote media sources, you can get an instance of this object from Endpointor EndpointEvents.RemoteMediaAdded or EndpointEvents.RemoteMediaRemoved

Props

element

Copy URL
element: 

HTMLMediaElement

HTML element where rendering is executed.

isLocal

Copy URL
isLocal: 

boolean

Source of the media stream. Set to "true" for the local streams, "false" for the remote streams.

kind

Copy URL
kind: 

audio

|

video

|

sharing

Describe the tag and type of media, which are 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"

stream

Copy URL
stream: 

MediaStream

A source stream sended from/to some Endpoint. The type of a stream is specified via the kindproperty.You can use the property for modifying and filtering source streams. E.g. for face masks and CV (computer vision).

id

Copy URL
id: 

string

Unique ID of MediaRender

Methods

render

Copy URL
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 will append rendering to the body element. The method allows to render manually in cases of:

  1. Default rendering was turned off. If you subscribe to the EndpointEvents.RemoteMediaAddedevent, Web SDK will no longer render remote audio/video stream automatically so you have to call this method with optional container parameter.
  2. default rendering is active, but you want to change rendering container. Call the method with the specified HTMLElement.

Parameters

  • container:

    HTMLElement

    Optional

    place for rendering.

Returns

  • type:

    void

setVolume

Copy URL
setVolume(level: 

number

):

void

Set current MediaRenderer output volume. The range is from 0 to 1.

Parameters

  • level:

    number

Returns

  • type:

    void

useAudioOutput

Copy URL
useAudioOutput(id: 

string

):

void

Set the output audio device for current MediaRenderer. ID can be retrieved via the AudioDeviceManager.getOutputDevicesmethod.

Parameters

  • id:

    string

Returns

  • type:

    void