Subscribe to our RSS news feed
AAPL 194.12 (-0.69)

2 Pages V   1 2 >  
Reply to this topic Start new topic
AppleTV Plugin Code Sample -> Local Movie Player, Sharing what I learn
***
  • Group: Members
  • Posts: 161
  • Joined: 17-August 05
  • Member No.: 6,630
Ok I've been working with the sample code released beforehand, and I created myself a little plugin that lists all my movies from my iMac's internal drive (where I store my movies) as I boot the AppleTV stuff from an external drive. It seems to work recursively, and the path is hardcoded, but have a go and try editing it.

The plugin will show up as "File Browser" in the main menu, and has an icon ripped from Front Row.

If you use and/or extend this code, please post here with anything you discover!

The project folder must be in the same folder as BackRow and iPhotoAccess, so you can symlink them in if you like.
Attached File(s)
Attached File  samplecode.zip ( 233.04K ) Number of downloads: 243
 
PM Profile Card
Go to the top of the page
+ Quote Post
*
  • Group: Newbies
  • Posts: 4
  • Joined: 30-March 07
  • Member No.: 96,890
Hi, It's possible to use this sample plugin to create QuitPlugin ?

Like Killall ......
PM Profile Card
Go to the top of the page
+ Quote Post
*
  • Group: Members
  • Posts: 10
  • Joined: 30-March 07
  • Member No.: 96,894
I've just built it and everything works fine, thanks a lot!

"Amazing...!" wink.gif

Edit1: How can I change the "CFBundleName"-menu entry? Simply changing "${PRODUCT_NAME}"-string in info.plist to "My Local Films" doesn't work!

Edit2: Ok, I've found a solution. Had to add a localization for my system language.

I'm now figuring out how to change the order of menu items
PM Profile Card
Go to the top of the page
+ Quote Post
***
  • Group: Members
  • Posts: 161
  • Joined: 17-August 05
  • Member No.: 6,630
Well I've managed to add a menu item to quit the AppleTV shell, for those people who are running it as a standalone application and not as their Finder. All you do is paste the following bits of code between the comment block dividers into their stated places below:

In FilezMenu.m:

