iPhone connected to TV

Would be an awesome way to output a game to a recording device for nice YouTube promo videos! :slight_smile:

Martin

I gave it a shot, but I haven’t been able to get it to work.

//_window = [[UIWindow alloc] initWithFrame:rect];
_window = [[MPTVOutWindow alloc] initWithFrame:rect];

I’ll keep digging.

Sort of working – it’s not oriented right, or filling the screen.

In AppController.mm, put this near the top, after the import declarations:

@interface MPTVOutWindow : UIWindow  
- (id)initWithVideoView:(id)fp8;  
@end  

@interface MPVideoView : UIView  
- (id)initWithFrame:(struct CGRect)fp8;  
@end  

@implementation MPVideoView (extended)  
- (void) addSubview: (UIView *) aView  
{  
    [super addSubview:aView];  
}  
@end

Then, around line 284, comment out the call that creates the window, and replace it:

	// Create a full-screen window
	//_window = [[UIWindow alloc] initWithFrame:rect];

	MPVideoView *vView = [[MPVideoView alloc] initWithFrame: rect]; 	
	MPTVOutWindow *tvWindow = [[MPTVOutWindow alloc] initWithVideoView: vView];  
	[tvWindow makeKeyAndVisible];  
	
	EAGLView* view = [[EAGLView alloc] initWithFrame:rect];
	[vView addSubview:view];

Add the framework “MediaPlayer.framework” to the project, and you should be good to go. I’ve got to get back to my deadlines, if someone else can figure out the size and orientation issue, that would be great!

Wheeeee! Supercool!

I’ve been planning to use this feature since I first thought about iPhone development. Great going on getting this functional with Unity!

Remember that MPTVOutWindow isn’t a public class, so it’s not yet something you can use in an app you want to sell through the app store. (Unless you’re Google and the rules don’t apply to you.) Hopefully this will get documented soon.

What are the implications relative to Apple’s business plan? On what grounds would they block an app using this feature?

What would be nice would be to see this feature added to the Unity iPhone editor, for Steve-Jobs-at-MacWorld-like demonstration purposes.

As soon as Apple officially exposes it in the SDK, of course.

We can use screencasting software with the Unity editor.

I don’t want to sound overly negative, but really, I could not think of a more worthless application of outputting video to an external device. Yes there is an accelerometer, but the device is primarily a touch screen input connected to very small hardware that is currently unsuitable to drive a display of greater resolution (or maybe even its own resolution :roll:). It’s interesting to know about this, but I don’t even see this as having nerd appeal. What could possibly be the point, with the current product lineup?

to Jessy:
I totally understand that its not appealing to everyone but i think it would still be a very appealing fature to many people. Sure the graphics won´t look like those of a 360 or ps3 but i remember the not too long ago hype when a psp update allowed playing psp on the big screen in similar fashion. There is something nice about the idea of not having to look at the small screen but instead being able to look at a big one while holding the arms in more relaxed lowered position and maybe also sitting in more comforting position overall (Besides the point that its also more relaxing for the eyes than focusing on small screens for a long timespan).
Also i still remember back in snes days i had a super gameboy and although that basically only allowed to plug in game boy games into a snes cartridge in order to play them on the tv i liked that a lot. And yes, the game boy was of course even way weaker and you could basically only choose with which colors to replace the default (4 i think) “color” tones of the game boy. And man, i quite liked that, i felt like it added a lot of value to my games to be able to play em at home on the big screen.
The iphone is quite nicer compared to that and i feel like many game types would be worth playing on the tv even if they don´t have hd output.

to the others:
Very nice achievment :slight_smile: Would also love this to be a standard feature in unity :slight_smile:

I like it! :smile:

tommosaur, you’re not comparing the iPhone to anything similar to itself. The DS is the only other system that it can be related to right now. Everything else is a hodgepodge of input devices with a monitor built in (the DS can be used in this fashion too, of course, but the iPhone can’t). You can’t even compare a touchscreen to a Wacom tablet, because in order to see a cursor remotely, you would need to be “clicking” the whole time. There are some possibilities available due to multitouch, but the same game would not work on the touchscreen itself as it would with another screen.

I’m not denying that using a large stationary monitor with a handheld system can be great (after I got Super GameBoy, I never used an actual GameBoy again until the Advance came out), but the iPhone / iPod touch is not one of those systems. Not as they exist currently.

Jeremy, look at last week’s discussions on daringfireball.net and arstechnica.com regarding Google’s voice-activated iPhone app. The app used the proximity sensor, which is not in the public SDK. (You can do a class-dump on the frameworks and see all kinds of neat things not in the SDK.)

In the iPhone developer agreement that you signed, you agreed not to use anything that’s not in the public SDK in apps you upload to the app store.

And after Google’s public break from the rules, Apple has been scanning apps for symbols and selectors that are not public. (I know this for a fact, because an app I am working on was scanned and we got an email about our use of one such method).

Anyway, my fingers are crossed for the inclusion of MPTVOutWindow in the public SDK. It’s pretty awesome playing the game on the TV – the phone becomes sort of a wiimote type of controller.

Jessy: if you don’t like it, don’t use it. But I think it can be ver useful. I’ve already had the experience of trying to demo iPhone apps for groups of people, and it’s basically impossible. This will allow me to plug into a projector and show my app to a large group of people.

You can also have different things on the different displays. You could make the TV display have a 3D view, and the iPhone display show a bunch of controls. Sort of your very own DS. Check out the videos of Moto Racer (on Ars Technica or YouTube) playing on the big screen. I think it’s pretty compelling.

to Jessy: yeah, its a bit of a comparison of apples and oranges of course, there´s just nothing exactly like it :slight_smile:
I agree that playing it on tv won´t make sense for every game, just like it already doesn´t make sense in first place to make every game type for the iphone (unifitting control scheme etc) and still many do it.
I´m sure though that with time people will come up with nice uses for it.

haha,see, bliprob already listed a few nice use cases :slight_smile:
Also outside of games it could also be nice to use other apps on the big tv screen.

Let me be clear that my opinions above relate to the iPhone as a gaming device, as used with Unity. We already have a solution for this situation.

Wired controllers are dead. You want to make this for yourself, go right ahead, but don’t delude yourself into thinking people are actually going to plug their wireless phones and iPods into televisions - it’s completely contrary to the nature of the devices. If you want to make something that uses the iPhone in this fashion, you’re better off syncing a dedicated iPhone app with something running on your computer, hooked up to a TV. Nobody but a few nerds are going to pay for something like this, even if it does offer interesting possibilities. This is exactly what I thought when I saw this last year:

Just to be clear though, while the utility of this feature as a gaming/haptic feature might be debatable, it has clear utility for demonstrating Unity projects to large audiences (i.e. to clients, at conventions and workshops).

It doesn’t matter. That’s already available. Unity has provided.

Good point, Jessy.

I guess you can just do a Maximize on Play and get more or less the same thing.

I´d prefer it to hook up an iPhone with a cable to a tv than having to have a computer there with the project running on it, but yeh, its no biggy.
I think you´ve got a good point with the need for a cable connection for end users. Ideally it would be just an intermediary step solution and with time they come up with soemthing that allows to stream the picture just using wifi or something else.