I’m publishing Camera stream in a session and the Publisher and Subscribers token is created with below property
kurentoOptions: {“videoMaxRecvBandwidth”:256,“videoMaxSendBandwidth”:256}
Now i have to switch the stream from Camera to Screen share and for that what i am doing is
// I have an ‘oldPublisher’ publishing to the session and want to change it for a new one with different properties
var newPublisher = OV.initPublisher(
‘DIV-To-Insert-Video’,
newPublisherProperties,
);
newPublisher.once(‘accessAllowed’, () => {
session.unpublish(oldPublisher);
session.publish(newPublisher);
});
But i want to change the Max Receive and Max Send bandwidth from 256 to 512 for the Publisher as well as Subscribers, How can i do this?
In a simple way my requirement is when stream is Camera then bandwidth should be 256 and for Screen share it should be 512.
so use publisher properties for doing this, decrease resolution of video streaming
@vipin_mishra, that would not help actually because my case is Publisher is sending higher bandwidth but subscriber is not able to receive that much due to “videoMaxReceiveBandwidth” limitation set during Token creation.
When switching from CAMERA(max cap is set to 256) to SCREEN Share mode, Publisher is sending with 512 Kbps and expectation is Subscriber should also be able to receive it with max up to 512 kbps. But when subscriber’s token was created(to subscribe CAMERA stream) there was a cap of " videoMaxRecvBandwidth=256 and same token is being used to subscribe SCREEN share stream.
It seems in OpenVidu you can not change the videoMaxRecvBandwidth dynamically for the same token.
However i tried different approach and seems it’s working. I removed the " videoMaxRecvBandwidth" parameters while creating token for Subscribers. Max receive and send bandwidth limitation is only set at Publisher side and is being controlled by two different tokens (1 token for Camera stream with max cap of 256 and 2’nd token for Screen Share stream with max cap of 512). So max Receive Bandwidth of Subscribers is what Publisher’s max Send Bandwidth is.
OK Yeah now I understood .
Thanks for sharing your solution
Regards
Vipin