Interface: MediaStreamVideoSupplier

MediaStreamVideoSupplier

Any video source of MediaStream is required to implement MediaStreamVideoSupplier interface. The interface defines two methods: addVideoConsumer and removeVideoConsumer. MediaStream uses them to register and unregister itself as a consumer of video from the supplier. The supplier should use onVideoTrack method of MediaStream class to supply its video to every registered media stream. The supplier is expected to supply its video or null value (if the video isn't available yet) to every newly registering media stream, and the null value to every unregistering media stream.

Methods

addVideoConsumer(consumer)

Registers the specified MediaStream as a consumer of video from the supplier. It is expected that during the registration the supplier will use onVideoTrack method of MediaStream class to supply its video or null value (if the video isn't available yet) to the registering media stream.

Parameters:
Name Type Description
consumer MediaStream

The media stream which should be registered as a consumer of video from the supplier.

removeVideoConsumer(consumer)

Unregisters the specified MediaStream as a consumer of video from the supplier. It is expected that during the unregistration the supplier will use onVideoTrack method of MediaStream class to supply the null value to the unregistering media stream.

Parameters:
Name Type Description
consumer MediaStream

The media stream which should be unregistered as a consumer of video from the supplier.