Created
June 29, 2011 17:43
-
-
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (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