--- videofield_widget.inc-orig	2010-02-05 01:42:12.000000000 +0200
+++ videofield_widget.inc	2011-03-03 03:12:35.706000000 +0200
@@ -22,6 +22,24 @@
     '#weight' => 1,
   );
 
+  $form['videofield_display_width'] = array(
+    '#type' => 'textfield',
+    '#title' => t('Default display width'),
+    '#default_value' => is_string($widget['videofield_display_width']) ? $widget['videofield_display_width'] : variable_get('videofield_videowidth', 350),
+    '#size' => 4,
+    '#description' => t('Default width in pixels for this field.'),
+    '#weight' => 2,
+  );
+
+  $form['videofield_display_height'] = array(
+    '#type' => 'textfield',
+    '#title' => t('Default display height'),
+    '#default_value' => is_string($widget['videofield_display_height']) ? $widget['videofield_display_height'] : variable_get('videofield_videoheight', 285),
+    '#size' => 4,
+    '#description' => t('Default height in pixels for this field.'),
+    '#weight' => 3,
+  );
+
   return $form;
 }
 
@@ -32,6 +50,9 @@
  */
 function videofield_widget_settings_save($widget) {
   $filefield_settings = module_invoke('filefield', 'widget_settings', 'save', $widget);
+  // Add custom settings.
+  $filefield_settings[] = 'videofield_display_width';
+  $filefield_settings[] = 'videofield_display_height';
    
   return $filefield_settings;
 }
@@ -55,25 +76,34 @@
   $width=$file['data']['width'];
   $height=$file['data']['height'];
 
+  $field = content_fields($element['#field_name'], $element['#type_name']);
+  $display_width = $field['widget']['videofield_display_width'];
+  $display_height = $field['widget']['videofield_display_height'];
+
   if(empty($width)){
-   $width=variable_get('videofield_videowidth', 350);
+    $width = $display_width ? $display_width : variable_get('videofield_videowidth', 350);
   }
   if(empty($height)){
-    $height=variable_get('videofield_videoheight', 285);
+    $height = $display_height ? $display_height : variable_get('videofield_videoheight', 285);
   }
   
-
-  $field = content_fields($element['#field_name'], $element['#type_name']);
-
   $element['data']['width'] = array( 
     '#title' => t( 'Width' ),
     '#type' => 'textfield',
     '#default_value' =>$width,
+    // FIXME: If unusual in this case #value is missing 
+    // then dynamically (JS) generated text fields are not filled with default values! Why?
+    '#value' =>$width,
+    '#description' => 'Default: ' . $width,
   );
   $element['data']['height'] = array( 
     '#title' => t( 'Height' ),
     '#type' => 'textfield',
     '#default_value' => $height,
+    // FIXME: If unusual in this case #value is missing 
+    // then dynamically (JS) generated text fields are not filled with default values! Why?
+    '#value' =>$height,
+    '#description' => 'Default: ' . $height,
   );
   
   //TODO: Configuration for display. Make popup display.
