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
  • Loading branch information
Simone Manganelli authored and Simone Manganelli committed Jul 4, 2009
1 parent 4eb0347 commit aa0eb29
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Plugin/Plugin.m
Original file line number Diff line number Diff line change
Expand Up @@ -1240,8 +1240,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 aa0eb29

Please sign in to comment.