Rate this page:

IVideoStream

Interface that may be used to handle add/remove video events on local and remote sides.

Methods

addVideoRenderer

Copy URL

void

addVideoRenderer(

VideoSink

videoRenderer,

RenderScaleType

scaleType
)

Add a new video renderer to the video stream.

It is recommended to use SurfaceViewRenderer for the most of cases.

The render view can be associated with only one video stream in a call. If it's assigned to multiple streams, it will be associated with the last one.

In case of a custom implementation of com.voximplant.webrtc.VideoSink interface:

  • Implementations should call frame.retain() if they need to hold a reference to the frame after VideoSink.onFrame(VideoFrame) returns. Each call to retain() should be followed by a call to frame.release() when the reference is no longer needed.
  • See ClientConfig parameters to set up video frame format

Parameters

  • videoRenderer:

    VideoSink

    com.voximplant.webrtc.SurfaceViewRenderer or a custom implementation of com.voximplant.webrtc.VideoSink

  • scaleType:

    RenderScaleType

    scaling type for a new video renderer

Returns

  • type:

    void

addVideoRenderer

Copy URL

void

addVideoRenderer(

VideoSink

videoRenderer,

RenderScaleType

scaleType,

RendererCommon.RendererEvents

rendererEventsListener
)

Add a new video renderer to the video stream.

Parameters

  • videoRenderer:

    VideoSink

    com.voximplant.webrtc.SurfaceViewRenderer or a custom implementation of com.voximplant.webrtc.VideoSink

  • scaleType:

    RenderScaleType

    scaling type for a new video renderer

  • rendererEventsListener:

    RendererCommon.RendererEvents

    Listener to handle the first frame rendered and frame resolution changed events.

Returns

  • type:

    void

getVideoStreamId

Copy URL

String

getVideoStreamId()

Get the video stream id.

Returns

  • type:

    String

getVideoStreamType

Copy URL

VideoStreamType

getVideoStreamType()

Get the video stream type

Returns

removeVideoRenderer

Copy URL

void

removeVideoRenderer(

VideoSink

videoRenderer
)

Remove a previously added video renderer

Parameters

  • videoRenderer:

    VideoSink

    com.voximplant.webrtc.SurfaceViewRenderer or a custom implementation of com.voximplant.webrtc.VideoSink

Returns

  • type:

    void