- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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)
into UIViewContentModeScaleAspectFill
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
-(void)layoutSubviews{
screenSize = [UIScreen mainScreen].bounds;
//mask localVideo
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;
// remoteVideo
CGRect remoteVideoViewFrame=CGRectZero;
remoteVideoViewFrame.origin.x = 0;
remoteVideoViewFrame.origin.y = 0;
remoteVideoViewFrame.size.width = screenSize.size.width;
remoteVideoViewFrame.size.height = screenSize.size.height;
_remoteVideoView.frame=remoteVideoViewFrame;
_remoteVideoView.contentMode=UIViewContentModeScaleAspectFill; // <-- Change contentModel here
[_remoteVideoView setSize:CGSizeMake(remoteVideoViewFrame.size.width, remoteVideoViewFrame.size.height)];
}
- Tags:
- HTML5
- JavaScript*
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Zhen,
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jianjun Z. (Intel) wrote:
Hi Zhen,
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!

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page