Skip to content

Instantly share code, notes, and snippets.

@erica
Created December 26, 2010 20:10
Show Gist options
  • Star 18 You must be signed in to star a gist
  • Fork 5 You must be signed in to fork a gist
  • Save erica/755600 to your computer and use it in GitHub Desktop.
Save erica/755600 to your computer and use it in GitHub Desktop.
REMOTE REQUESTS:
com.sadun.airflick
RequestType := show-photo | play-media | screenshot
MediaLocation :=
<url string> | <local file path string> | <array of local file path strings for slideshow>
Rotation := 0 | 1 | 2 | 3 (0 ^, 1 <, 2 v, 3 >)
Transition := SlideRight | Dissolve
SlideDuration := 2 | 3 | 5 | 8 | 10 (Use strings. Incorrect durations default to 5)
// Single Slide
NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:
@"show-photo", @"RequestType",
@"/Users/ericasadun/Pictures/Spring 2010/EPho 3.JPG", @"MediaLocation",
@"1", @"Rotation",
nil];
// Slideshow
NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:
@"show-photo", @"RequestType",
array, @"MediaLocation",
@"0", @"Rotation",
@"dissolve", @"Transition",
@"5", @"SlideDuration",
nil];
[[NSDistributedNotificationCenter defaultCenter]
postNotificationName:@"com.sadun.airflick" object:nil
userInfo:dict deliverImmediately:YES];
// Onsite Video
NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:
@"play-media", @"RequestType",
@"/Volumes/MusicAndData/Core Media/TV/Under Control.m4v", @"MediaLocation",
nil];
// Offsite Video
NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:
@"play-media", @"RequestType",
@"http://www.archive.org/download/bb_poor_cinderella/bb_poor_cinderella_512kb.mp4",
@"MediaLocation",
nil];
[[NSDistributedNotificationCenter defaultCenter]
postNotificationName:@"com.sadun.airflick" object:nil
userInfo:dict deliverImmediately:YES];
URL ACTIVATION:
airflick://screenshot (NEW!)
airflick://play-media?MediaLocation=http://example.com/some.mp4
airflick://show-photo?MediaLocation=http://example.com/some.jpeg
where the media location is escaped
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment