Index: video.module
===================================================================
RCS file: /cvs/drupal/contributions/modules/video/video.module,v
retrieving revision 1.47
diff -u -r1.47 video.module
--- video.module	16 Jul 2006 09:26:00 -0000	1.47
+++ video.module	2 Aug 2006 23:51:48 -0000
@@ -611,11 +611,71 @@
  *   Nothing, modifies $node which is passed by reference.
  */
 function video_view(&$node, $teaser = FALSE, $page = FALSE) {
+
+  // prepare the body and teaser
   $node = node_prepare($node, $teaser); //Run the body through the standard filters.
 
   // include the video css file
   theme_add_style(drupal_get_path('module', 'video').'/video.css');
 
+  // run the body through the theme
+  $node->body = theme('video_view', $node);
+
+}
+
+/**
+ * theme the view of the page to include the video
+ * assumes that body was put through prepare in hook_view
+ * @return
+ *   html
+ */
+function theme_video_view($node){
+  $output = '';
+
+  // play the video  
+  theme('video_get_script');
+  if (variable_get('video_playcounter', 1)) {
+    db_query("UPDATE {video} SET play_counter = play_counter + 1 where vid = %d", $node->vid); //Increment play counter.
+  }
+  switch (_video_get_filetype($node->vidfile)) {
+    case 'mov':
+    case 'mp4':
+    case '3gp':
+    case '3g2':
+      $output .= theme('video_play_quicktime', $node);
+      break;
+    case 'rm':
+      $output .= theme('video_play_realmedia', $node);
+      break;
+    case 'flv':
+      $output .= theme('video_play_flash', $node);
+      break;
+    case 'swf':
+      $output .= theme('video_play_swf', $node);
+      break;
+    case 'dir':
+    case 'dcr':
+      $output .= theme('video_play_dcr', $node);
+      break;
+    case 'wmv':
+      $output .= theme('video_play_windowsmedia', $node);
+      break;
+    case 'ogg':
+      $output .= theme('video_play_ogg_theora', $node);
+      break;
+    case 'youtube':
+      $output .= theme('video_play_youtube', $node);
+      break;
+    case 'googlevideo':
+      $output .= theme('video_play_googlevideo', $node);
+      break;
+    default:
+      drupal_set_message('Video type not supported', 'error');
+      break;
+  }
+  
+  $output .= '<div id="video_body">'. $node->body .'</div>';
+  return $output; 
 }
 
 /********************************************************************
