Skip to content

Commit

Permalink
open in QuickTime Player now works on Snowy, but still doesn't go ful…
Browse files Browse the repository at this point in the history
…lscreen
  • Loading branch information
Simone Manganelli authored and Simone Manganelli committed Aug 15, 2009
1 parent 9282a9b commit 209ecc0
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion Plugin/Plugin.m
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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];
Expand Down

0 comments on commit 209ecc0

Please sign in to comment.