Hello,
I am now able to identify the speed of the internet of the publisher in android. But once I know the speed of the network carrier(wifi or GSM) I want to reduce or vary the resolution of the stream on that device so that the client can still be in the call even though the resolution is much lesser.
How do I do this?
I understand that there is publishVideo() (but this is at the point of connecting with the media server)
public void publishVideo(SessionDescription sessionDescription) {
Map<String, String> publishVideoParams = new HashMap<>();
publishVideoParams.put(“audioActive”, “true”);
publishVideoParams.put(“videoActive”, “true”);
publishVideoParams.put(“doLoopback”, “false”);
publishVideoParams.put(“frameRate”, “30”);
publishVideoParams.put(“hasAudio”, “true”);
publishVideoParams.put(“hasVideo”, “true”);
publishVideoParams.put(“typeOfVideo”, “CAMERA”);
publishVideoParams.put(“videoDimensions”, “{“width”:” + STREAM_WIDTH + “, “height”:” + STREAM_HEIGHT + “}”); //320
publishVideoParams.put(“sdpOffer”, sessionDescription.description);
this.ID_PUBLISHVIDEO.set(this.sendJson(JsonConstants.PUBLISHVIDEO_METHOD, publishVideoParams));
}
And, in localparticipant we set the widthxheight to the camera for the stream
public void startCamera() {
final EglBase.Context eglBaseContext = EglBase.create().getEglBaseContext();
PeerConnectionFactory peerConnectionFactory = this.session.getPeerConnectionFactory();
// create AudioSource
AudioSource audioSource = peerConnectionFactory.createAudioSource(new MediaConstraints());
this.audioTrack = peerConnectionFactory.createAudioTrack("101", audioSource);
surfaceTextureHelper = SurfaceTextureHelper.create("CaptureThread", eglBaseContext);
// create VideoCapturer
VideoCapturer videoCapturer = createCameraCapturer();
VideoSource videoSource = peerConnectionFactory.createVideoSource(videoCapturer.isScreencast());
videoCapturer.initialize(surfaceTextureHelper, context, videoSource.getCapturerObserver());
videoCapturer.startCapture(STREAM_WIDTH, STREAM_HEIGHT, 30);
// create VideoTrack
this.videoTrack = peerConnectionFactory.createVideoTrack("100", videoSource);
// display in localView
this.videoTrack.addSink(localVideoView);
}
But how do I change the resolution dynamically?
Also, I am thinking about going for OpenVidu Pro! is there any change in the implementation on the client SDK there?
Thanks in advance!