Dynamically add video/audio tracks

Hello. I am using the OpenVidu service for a video call in our company Android application.

There are some functionalities that I would like to add to the call and I want some advice from you about those.

  1. I want to dynamically toggle the video or audio tracks from the call. Which means that
  • for the Audio, when i mute the microphone of the device i want also to remove the track from the connection and when i press it again i want to add it.
  • for the Video, same as above, when i close the camera i want to remove the videoTrack from the call and when i press again to add it back again.

All these without ending the call. What is the proper way of doing this?

  1. I want to set, at the beginning of the call, the FPS and the resolution (width, height) of the video that i send to the participants. I do this in two places
  • In the PublishVideo function publishVideoParams[“videoDimensions”] = “{“width”:” + videoHeader.width + “, “height”:” + videoHeader.height + “}”
  • In the LocalParticipant VideoCapturer videoCapturer.startCapture(videoHeader.width, videoHeader.height, videoHeader.fps)

However, i can clearly see that the video that i send not corresponding to the changes i make. Is there something that I miss?

@CSantosM do you have any hint on how to change publisher resolution in the Android demo application?

Best regards

I got an email from the technical support team that specified that the current version does not support publisherVideoResolution change on demand. I am still searching for a solution!

Adding and removing tracks dynamically is not possible in OpenVidu.

We are working on it, but we don’t know when it will be available.

I guess there is a way to do that through the onStreamPropertyChanged callback with videoActive/audioActive set to true or false respectively