Skip to content

Commit 209ecc0

Browse files
Simone ManganelliSimone Manganelli
Simone Manganelli
authored and
Simone Manganelli
committed
open in QuickTime Player now works on Snowy, but still doesn't go fullscreen
1 parent 9282a9b commit 209ecc0

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

Plugin/Plugin.m

+11-1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ of this software and associated documentation files (the "Software"), to deal
3939

4040
#define LOGGING_ENABLED 0
4141

42+
#ifndef NSAppKitVersionNumber10_5
43+
#define NSAppKitVersionNumber10_5 949
44+
#endif
45+
4246
// MIME types
4347
static NSString *sFlashOldMIMEType = @"application/x-shockwave-flash";
4448
static NSString *sFlashNewMIMEType = @"application/futuresplash";
@@ -1397,8 +1401,14 @@ - (IBAction)openFullscreenInQTPlayer:(id)sender;
13971401
video_id, video_hash ];
13981402
}
13991403

1400-
NSString *scriptSource = [NSString stringWithFormat:
1404+
NSString *scriptSource = nil;
1405+
if (floor(NSAppKitVersionNumber) > NSAppKitVersionNumber10_5) {
1406+
scriptSource = [NSString stringWithFormat:
1407+
@"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];
1408+
} else {
1409+
scriptSource = [NSString stringWithFormat:
14011410
@"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];
1411+
}
14021412
NSAppleScript *openInQTPlayerScript = [[NSAppleScript alloc] initWithSource:scriptSource];
14031413
[openInQTPlayerScript executeAndReturnError:nil];
14041414
[openInQTPlayerScript release];

0 commit comments

Comments
 (0)