Skip to content

iChat Theatre Sample Code

iChat Theatre Demo (1MB)

Leopard introduced something called iChat Theatre which allows applications to share content with other users via iChat. Apple’s Keynote is the poster child for this in that it allows you to show a presentation to another user via iChat.

Leopard provides an amazingly simply API for integrating this capability into a Cocoa application. My iChat Theatre Demo project shows how to integrate iChat Theatre into a Cocoa application by sharing an NSImageView.

To use the demo, do the following:

  1. launch the iChatDemo application
  2. in iChat, begin a Video Chat with another user
  3. click the + button in the bottom margin of the Video chat button, and select the Share a File option from the popup menu
  4. in the resulting Open File panel, select the iChatDemo application file

At this point, iChat should begin showing the images displayed by iChatDemo in its window

An alternate usage is to simply drag the iChatDemo application file’s icon into the Video iChat window, but this produces a subtly different presentation in iChat.

8 Comments

  1. Dave Dave

    Luvly!

    Been looking for someone doing this kind of thing. Quetion is – how is this extended to that I can share a particular arbitary applications window…

    Big ask…

  2. This should be fairly simple. Since iChat Theatre allows you to share any Cocoa NSView instance, you can share a window’s contentView. This will not share the window frame, but it will share its entire contents.

  3. Dave Dave

    Cool. Just sounds fairly useful for me when helping out with friends problems… Better than having to drop to the deadend of full screen screen sharing… So I could just choose what app (window) I want to share?

  4. No, I don’t think that is possible. Each application must announce its willingness to share windows/documents with iChat. From there, any NSView instance can be shared within the application.

  5. Dave Dave

    That’s a shame. I thought there’d be a way of hooking into the WindowServer side of things and just steal the window…

  6. Mark, do you have any idea how to initatiate the sharing from the “iChatDemo application” instead of “iChat” like “The Tube” does?

    I had a quick look at the documentation nothing obvious shows up.

    Since document sharing starts by dropping a document onto the iChat application, I’m guessing that you can send an ‘open document’ AppleEvent to iChat to cause sharing to begin

  7. Howdy Mark,

    Thanks for this code – it’s slightly different than what I came up with but the API doesn’t really allow for a lot of variance (which is not necessarily a bad thing).

    Do you know of a way to put iChat into some kind of debug mode? If I use FUS, can I chat with my other self on this box? Kinda frustrating not to be able to test the app, since it requires iChat to be running and in a video conf. before anything will work.

    It’d be nice if iChat could remain under the covers/BTS and that my app itself could log in to the service, listen for users, and offer window-sharing chat sessions to those that come online…

    Thanks, Chris

Comments are closed.