Skip to content

Instantly share code, notes, and snippets.

@zorn
Created June 29, 2011 17:43
Show Gist options
  • Save zorn/1054401 to your computer and use it in GitHub Desktop.
Save zorn/1054401 to your computer and use it in GitHub Desktop.
New code to make sure intro screencast plays in QuickTime if available or default (usually Safari) if not.
- (IBAction)play:(id)sender
{
// Open up the intro movie, using in pref order, QuickTime, QuickTime X
// or the system defaul (usually Safari).
if (![self openIntroMovieUsingAppBundleIdentifier:@"com.apple.quicktimeplayer"]) {
if (![self openIntroMovieUsingAppBundleIdentifier:@"com.apple.QuickTimePlayerX"]) {
if (![self openIntroMovieUsingAppBundleIdentifier:nil]) {
NSLog(@"Could not open intro movie.");
}
}
}
}
- (BOOL)openIntroMovieUsingAppBundleIdentifier:(NSString *)appID
{
NSString *movieURLPath = @"http://media.clickablebliss.com/profittrain/screencasts/IntroductionToProfitTrain.mov";
NSURL *movieURL = [NSURL URLWithString:movieURLPath];
return [[NSWorkspace sharedWorkspace] openURLs:[NSArray arrayWithObjects:movieURL, nil]
withAppBundleIdentifier:appID
options:NSWorkspaceLaunchAsync
additionalEventParamDescriptor:nil
launchIdentifiers:nil];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment