diff --git a/video_filter.codecs.inc b/video_filter.codecs.inc
index 1554d2c..ed81489 100644
--- a/video_filter.codecs.inc
+++ b/video_filter.codecs.inc
@@ -192,7 +192,23 @@ function video_filter_youtube_html5($video) {
     'autoplay' => $video['autoplay'] ? 'autoplay=1' : 'autoplay=0',
   );
   $url = $video['codec']['matches'][1] . '?' . implode('&amp;', $attributes);
-  $html = '<iframe src="http://www.youtube.com/embed/'.$url.'" width="'.$video['width'].'" height="'.$video['height'].'" frameborder="0"></iframe>';
+  $classes = array(
+    'video-filter',
+    'video-' . $video['codec']['codec_name'],  // Adds codec name
+  );
+
+  // Adds alignment
+  if (isset($video['align'])) {
+    $classes[] = 'video-' . $video['align'];
+  }
+
+  // First match is the URL, we don't want that as a class.
+  unset($video['codec']['matches'][0]);
+  foreach ($video['codec']['matches'] AS $match) {
+    $classes[] = 'vf-' . strtolower(preg_replace('/[^a-zA-Z0-9]/', '', $match));
+  }
+  
+  $html = '<iframe src="http://www.youtube.com/embed/'.$url.'" width="'.$video['width'].'" height="'.$video['height'].'" class="' . implode(' ', $classes).'" frameborder="0"></iframe>';
 
   return $html;
 }
