Permalink
Browse files

open in QuickTime Player now works on Snowy, but still doesn't go ful…

…lscreen
  • Loading branch information...
1 parent 9282a9b commit 209ecc06a686ff931ba97bd76d25f67ca574eaf9 Simone Manganelli committed Aug 15, 2009
Showing with 11 additions and 1 deletion.
  1. +11 −1 Plugin/Plugin.m
View
@@ -39,6 +39,10 @@ of this software and associated documentation files (the "Software"), to deal
#define LOGGING_ENABLED 0
+#ifndef NSAppKitVersionNumber10_5
+#define NSAppKitVersionNumber10_5 949
+#endif
+
// MIME types
static NSString *sFlashOldMIMEType = @"application/x-shockwave-flash";
static NSString *sFlashNewMIMEType = @"application/futuresplash";
@@ -1397,8 +1401,14 @@ - (IBAction)openFullscreenInQTPlayer:(id)sender;
video_id, video_hash ];
}
- NSString *scriptSource = [NSString stringWithFormat:
+ NSString *scriptSource = nil;
+ if (floor(NSAppKitVersionNumber) > NSAppKitVersionNumber10_5) {
+ scriptSource = [NSString stringWithFormat:
+ @"tell application \"QuickTime Player\"\nactivate\nopen URL \"%@\"\npresent front document\nrepeat while (playing of front document is false)\ndelay 1\nplay front document\nend repeat\nend tell",src];
+ } else {
+ scriptSource = [NSString stringWithFormat:
@"tell application \"QuickTime Player\"\nactivate\ngetURL \"%@\"\nrepeat while (display state of front document is not presentation)\ndelay 1\npresent front document scale screen\nend repeat\nrepeat while (playing of front document is false)\ndelay 1\nplay front document\nend repeat\nend tell",src];
+ }
NSAppleScript *openInQTPlayerScript = [[NSAppleScript alloc] initWithSource:scriptSource];
[openInQTPlayerScript executeAndReturnError:nil];
[openInQTPlayerScript release];

0 comments on commit 209ecc0

Please sign in to comment.