Author Message
ajay011
Joined: Aug 8, 2017
Messages: 11
Offline
Hi Guys.. I am using android client SDK for placing video call. I'm successfully able to make video call, but the remote streaming of call is not taking entire screen however i have set height and width of layout to match_parent. So please help me to achieve full screen remote streaming of video call without affecting it's aspect ratio.
Pavel_K
Joined: Dec 20, 2016
Messages: 67
Offline
I've replied in https://www.devconnectprogram.com/forums/posts/list/21259.page
ajay011
Joined: Aug 8, 2017
Messages: 11
Offline
Thanks for reply but i am looking for solution in Android. Please explain the same in android.
Pavel_K
Joined: Dec 20, 2016
Messages: 67
Offline
1. Add video size changed listener to calculate aspect ration like this:

VideoSource videoSourceRemote = videoInterface.getRemoteVideoSource(channelId);
if (videoSourceRemote != null) {
videoSourceRemote.setVideoSink(videoLayerRemote);
VideoLayerListener videoLayoutListener = new VideoLayerListener() {
@Override
public void onVideoFrameSizeChanged(int width, int height) {
int videoAspectRatio = width/height;
}
};
videoLayerRemote.setListener(videoLayoutListener);



2. Use videoAspectRatio to calculate the frame size; given the maximum size available from the parent view, and the video aspect ratio:

if (maxSize.width / maxSize.height > videoAspectRatio)
{
// parent is wider than the video, plan for black bars left and right
maxSize.width = maxSize.height * videoAspectRatio;
}
else
{
// parent is taller than the video, plan for black bars top and bottom
maxSize.height = maxSize.width / videoAspectRatio;
}


Go to:   
Mobile view