Index: contrib/video_cck/providers/youtube.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/emfield/contrib/video_cck/providers/youtube.inc,v
retrieving revision 1.15
diff -u -p -r1.15 youtube.inc
--- contrib/video_cck/providers/youtube.inc	11 May 2008 03:56:54 -0000	1.15
+++ contrib/video_cck/providers/youtube.inc	4 Sep 2008 01:32:10 -0000
@@ -50,6 +50,12 @@ function video_cck_youtube_settings() {
     '#default_value' => variable_get('video_cck_youtube_show_related_videos', 0),
     '#description' => t('If checked, then when playing a video from YouTube, users may hover over the video to see thumbnails & links to related videos.'),
   );
+  $form['youtube']['video_cck_youtube_use_high_quality'] = array(
+    '#type' => 'checkbox',
+    '#title' => t('Use YouTube high quality'),
+    '#default_value' => variable_get('video_cck_youtube_use_high_quality', 0),
+    '#description' => t('If checked, then a parameter will be set to request high quality videos.  Note that not all videos all available in high quality so they will play in normal quality.'),
+  );
   $form['youtube']['api'] = array(
     '#type' => 'fieldset',
     '#title' => t('YouTube API'),
@@ -236,14 +242,15 @@ function theme_video_cck_youtube_flash($
       $autoplay_value = '&autoplay=1';
     }
     $related = variable_get('video_cck_youtube_show_related_videos', 0);
+    $high_quality = (variable_get('video_cck_youtube_use_high_quality', 0)) ? '&amp;ap=%2526fmt%3D18' : '';
     if (variable_get('video_cck_youtube_show_colors', FALSE)) {
       $color1 = video_cck_youtube_convert_color(variable_get('video_cck_youtube_colors_color1', VIDEO_CCK_YOUTUBE_COLOR1_DEFAULT));
       $color2 = video_cck_youtube_convert_color(variable_get('video_cck_youtube_colors_color2', VIDEO_CCK_YOUTUBE_COLOR2_DEFAULT));
       $colors='&color1=0x'.$color1.'&color2=0x'.$color2;
     }
     $border = (variable_get('video_cck_youtube_show_border', FALSE) == FALSE ? '' : '&border=1');
-    $output .= "    <object type=\"application/x-shockwave-flash\" height=\"$height\" width=\"$width\" data=\"http://www.youtube.com/v/$embed&amp;rel=$related" . $autoplay_value . $colors . $border . "\" id=\"VideoPlayback\" >
-      <param name=\"movie\" value=\"http://www.youtube.com/v/$embed&amp;rel=$related" . $autoplay_value . $colors . $border . "\" />
+    $output .= "    <object type=\"application/x-shockwave-flash\" height=\"$height\" width=\"$width\" data=\"http://www.youtube.com/v/$embed&amp;rel=$related$high_quality" . $autoplay_value . $colors . $border . "\" id=\"VideoPlayback\" >
+      <param name=\"movie\" value=\"http://www.youtube.com/v/$embed&amp;rel=$related$high_quality" . $autoplay_value . $colors . $border . "\" />
       <param name=\"allowScriptAcess\" value=\"sameDomain\"/>
       <param name=\"quality\" value=\"best\"/>
       <param name=\"bgcolor\" value=\"#FFFFFF\"/>
