Jump to content

AppleTV Plugin Code Sample -> Local Movie Player


grabberslasher
 Share

34 posts in this topic

Recommended Posts

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.

samplecode.zip

Link to comment
Share on other sites

I've just built it and everything works fine, thanks a lot!

 

"Amazing...!" :rolleyes:

 

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

Link to comment
Share on other sites

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:

 

- (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:

 

-(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 */

...

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 )

Link to comment
Share on other sites

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

Link to comment
Share on other sites

Would you take mine? ;)

 

(Didn't test it, hope it works)

 

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

 

 

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:

Link to comment
Share on other sites

You must not have movies in the same folder as amok's compiled version is pointing to. The code has the path editable before compilation, so you use that and compile it if you need to change the path.

 

im sorry i keep getting stuck...

 

i opened the code in xcode and saw the line to change to point to the directory where your movies are kept, so i changed it to "Users/myusername/Movies" and compiled it. placed the frapp into the plugins folder and the same thing happened... it just gave me the option to close ATV. the menu is there the icon is there and it compiled with no errors, all my movies are in the Movies folder on my HD...

 

am i still doing something wrong?

Link to comment
Share on other sites

im sorry i keep getting stuck...

 

i opened the code in xcode and saw the line to change to point to the directory where your movies are kept, so i changed it to "Users/myusername/Movies" and compiled it. placed the frapp into the plugins folder and the same thing happened... it just gave me the option to close ATV. the menu is there the icon is there and it compiled with no errors, all my movies are in the Movies folder on my HD...

 

am i still doing something wrong?

 

Do you have a forwardslash at the start of that path? "/Users/myusername/Movies/" ?

Link to comment
Share on other sites

 Share

×
×
  • Create New...