views:

156

answers:

2

I need to send video output to an external video screen from my iphone app. I am using the Apple Composite AV Cable. I get video output when I am playing a video through the ipod app, but when I do

[[UIScreen screens] count];

I only get one screen, the main phone screen. For my app I need to have a completely separate window like the process here:

Support for External Displays and Projectors An iPad can now be connected to an external display through a supported cable. Applications can use this connection to present content in addition to the content on the device’s main screen. Depending on the cable, you can output content at up to a 720p (1280 x 720) resolution. A resolution of 1024 by 768 resolution may also be available if you prefer to use that aspect ratio.

To display content on an external display, do the following:

Use the screens class method of the UIScreen class to determine if an external display is available. If an external screen is available, get the screen object and look at the values in its availableModes property. This property contains the configurations supported by the screen. Select the UIScreenMode object corresponding to the desired resolution and assign it to the currentMode property of the screen object. reate a new window object (UIWindow) to display your content. Create a new window object (UIWindow) to display your content. Assign the screen object to the screen property of your new window. Configure the window (by adding views or setting up your OpenGL ES rendering context). Show the window.

All that is here in a more readable format. I am working on an iphone, not an ipad, but the documentation says that external screens are now supported for iphones in ios4.

How can I get the phone to realize there is another screen attached? thanks

A: 

[[UIApplication sharedApplication] performSelector: @selector(startTVOut) withObject:nil afterDelay:.1]

niklassaers
isn't this the pre ios4 undocumented way of doing tv out?
Jonathan
Thanks nik. I think it is. Unfortunately the iso4 public api looks to me like it only works with VGA out (although I couldn't find this written anywhere) and the device I am trying to output to is component.
aks
I was hoping for an apple approved way to do this, but since I think that doesnt exist im marking this as the best answer.
aks
A: 

For posterity,

my problem was that I was using an iPhone 3GS. The ios4 video out stuff needs an iPhone 4 (it also works in 3.2 for the ipad i hear). With an iphone 4 I was able to get composite video out.

aks