? 346855-priority_setting.patch
? 346855-video_filter-priority_setting-1.patch
Index: video_filter.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/video_filter/video_filter.module,v
retrieving revision 1.12.2.15
diff -u -p -r1.12.2.15 video_filter.module
--- video_filter.module	20 Mar 2010 12:20:08 -0000	1.12.2.15
+++ video_filter.module	22 Sep 2010 10:47:41 -0000
@@ -132,11 +132,15 @@ function video_filter_process($text, $fo
 
         // Resize to fit within width and height repecting aspect ratio
         if ($ratio) {
-          $scale_factor = min(array(($video['height']-$control_bar_height), $video['width']/($ratio)));
+          if (variable_get('video_filter_priority_'.$format, 'height') == 'height') {
+            $scale_factor = $video['height']-$control_bar_height;
+          }
+          else {
+            $scale_factor = $video['width']/$ratio;
+          }
           $video['height'] = round($scale_factor + $control_bar_height);
           $video['width'] = round($scale_factor * $ratio);
         }
-
         $video['autoplay'] = (bool) $video['autoplay'];
         $video['align'] = in_array($video['align'], array('left', 'right', 'center')) ? $video['align'] : NULL;
 
@@ -150,7 +154,6 @@ function video_filter_process($text, $fo
       $text = str_replace($code, $replacement, $text);
     }
   }
-
   return $text;
 }
 
@@ -192,6 +195,16 @@ function video_filter_settings($format) 
       1 => t('Yes'),
     ),
   );
+  $form['video_filter']['video_filter_priority_'.$format] = array(
+    '#type' => 'radios',
+    '#title' => t('Default priority setting'),
+    '#description' => t('Should height or width take priority when videos are re-sized to fit?'),
+    '#default_value' => variable_get('video_filter_priority_'.$format, 'height'),
+    '#options' => array(
+      height => t('Height'),
+      width => t('Width'),
+    ),
+  );
 
   return $form;
 }
@@ -373,4 +386,5 @@ function _video_filter_instructions() {
   }
   $output .= '</ul>';
   return $output;
-}
\ No newline at end of file
+}
+
