Index: plugins/flashvideo_streaming/flashvideo_streaming.module
===================================================================
--- plugins/flashvideo_streaming/flashvideo_streaming.module	(revision 245)
+++ plugins/flashvideo_streaming/flashvideo_streaming.module	(working copy)
@@ -53,7 +53,7 @@
       '#default_value' => flashvideo_variable_get($node_type, 'streamer', ''),
       '#maxlength' => 128,
       '#description' => t('The rtmp:// URL that your uploaded videos can be streamed from.<br />Example: <strong>rtmp://example.com</strong>'),
-			'#required' => $form_state['values']['flashvideo_streaming']['flashvideo_'. $node_type .'_streaming_enable'] && $form_state['values']['flashvideo_streaming']['flashvideo_'. $node_type .'_streaming_method'] == 'RTMP' ? TRUE : FALSE,
+			'#required' => $form_state['values']['flashvideo_streaming']['flashvideo_'. $node_type .'_streaming_enable'] && $form_state['values']['flashvideo_streaming']['flashvideo_'. $node_type .'_streaming_method'] == FLASHVIDEO_STREAMING_METHOD_RTMP ? TRUE : FALSE,
     );
     $form['flashvideo_streaming']['flashvideo_RTMP']['flashvideo_'. $node_type .'_streaming_ssh_username'] = array(
       '#type' => 'textfield',
@@ -61,7 +61,7 @@
       '#maxlength' => 25,
       '#default_value' => flashvideo_variable_get($node_type, 'streaming_ssh_username', ''),
       '#description' => t('The FlashVideo Streaming module uses the SCP and SSH commands to move files to your RTMP streaming server.  You must have an SSH account that is allowed to move files via OpenSSH Public / Private Keys (See README.txt for help with this). When your account is set up and functioning correctly, enter the username here.'),
-			'#required' => $form_state['values']['flashvideo_streaming']['flashvideo_'. $node_type .'_streaming_enable'] && $form_state['values']['flashvideo_streaming']['flashvideo_'. $node_type .'_streaming_method'] == 'RTMP' ? TRUE : FALSE,
+			'#required' => $form_state['values']['flashvideo_streaming']['flashvideo_'. $node_type .'_streaming_enable'] && $form_state['values']['flashvideo_streaming']['flashvideo_'. $node_type .'_streaming_method'] == FLASHVIDEO_STREAMING_METHOD_RTMP ? TRUE : FALSE,
     );
     $form['flashvideo_streaming']['flashvideo_RTMP']['flashvideo_'. $node_type .'_streaming_ssh_server'] = array(
       '#type' => 'textfield',
@@ -69,14 +69,14 @@
       '#maxlength' => 55,
       '#default_value' => flashvideo_variable_get($node_type, 'streaming_ssh_server', ''),
       '#description' => t('What is the address for the RTMP streaming server? You should <strong>NOT</strong> need to enter http: here.<br />Example: example.com'),
-			'#required' => $form_state['values']['flashvideo_streaming']['flashvideo_'. $node_type .'_streaming_enable'] && $form_state['values']['flashvideo_streaming']['flashvideo_'. $node_type .'_streaming_method'] == 'RTMP' ? TRUE : FALSE,
+			'#required' => $form_state['values']['flashvideo_streaming']['flashvideo_'. $node_type .'_streaming_enable'] && $form_state['values']['flashvideo_streaming']['flashvideo_'. $node_type .'_streaming_method'] == FLASHVIDEO_STREAMING_METHOD_RTMP ? TRUE : FALSE,
     );
     $form['flashvideo_streaming']['flashvideo_RTMP']['flashvideo_'. $node_type .'_streaming_ssh_path'] = array(
       '#type' => 'textfield',
       '#title' => t('Streaming Server File Path'),
       '#default_value' => flashvideo_variable_get($node_type, 'streaming_ssh_path', ''),
       '#description' => t('Which directory on the RTMP streaming server should files be copied into?<br />Example: d:/data/media/apps/Drupal/streams/video'),
-			'#required' => $form_state['values']['flashvideo_streaming']['flashvideo_'. $node_type .'_streaming_enable'] && $form_state['values']['flashvideo_streaming']['flashvideo_'. $node_type .'_streaming_method'] == 'RTMP' ? TRUE : FALSE,
+			'#required' => $form_state['values']['flashvideo_streaming']['flashvideo_'. $node_type .'_streaming_enable'] && $form_state['values']['flashvideo_streaming']['flashvideo_'. $node_type .'_streaming_method'] == FLASHVIDEO_STREAMING_METHOD_RTMP ? TRUE : FALSE,
     );
     $form['flashvideo_streaming']['flashvideo_RTMP']['flashvideo_'. $node_type .'_streaming_delete'] = array(
       '#type' => 'checkbox',
@@ -109,21 +109,19 @@
 }
 
 function _flashvideo_streaming_admin_validate($form, &$form_state) {
+  
   $node_type = $form['#parameters'][2];
-
-  if($form_state['values']['flashvideo_'. $node_type .'_streaming_enable'] && $form_state['values']['flashvideo_'. $node_type .'_streaming_method'] == 'xmoov-php') {
+  if($form_state['values']['flashvideo_'. $node_type .'_streaming_enable'] && $form_state['values']['flashvideo_'. $node_type .'_streaming_method'] == FLASHVIDEO_STREAMING_METHOD_XMOOV) {
     
     // Set the path to the streamer based on if they want to use the Drupal root or not.
     $useroot = $form_state['values']['flashvideo_'. $node_type .'_xmoov_userootpath'];
     $user_path = $form_state['values']['flashvideo_'. $node_type .'_xmoov_path'];
     $xmoov_path = $useroot ? base_path() . $user_path : file_directory_path() .'/'. $user_path;
   
-    // If we are using xmoov-php, check the xmoov path to make sure it exists.
-    if ($form_state['values']['flashvideo_'. $node_type .'_streaming_method'] == FLASHVIDEO_STREAMING_METHOD_XMOOV) {
-      if(!file_exists(getcwd().$xmoov_path)) {
-        form_set_error('flashvideo_'. $node_type .'_xmoov_path', "Can not find xmoov-php at ". $xmoov_path);
-      }
+    if(!file_exists(getcwd().$xmoov_path)) {
+      form_set_error('flashvideo_'. $node_type .'_xmoov_path', "Can not find xmoov-php at ". $xmoov_path);
     }
+     
     $form_state['values']['flashvideo_'. $node_type .'_streamer'] = $xmoov_path;
     $form_state['values']['flashvideo_'. $node_type .'_xmoov_path'] = $user_path;
   }
@@ -139,7 +137,7 @@
  */
 function flashvideo_streaming_flashvideo_delete_file($file, $node_type) {
 
-  if (!flashvideo_variable_get($node_type, 'streaming_enable', 0) || flashvideo_variable_get($node_type, 'streaming_method', 0) != 'RTMP' || !flashvideo_variable_get($node_type, 'streaming_ssh_username', 0) || !flashvideo_variable_get($node_type, 'streaming_ssh_server', 0) || !flashvideo_variable_get($node_type, 'streaming_ssh_path', 0) || !flashvideo_variable_get($node_type, 'streaming_delete', 0)) {
+  if (!flashvideo_variable_get($node_type, 'streaming_enable', 0) || flashvideo_variable_get($node_type, 'streaming_method', 0) != FLASHVIDEO_STREAMING_METHOD_RTMP || !flashvideo_variable_get($node_type, 'streaming_ssh_username', 0) || !flashvideo_variable_get($node_type, 'streaming_ssh_server', 0) || !flashvideo_variable_get($node_type, 'streaming_ssh_path', 0) || !flashvideo_variable_get($node_type, 'streaming_delete', 0)) {
     return array(); // User doesn't want to do deletions.
   }
 
@@ -179,7 +177,7 @@
   $filename = basename($file->filepath);
 
   // RTMP process:
-	if (flashvideo_variable_get($node_type, 'streaming_enable', 0) && flashvideo_variable_get($node_type, 'streaming_method', 0) == 'RTMP') {
+	if (flashvideo_variable_get($node_type, 'streaming_enable', 0) && flashvideo_variable_get($node_type, 'streaming_method', 0) == FLASHVIDEO_STREAMING_METHOD_RTMP) {
 		if (!flashvideo_variable_get($node_type, 'streaming_ssh_username', 0) || !flashvideo_variable_get($node_type, 'streaming_ssh_server', 0) || !flashvideo_variable_get($node_type, 'streaming_ssh_path', 0)) {
 			return array(); // User doesn't want to do streaming "gets".
 		}
@@ -200,7 +198,7 @@
 		return $filepath; // Finished RTMP filepath
 	}
   // xmoov-php process:
-	elseif (flashvideo_variable_get($node_type, 'streaming_enable', 0) && flashvideo_variable_get($node_type, 'streaming_method', 0) == 'xmoov-php') {
+	elseif (flashvideo_variable_get($node_type, 'streaming_enable', 0) && flashvideo_variable_get($node_type, 'streaming_method', 0) == FLASHVIDEO_STREAMING_METHOD_XMOOV) {
 		if (!variable_get('flashvideo_xmoov_path', 0)) {
 			return array(); // User doesn't want to do streaming "gets".
 		}
@@ -233,7 +231,7 @@
 function flashvideo_streaming_flashvideo_save_file($file, $node_type) {
   global $conf;
 
-  if (!flashvideo_variable_get($node_type, 'streaming_enable', 0) || flashvideo_variable_get($node_type, 'streaming_method', 0) != 'RTMP' || !flashvideo_variable_get($node_type, 'streaming_ssh_username', 0) || !flashvideo_variable_get($node_type, 'streaming_ssh_server', 0) || !flashvideo_variable_get($node_type, 'streaming_ssh_path', 0)) {
+  if (!flashvideo_variable_get($node_type, 'streaming_enable', 0) || flashvideo_variable_get($node_type, 'streaming_method', 0) != FLASHVIDEO_STREAMING_METHOD_RTMP || !flashvideo_variable_get($node_type, 'streaming_ssh_username', 0) || !flashvideo_variable_get($node_type, 'streaming_ssh_server', 0) || !flashvideo_variable_get($node_type, 'streaming_ssh_path', 0)) {
     return array(); // User doesn't want to streaming saves.
   }
 
