iOS Restricting Orientation

Ask questions about the iOS API here

iOS Restricting Orientation

Postby ayazalavi » Thu Feb 07, 2013 12:39 am

Hi,

How to restrict app to publish and subscribe only in portrait orientation. Even if I override the UIViewController's shouldRotateInterfaceOrientation method and return NO but still video is being published in and subscribed in both orientations.

Thanks
Ayaz Alavi
Was this post helpful? (0)
ayazalavi
 
Posts: 9
Joined: Mon May 14, 2012 10:35 am
Thumbs Up: 0

Re: iOS Restricting Orientation

Postby ayazalavi » Thu Feb 07, 2013 9:54 am

My app is running in 2 devices chatting with each other both in portrait mode. There is some black screen at the top and bottom for subscriber. How can I have full screen video chat between different devices like iphone, ipad etc.

Thanks
Was this post helpful? (0)
ayazalavi
 
Posts: 9
Joined: Mon May 14, 2012 10:35 am
Thumbs Up: 0

Re: iOS Restricting Orientation

Postby charley » Thu Feb 07, 2013 10:24 am

Please post the OpenTok version banner that posts in NSLog when the first OTSession instance is initialized.

Portrait mode is not supported on the Flash-compatible version of the SDK, however is available in the WebRTC-compatible version of the SDK.
Was this post helpful? (0)
charley
 
Posts: 463
Joined: Fri May 06, 2011 7:41 pm
Thumbs Up: 36

Re: iOS Restricting Orientation

Postby ayazalavi » Thu Feb 07, 2013 12:49 pm

yes it is latest WebRTC version. How can I have same resolution for both users.
Was this post helpful? (0)
Last edited by ayazalavi on Thu Feb 07, 2013 12:52 pm, edited 1 time in total.
ayazalavi
 
Posts: 9
Joined: Mon May 14, 2012 10:35 am
Thumbs Up: 0

Re: iOS Restricting Orientation

Postby charley » Thu Feb 07, 2013 12:50 pm

Please post the OpenTok version banner that posts in NSLog when the first OTSession instance is initialized.
Was this post helpful? (0)
charley
 
Posts: 463
Joined: Fri May 06, 2011 7:41 pm
Thumbs Up: 36

Re: iOS Restricting Orientation

Postby ayazalavi » Thu Feb 07, 2013 12:54 pm

before sessionsDidConnect we have this on the log.

2013-02-07 21:37:47.345 Treasure M.[2558:707]
2013-02-07 21:37:47.355 Treasure M.[2558:707] ------------------------------------------------
2013-02-07 21:37:47.361 Treasure M.[2558:707] OpenTok iOS Library
2013-02-07 21:37:47.366 Treasure M.[2558:707] Release version built on Nov 5 2012 at 15:49:49
2013-02-07 21:37:47.372 Treasure M.[2558:707] This version of the OpenTok iOS SDK is for P2P sessions only
2013-02-07 21:37:47.377 Treasure M.[2558:707] Copyright 2012 Tokbox, Inc.
2013-02-07 21:37:47.382 Treasure M.[2558:707] Licensed under the Apache License, Version 2.0
2013-02-07 21:37:47.387 Treasure M.[2558:707] ------------------------------------------------
2013-02-07 21:37:47.430 Treasure M.[2558:707] OpenTok API Server: api.opentok.com
Was this post helpful? (0)
ayazalavi
 
Posts: 9
Joined: Mon May 14, 2012 10:35 am
Thumbs Up: 0

Re: iOS Restricting Orientation

Postby charley » Thu Feb 07, 2013 1:35 pm

You should be able to set a frame with a portrait aspect ratio (4:3). The only issue that I've seen with this is that if the status bar does not respond to rotation (the whole window of the UI hierarchy), the publisher will not pick up this update. Is the rest of your view hierarchy rotating with the device?
Was this post helpful? (0)
charley
 
Posts: 463
Joined: Fri May 06, 2011 7:41 pm
Thumbs Up: 36

Re: iOS Restricting Orientation

Postby ayazalavi » Thu Feb 07, 2013 1:45 pm

nope rest of the view hierarchy is not rotating.

I need to know how to make both users have full screens of video streaming instead of black parts with same orientation.
Was this post helpful? (0)
ayazalavi
 
Posts: 9
Joined: Mon May 14, 2012 10:35 am
Thumbs Up: 0

Re: iOS Restricting Orientation

Postby charley » Thu Feb 07, 2013 1:51 pm

Try unlocking rotation of the entire window to make sure at the rotation auto-update works properly on the OpenTok publisher. If the issue that you've got the device locked in a position that is not the same as the initial orientation of the publisher, it's possible we'll have to patch in order for you to get this functionality. Alternately, you can keep the window rotation locked and manually rotate the frame of the video view to fit your locked orientation.
Was this post helpful? (0)
charley
 
Posts: 463
Joined: Fri May 06, 2011 7:41 pm
Thumbs Up: 36

Re: iOS Restricting Orientation

Postby ayazalavi » Fri Feb 15, 2013 1:59 pm

I dived into the issue little deeper and the real issue is that publisher is publishing in opposite orientation to the orientation of the device for e.g. if orientation is in portrait then it is publishing in landscape and if orientation of device is in landscape then it is appearing as portrait on other device. What might be the issue. Following is the code i am using for connecting publisher.

Code: Select all
- (void)doPublish
{
    _publisher = [[OTPublisher alloc] initWithDelegate:self];
    [_publisher setName:[[UIDevice currentDevice] name]];
    [_session publish:_publisher];
    [_publisher.view setFrame:CGRectMake(0, 0, self.publisherView.frame.size.width, self.publisherView.frame.size.height)];
    [self.publisherView addSubview:_publisher.view];
   
}
Was this post helpful? (0)
ayazalavi
 
Posts: 9
Joined: Mon May 14, 2012 10:35 am
Thumbs Up: 0

Re: iOS Restricting Orientation

Postby charley » Tue Feb 19, 2013 11:38 am

I'm having a trouble visualizing your description, would you mind attaching a screencap?
Was this post helpful? (0)
charley
 
Posts: 463
Joined: Fri May 06, 2011 7:41 pm
Thumbs Up: 36


Return to iOS (Native)



Who is online

Users browsing this forum: No registered users and 1 guest

cron