Subscribing to audio or video only
By default, a Subscriber object is initialized to subscribe to audio and video, if they are available.
When you subscribe to a stream, you can specify whether to initially subscribe to audio or video (if they are available). For example, the following code subscribes to the audio stream only:
After you create a Subscriber object, you toggle audio on or off by calling the subscribeToAudio() method of the Subscriber object:
You toggle video on or off by calling the subscribeToVideo() method of the Subscriber object:
Note however that you can only subscribe to audio or video if the client publishing the stream includes audio or video. For example, calling subscribeToVideo(false) will have no effect if the client publishing the stream is publishing audio only.
Adjusting audio and video
Learn more about manipulating audio and video of Vonage Video API streams for your application. Publish only video or audio, adjust the frame rate, and more.