diff --git a/includes/media_vimeo.formatters.inc b/includes/media_vimeo.formatters.inc
index 212fd92..5fa6ae6 100644
--- a/includes/media_vimeo.formatters.inc
+++ b/includes/media_vimeo.formatters.inc
@@ -44,7 +44,11 @@ function media_vimeo_file_formatter_video_view($file, $display, $langcode) {
       '#uri' => $file->uri,
       '#options' => array(),
     );
-    foreach (array('width', 'height', 'api' , 'autoplay', 'byline', 'color', 'loop', 'portrait', 'title', 'protocol') as $setting) {
+
+    // Fake a default for attributes so the ternary doesn't choke.
+    $display['settings']['attributes'] = array();
+
+    foreach (array('width', 'height', 'api' , 'autoplay', 'byline', 'color', 'loop', 'portrait', 'title', 'protocol', 'attributes') as $setting) {
       $element['#options'][$setting] = isset($file->override[$setting]) ? $file->override[$setting] : $display['settings'][$setting];
     }
     return $element;
diff --git a/includes/themes/media_vimeo.theme.inc b/includes/themes/media_vimeo.theme.inc
index 0a1a8c3..94c3df0 100644
--- a/includes/themes/media_vimeo.theme.inc
+++ b/includes/themes/media_vimeo.theme.inc
@@ -14,7 +14,10 @@ function media_vimeo_preprocess_media_vimeo_video(&$variables) {
   // Build the URI.
   $wrapper = file_stream_wrapper_get_instance_by_uri($variables['uri']);
   $parts = $wrapper->get_parameters();
-  $variables['video_id'] = $parts['v'];
+  $variables['video_id'] = check_plain($parts['v']);
+
+  // Make the file object available.
+  $file_object = file_uri_to_object($variables['uri']);
 
   // Parse options and build the query string. Only add the option to the query
   // array if the option value is not default. Be careful, depending on the
@@ -57,6 +60,18 @@ function media_vimeo_preprocess_media_vimeo_video(&$variables) {
     $variables[$themevar] = $variables['options'][$themevar];
   }
 
+  // Do something useful with the overridden attributes from the file
+  // object. We ignore alt and style for now.
+  if (isset($variables['options']['attributes']['class'])) {
+    if (is_array($variables['options']['attributes']['class'])) {
+      $variables['classes_array'] = array_merge($variables['classes_array'], $variables['options']['attributes']['class']);
+    }
+    else {
+      // Provide nominal support for Media 1.x.
+      $variables['classes_array'][] = $variables['options']['attributes']['class'];
+    }
+  }
+
   // Build the iframe URL with options query string.
   $variables['url'] = url($protocol . 'player.vimeo.com/video/' . $variables['video_id'], array('query' => $query, 'external' => TRUE));
 }
