Skip to content

Commit

Permalink
'Download H.264' menu item now respects the HD setting
Browse files Browse the repository at this point in the history
Signed-off-by: Jonathan 'Wolf' Rentzsch <jwr.git@redshed.net>
  • Loading branch information
Simone Manganelli authored and rentzsch committed Jul 6, 2009
1 parent 8797bb2 commit 1edb682
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Plugin/Plugin.m
Expand Up @@ -1224,8 +1224,14 @@ - (IBAction)downloadH264:(id)sender
NSString* video_id = [self videoId];
NSString* video_hash = [ self _videoHash ];

NSString* src = [ NSString stringWithFormat: @"http://www.youtube.com/get_video?fmt=18&video_id=%@&t=%@",
video_id, video_hash ];
NSString *src;
if ([[CTFUserDefaultsController standardUserDefaults] boolForKey:sUseYouTubeHDH264DefaultsKey]) {
src = [ NSString stringWithFormat: @"http://www.youtube.com/get_video?fmt=22&video_id=%@&t=%@",
video_id, video_hash ];
} else {
src = [ NSString stringWithFormat: @"http://www.youtube.com/get_video?fmt=18&video_id=%@&t=%@",
video_id, video_hash ];
}

[[NSWorkspace sharedWorkspace] openURLs:[NSArray arrayWithObject:[NSURL URLWithString:src]]
withAppBundleIdentifier:[self launchedAppBundleIdentifier]
Expand Down

0 comments on commit 1edb682

Please sign in to comment.