I am trying to show a remote stream from a desktop camera.
The desktop camera has a resolution of 640 width and 480 height.
And I would like to show this stream into a full screen portrait phone...
Currently, the stream show up but it is skewed. I believe it is doing UIViewContentModeScaleToFill
So it scales the frame image and fit it in.
But when I change the content mode of remoteview (RTCEAGLVideoView *remoteVideoView)
it is still doing the same thing.
Do you guys know if it is a bug in my code? Or is this a known issue in the ios Webrtc library? Below is the layoutSubviews method in my streamView.m file
screenSize = [UIScreen mainScreen].bounds;
CALayer* maskLayer = [CALayer layer];
maskLayer.frame = CGRectMake(0,0,localVideoWidth ,localVideoWidth);
maskLayer.contents = (__bridge id)[[UIImage imageNamed:@"local_camera_mask"] CGImage];
_localVideoView.layer.mask = maskLayer;
remoteVideoViewFrame.origin.x = 0;
remoteVideoViewFrame.origin.y = 0;
remoteVideoViewFrame.size.width = screenSize.size.width;
remoteVideoViewFrame.size.height = screenSize.size.height;
_remoteVideoView.contentMode=UIViewContentModeScaleAspectFill; // <-- Change contentModel here
[_remoteVideoView setSize:CGSizeMake(remoteVideoViewFrame.size.width, remoteVideoViewFrame.size.height)];
Jianjun Z. (Intel) wrote:
It looks like contentMode does not work at this time. You can customize the way how video renders by creating a new view implements RTCVideoRenderer.
How to customsize the way? Could you provide a simple? Thanks a lot!