CODE
- (void)itemSelected:(long)fp8 {

/* Add the following to top of said function */
    if (fp8 == 0)
    {
        [[NSApplication sharedApplication] terminate:self];
        
        return;
    }

/* end of addition */

....


This will make the topmost item in the Files list quit the AppleTV UI when selected. Now to actually make said item say "shut down" or something:

In TestMenuList.m:

CODE
-(TestMenuList *)initWithScene:(id)scene {

<... previous code here ...>

// build objects
    id currentMenuItem;
    
    
    /* Reboot Option addition here, under currentMenuItem and before NSDirectoryEnumerator *movieDirectoryEnumerator ... etc */
    
    [_fileListArray addObject:@" - Reboot Apple TV UI"];
    currentMenuItem = [BRTextMenuItemLayer menuItemWithScene:_scene];
    [currentMenuItem setTitle:@" - Reboot Apple TV UI"];
    [_items addObject:currentMenuItem];

    
/* end of addition */

...
PM Profile Card
Go to the top of the page
+ Quote Post
*
  • Group: Newbies
  • Posts: 4
  • Joined: 30-March 07
  • Member No.: 96,890
Hi, i use mac at home. i my job is a developer " Windows sad.gif " ...
What i do download to compile the code attach ??
PM Profile Card
Go to the top of the page
+ Quote Post
***
  • Group: Members
  • Posts: 161
  • Joined: 17-August 05
  • Member No.: 6,630
QUOTE (Alex76 @ Mar 30 2007, 07:16 PM) *
Hi, i use mac at home. i my job is a developer " Windows sad.gif " ...
What i do download to compile the code attach ??


You need to install Xcode from the discs that came with your Mac, or download it from developer.apple.com
PM Profile Card
Go to the top of the page
+ Quote Post
***
  • Group: Members
  • Posts: 126
  • Joined: 10-January 07
  • Member No.: 75,139
Works like a beauty, except for the fact that my system resolution stays at 1280x800 when I exit, rather than returning to 1440x900
PM Profile Card
Go to the top of the page
+ Quote Post
*
  • Group: Newbies
  • Posts: 2
  • Joined: 30-March 07
  • Member No.: 96,941
It works fine with m4v files, but when I try to play an AVI it crashes. I've installed perian into /Library/QuickTime and rebooted, but no luck.
PM Profile Card
Go to the top of the page
+ Quote Post
***
  • Group: Members
  • Posts: 161
  • Joined: 17-August 05
  • Member No.: 6,630
Interesting, it works for my avi files, half my collection is divx or xvid.
PM Profile Card
Go to the top of the page
+ Quote Post
*
  • Group: Newbies
  • Posts: 4
  • Joined: 30-March 07
  • Member No.: 96,890
QUOTE (grabberslasher @ Mar 30 2007, 06:55 PM) *
You need to install Xcode from the discs that came with your Mac, or download it from developer.apple.com


Tnk's GREAT.. !!
I mod the sample code.. Now i CAN quit from ATV with remote control.

Byz
PM Profile Card
Go to the top of the page
+ Quote Post
*
  • Group: Members
  • Posts: 9
  • Joined: 2-December 05
  • Member No.: 17,123
QUOTE (Alex76 @ Mar 30 2007, 11:02 AM) *
Tnk's GREAT.. !!
I mod the sample code.. Now i CAN quit from ATV with remote control.

Byz


Could you post your compiled version please?
PM Profile Card
Go to the top of the page
+ Quote Post
*
  • Group: Newbies
  • Posts: 4
  • Joined: 30-March 07
  • Member No.: 96,890
QUOTE (ElBob @ Mar 30 2007, 09:16 PM) *
Could you post your compiled version please?


I have Tested on Apple Installer.

1. RightClick Appletv Application
2. dir Plugin

Enter on frist voice
and press Play to quit
Attached File(s)
Attached File  AppleTV_Closer.frappliance.zip ( 62.37K ) Number of downloads: 270
 
PM Profile Card
Go to the top of the page
+ Quote Post
*
  • Group: Members
  • Posts: 9
  • Joined: 2-December 05
  • Member No.: 17,123
QUOTE (amok @ Mar 30 2007, 11:38 AM) *
Would you take mine? wink.gif

(Didn't test it, hope it works)

Edit: Successfully tested, but perhaps partly german. Tell me, if I've to change the localization.


Sweet dude, works like a charm.
PM Profile Card
Go to the top of the page
+ Quote Post
*
  • Group: Newbies
  • Posts: 2
  • Joined: 30-March 07
  • Member No.: 96,941
I'm going to keep trying with other media files (and I can't wait to try the closer app) BUT...my Apple TV reset itself (by itself, darn it) and is doing a factory update and I don't want to stop the thing while it's doing that.

Just FYI I'm on an NTSC system and the item that was messing up playback was a PAL DIVX file (30 fps vs 29.97 fps). I'm not sure if that's what caused the crash problem. Or the factory reset problem. Or whether I just have earned the bad karma.
PM Profile Card
Go to the top of the page
+ Quote Post
*
  • Group: Members
  • Posts: 26
  • Joined: 15-August 06
  • Member No.: 50,830
after i closed it it diable the keyboard link to volume. is there a quick plugin that would allow keyboard accsess. if there is anybody have a link
PM Profile Card
Go to the top of the page
+ Quote Post
*
  • Group: Members
  • Posts: 14
  • Joined: 29-March 07
  • Member No.: 96,527
QUOTE (grabberslasher @ Mar 30 2007, 02:34 PM) *
The plugin will show up as "File Browser" in the main menu, and has an icon ripped from Front Row.

If you use and/or extend this code, please post here with anything you discover!

The project folder must be in the same folder as BackRow and iPhotoAccess, so you can symlink them in if you like.


please excuse my ignorance, where exactly does the project folder "Sample Movie Lister" go? into "system/library/privateframeworks"? do i need to rename the project folder or no?

(I have the ATV setup and running through the "new user" method found here: http://forum.insanelymac.com/index.php?showtopic=46680 )
PM Profile Card
Go to the top of the page
+ Quote Post
***
  • Group: Members
  • Posts: 161
  • Joined: 17-August 05
  • Member No.: 6,630
QUOTE (ibcrootbeer @ Mar 31 2007, 01:41 AM) *
please excuse my ignorance, where exactly does the project folder "Sample Movie Lister" go? into "system/library/privateframeworks"? do i need to rename the project folder or no?

(I have the ATV setup and running through the "new user" method found here: http://forum.insanelymac.com/index.php?showtopic=46680 )


No the project folder includes an Xcode project which must be compiled. The compiled frappliance must then be copied into the PlugIns folder inside the AppleTV's Finder.app
PM Profile Card
Go to the top of the page
+ Quote Post
*
  • Group: Members
  • Posts: 21
  • Joined: 8-July 05
  • From: Canada
  • Member No.: 265
Great work Grabber
PM Profile Card
Go to the top of the page
+ Quote Post
*
  • Group: Members
  • Posts: 26
  • Joined: 15-August 06
  • Member No.: 50,830
awesome u guys should get a plugin that allows you to minimize ATV or switchwindows. that would be awesome
PM Profile Card
Go to the top of the page
+ Quote Post
*
  • Group: Members
  • Posts: 14
  • Joined: 29-March 07
  • Member No.: 96,527
QUOTE (amok @ Mar 30 2007, 09:38 PM) *
Would you take mine? wink.gif

(Didn't test it, hope it works)

Edit: Successfully tested, but perhaps partly german. Tell me, if I've to change the localization.



QUOTE (grabberslasher @ Mar 31 2007, 01:31 AM) *
No the project folder includes an Xcode project which must be compiled. The compiled frappliance must then be copied into the PlugIns folder inside the AppleTV's Finder.app


i just used amok's compiled film theater frapp and put it inside the plugins folder. when i ran ATV again it showed up in the menu looking great, however when i selected it, the option it gave me was to close appletv??? am i missing something? i already have the exit frapp installed which is working fine. is this an error on my part, has anyone else gotten the film theater frapp (file browser) seeing their media files on their computer? unsure.gif
PM Profile Card
Go to the top of the page
+ Quote Post
2 Pages V   1 2 >
Reply to this topic Start new topic

1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

RSS Lo-Fi Version Time is now: 9th February 2010 - 12:42 PM