zevarito/Licode-ErizoClientIOS

Remote Video Frame Size

Closed this issue · 7 comments

@zevarito

In MultiConferenceViewController.m you defined remote video size to some constant:

//Remote video view size
static CGFloat vWidth = xx;
static CGFloat vHeight = xx;

It may break the video aspect ratio. Can I get remote width and height of frame on subscription

  • (void)room:(ECRoom *)room didSubscribeStream:(ECStream *)stream {

    (from ECStream class)?? Your help is needed regarding this.

Or is there any possibility to set scale / render mode in ECPlayerView to some like: aspect fill or aspect fit etc.

@ashar02 Right, you should setup the frame for ECPlayerView already knowing the Video Track aspect ratio. Let me explore a better way to handle this and I'll be back with you.

@zevarito how can you get the Video Track aspect ratio from ECPlayerView?

@ashar02 do you have a fix for this in your own fork?

Hi Guys. Is there a way to do a true "aspect fill" within the boundaries of the playerView? I am looking for a solution where the aspect ratio is preserved, cropping the video if necessary. Is this something in the work? Many thanks.

Hi @vrevidat, there are not plans to add such a feature to the lib, for now it relies on application decision. If you got a good solution that you want to share or think that might be incorporated to the codebase please submit a PR. Sorry can't help more.

@zevarito
I used this method - (void)videoView:(RTCEAGLVideoView*)videoView didChangeVideoSize:(CGSize)size which belongs to RTCEAGLVideoViewDelegate to make remote video aspect fit or fill.
Initially I assumed that video has aspect ratio of 4:3 and then whenever it is called I use to adjust it accordingly. I hope it will help others too.

I solve the problem in the same way from App side so let's close this issue.