QuickBlox iOS WebRTC Video View Size - ios

I'm trying to get my QBRTCRemoteVideoView to present a full-screen video output, similar to FaceTime or Skype.
However, using AutoLayout in my project, and setting the constraints to lead and trail to the superview, the video I get back does not follow those constraints. It shows with black borders on the top and bottom.
Even using the following properties:
videoFormat.width = 320; // or anything
videoFormat.height = 568; // or anything
Does not seem to change the dimensions of the video. Any advice for me here on controlling the video output view?

You can only set a specific width and height for video, to see what kind of video formats are supported by your device, call:
[QBRTCCameraCapture formatsWithPosition:AVCaptureDevicePositionFront];
// or AVCaptureDevicePositionBack
// or just get the currentPosition from your QBRTCCameraCapture instance

Related

Swift / React Native How to know split view / slide over app's position relative to the whole screen?

I'm making a react-native based app, and I can partially use Swift code by react-native's NativeModule feature.
My app will be used as Split view / Slide over mode in iPad, and I want to know if my app is in the left-side, right-side, or Slide-over.
I could get width and height, also origin (CGPoint) by this code.
let window = UIApplication.shared.windows.first
// Then getting X, Y like this...
window.frame.origin.x
Now my app has only one webview, made by react-native-webview.
So I guess, since the webview is the whole content of the app, and it fills app 100%, so it always returns app.
I want to know, not in webView's perspective, but in app's perpective, the POSITION relative to the screen.
For example, if my iPad width is 1400, and if my app is on the half right side, x should be 700.
And if it is on left side, it should be 0.
I really struggled this, but couldn't find any solution.
FYI, I drawed a diagram for this question.
As I wrote on the above, I tried UIApplication.shared.windows.first.frame.
But it only show the CGPoint of webview, not app relative to the screen.
There is no API for getting 'X' or 'LEFT' in react-native-dimension too.
onLayout also not helpful.

YTPlayer play video in specific frame width and height

I want to play YouTube video in specific view size. currently I'm unable to play video in full view size.
You can check the below image where black part is displaying in both left and right side.
First of all, you should set your custom YTPlayerView with content mode equal to "scale to fill". Next, you should set the playsinline property to 0.
Here below I show you a little example:
var playerVars:Dictionary =
["playsinline":"0", // 1 in view or 0 fullscreen
"autoplay":"1", // Auto-play the video on load
"modestbranding":"1", // without button of youtube and giat branding
"rel":"0",
"controls":"0", // Show pause/play buttons in player
"fs":"1", // Hide the full screen button
"origin":"https://www.example.com",
"cc_load_policy":"0", // Hide closed captions
"iv_load_policy":"3", // Hide the Video Annotations
"loop":"0",
"version":"3",
"playlist":"",
"autohide":"0", // Hide video controls when playing
"showinfo":"0"] // show related videos at the end
self.playerView.load(withVideoId: videoId, playerVars: playerVars)
Remember if you want a good resolution inside your view using a 16:9 view when you try to play a 4:3 video you have always black side parts and this behaviour is correct and reasonable.
If you want more specific details about your request you can find interesting information in this page (a page related to the official gitHub Youtube sources)

AVCam Demo OverscanCompensation implementation

I'm currently working with the AVCam demo app to present a live camera feed over airplay or apple hdmi adapter for import into a HD camera switcher.
The issue I'm having is with OverScanCompensation to remove the huge black border from the mirrored view.
The only documentation I have found is to implement the screen.overscanCompensation = 3; method someplace? I have tried to put it into viewDidLoad and it will let me, but it doesn't change anything on the external view?
I had success of sorts with the Airplay Demo (quellish) using UIImagePicker, but I would much prefer to implement AVFoundation for this exercise.
Is there a better way to achieve what I'm looking for without having to implement separate view controllers?
All you need to do is, upon setting up the external screen (via, say, if ([[UIScreen screens] count] > 1) externalScreen = (UIScreen *)[[UIScreen screens] objectAtIndex:1];), set the overscanCompensation property of the above UIScreen instance to UIScreenOverscanCompensationInsetApplicationFrame (=2). It'll entirely get rid of both the border (overscanning) and image quality-deterioating scaling.
See http://www.iphonelife.com/blog/87/tv-display-output-why-does-your-picture-have-black-border-and-how-can-it-be-fixed for more info.

Underscan issue with AirPlay mirroring

I'm having some issues with AirPlay. The thing is, I'm developing with the ATV3, and my TV set supports 1080p. But when I start screen mirroring and receive the new instance of UIScreen, the bounds and the applicationFrame are both giving me a 720p resolution.
But it gets weird when I actually moved the subviews to a negative value, and the whole screen gets covered. So, technically my iPhone is streaming at 1080p, but the bounds returned by the UIScreen are underscanned.
I've tried modifying the overscanCompensation before getting the bounds or the applicationFrame (tried both with all 3 overscanCompensation values available) but I'm still getting the same result.
Here is a picture of what I'm getting (sorry, it's the worst picture in the planet, I know, but I was using my phone to stream the image to the ATV :) )
Red view is the 720p reported by bounds.
It gets even weirder when I actually try this out in my ATV2 (it is supposedly limited to 720p even if it supports 1080p) and the result is exactly the same.
Anyway, if someone knows the method to get the real screen display to avoid putting a settings view in my app, I'll really appreciate it.
Thanks in advance :)
When you mentioned that you tried all 3 overscanCompensation modes, I presume you mean the 3 documented modes:
typedef enum {
UIScreenOverscanCompensationScale,
UIScreenOverscanCompensationInsetBounds,
UIScreenOverscanCompensationInsetApplicationFrame,
} UIScreenOverscanCompensation;
However, there is a fourth mode, which is not there, but should fix your problems: just set your overscanCompensation to 3.
Also, take a look at this SO question.
The answer of Ivan solved the same issue for me! But I also had the borders when using AirPlay Mirroring. I got rid of the borders without setting the overscanCompensation property by changing a setting on my Apple TV: try setting 'Settings > Audio & Video > Adjust For AirPlay Overscan' to Off (default On).
The setting that works best for most TVs is:
externalScreen.overscanCompensation = UIScreenOverscanCompensationInsetBounds | UIScreenOverscanCompensationInsetApplicationFrame; // this is the same as setting it to 3
Just setting it to UIScreenOverscanCompensationInsetApplicationFrame can cause misalignment of the UIWindow contents.
3 is a bitmask of UIScreenOverscanCompensationInsetBounds(1) and UIScreenOverscanCompensationInsetApplicationFrame(2) for those wondering where that number comes from and why it works.

Admob AdSize for Ipad

Hi friends now i am developing Ads for Ipad,I am Using Admob.i have a small problem.
in admob documentation itself adsize in portrait view is 728x90.i want to change adsize to 768x90 to fit exactly in screen.i have changed frame by calling setFrtame for AdBannerView but it cant changes the size
*is it possible to change add size...? and at the same time i nee to show add in landscape with size 1024x90 *
Here is My Code
[AdmobBanner setFrame:CGRectMake(0,0,768,90)]; //Portrait
[AdmobBanner setFrame:CGRectMake(0,0,1024,90)]; //Landscape
Can any one help me to find the solution For this
AdMob currently supports only few ad dimensions. There is no way how to set your own size. Best thing to do would be to insert your ad into some kind of visual container with proper dimensions and fill rest of the screen with appropriate graphics

Resources