--- youtube.inc	2009-01-04 13:17:24.000000000 -0500
+++ youtubenew.inc	2009-01-11 19:12:47.497185600 -0500
@@ -55,6 +55,12 @@ function emvideo_youtube_settings() {
     '#default_value' => variable_get('emvideo_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']['emvideo_youtube_high_quality'] = array(
+    '#type' => 'checkbox',
+    '#title' => t('Use YouTube high quality content'),
+    '#default_value' => variable_get('emvideo_youtube_high_quality', 0),
+    '#description' => t('If checked, then a parameter will be set to request high quality content.  Note: Not all videos from youtube are available in high quality. Those that aren't will play in normal quality.'),
+  );
   $form['youtube']['api'] = array(
     '#type' => 'fieldset',
     '#title' => t('YouTube API'),
@@ -274,7 +280,8 @@ function theme_emvideo_youtube_flash($em
     $enablejsapi = $enablejsapi ? '&enablejsapi=1&playerapiid=ytplayer' : '';
     $id = isset($options['id']) ? $options['id'] : 'video-cck-youtube-flash-'. (++$count);
     $div_id = isset($options['div_id']) ? $options['div_id'] : 'video-cck-youtube-flash-wrapper-'. $count;
-    $url = "http://www.youtube.com/v/$embed&amp;$related$autoplay_value$colors$border$enablejsapi$fs";
+    $high_quality = (variable_get('emvideo_youtube_high_quality', 0)) ? '&amp;ap=%2526fmt%3D18' : '';
+    $url = "http://www.youtube.com/v/$embed&amp;$related$autoplay_value$colors$border$high_quality$enablejsap";
     if (variable_get('emfield_swfobject', FALSE) && (module_exists('swfobject_api') || variable_get('emfield_swfobject_location', ''))) {
       if (module_exists('swfobject_api')) {
         $params['width'] = $width;
