summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLiong Sauw Ming <ming@teluu.com>2015-03-31 04:59:54 +0000
committerLiong Sauw Ming <ming@teluu.com>2015-03-31 04:59:54 +0000
commitfc15a7f4f931ee42c808ae849e99d4c80b746cba (patch)
treea072ebc196a008e5d185479e3202c6ca97fcd40a
parentc584a1dc94f5aa4cab2f70dd01dc817e7597de8f (diff)
Re #1782 (misc): Improve layout in ipjsua sample app, so it can display both preview and incoming video together.
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@5041 74dad513-b988-da41-8d7b-12977e46ad98
-rw-r--r--pjsip-apps/src/pjsua/ios/ipjsua/ipjsuaAppDelegate.m10
1 files changed, 8 insertions, 2 deletions
diff --git a/pjsip-apps/src/pjsua/ios/ipjsua/ipjsuaAppDelegate.m b/pjsip-apps/src/pjsua/ios/ipjsua/ipjsuaAppDelegate.m
index 34be6262..4c88fd2f 100644
--- a/pjsip-apps/src/pjsua/ios/ipjsua/ipjsuaAppDelegate.m
+++ b/pjsip-apps/src/pjsua/ios/ipjsua/ipjsuaAppDelegate.m
@@ -237,12 +237,18 @@ void displayWindow(pjsua_vid_win_id wid)
UIView *parent = app.viewController.view;
UIView *view = (__bridge UIView *)wi.hwnd.info.ios.window;
- if (view && ![view isDescendantOfView:parent]) {
+ if (view) {
dispatch_async(dispatch_get_main_queue(), ^{
/* Add the video window as subview */
- [parent addSubview:view];
+ if (![view isDescendantOfView:parent])
+ [parent addSubview:view];
if (!wi.is_native) {
+ /* Resize it to fit width */
+ view.bounds = CGRectMake(0, 0, parent.bounds.size.width,
+ (parent.bounds.size.height *
+ 1.0*parent.bounds.size.width/
+ view.bounds.size.width));
/* Center it horizontally */
view.center = CGPointMake(parent.bounds.size.width/2.0,
view.bounds.size.height/2.0);