# This patch file was generated by NetBeans IDE
# This patch can be applied using context Tools: Apply Diff Patch action on respective folder.
# It uses platform neutral UTF-8 encoding.
# Above lines and this line are ignored by the patching process.
--- a\videojs_filter\videojs_filter.module
+++ b\videojs_filter\videojs_filter.module
@@ -1,9 +1,9 @@
 <?php
+
 /**
 * @file
 * 
 */
-
 /*
  * Implements hook_menu().
  */
@@ -80,17 +80,17 @@
 function videojs_filter_settings_form_validate($form, &$form_state) {
     
     $path_video = $form_state['values']['videojs_filter_video_directory'];
-    if (!file_exists( drupal_realpath('public://') . '/' . $path_video)) {
+  if (!file_exists(drupal_realpath('public://') . '/' . $path_video)) {
         form_error($form['videojs_filter_video_directory'], t('The video folder is not exist.'));
     }
 
     $path_poster = $form_state['values']['videojs_filter_poster_directory'];
-    if (!file_exists( drupal_realpath('public://') . '/' . $path_poster)) {
+  if (!file_exists(drupal_realpath('public://') . '/' . $path_poster)) {
         form_error($form['videojs_filter_poster_directory'], t('The poster folder is not exist.'));
     }
 
     $poster_file = $form_state['values']['videojs_filter_poster_file'];
-    if (!file_exists( drupal_realpath('public://') . '/' . $path_poster . '/' . $poster_file)) {
+  if (!file_exists(drupal_realpath('public://') . '/' . $path_poster . '/' . $poster_file)) {
         form_error($form['videojs_filter_poster_file'], t('The default poster file is not exist.'));
     }
 
@@ -118,6 +118,7 @@
 /*
  * Implements hook_filter_info().
  */
+
 function videojs_filter_filter_info() {
   
   $filters['videojs_filter'] = array(
@@ -158,35 +159,45 @@
     $attr = array();
     $file = array();
     $orig_match[] = $match;
-    $match = str_replace( array('[', ']', '{', '}'), '', $match );
+    $match = str_replace(array('[', ']', '{', '}'), '', $match);
     $options = explode('|', $match);
     foreach ($options as $index => $opt) {
         $tmp = explode(':', $opt);
         $attr[$tmp[0]] = trim($tmp[1]);
     }
-    if (isset($attr['videojs'])) {
-        $file_ext = pathinfo($attr['videojs']);
-        $uri = $public_uri . $video_dir . '/' . $attr['videojs'];
         
+    if (isset($attr['videojs'])) {
+      $videojs = $attr['videojs'];
+      if (stristr($videojs, ',')) {
+        // More than one video file type
+        $vtypes = explode(',', $videojs);
+      }
+      else {
+        // Only one video file type
+        $vtypes = array($videojs);
+      }
+      $items_video = array();
+      foreach ($vtypes as $vtype) {
+        $file_ext = pathinfo($vtype);
+        $uri = $public_uri . $video_dir . '/' . $vtype;
         $file['uid'] = 1;
         $file['display'] = 1;
-        $file['filename'] = $attr['videojs'];
+        $file['filename'] = $vtype;
         $file['filemime'] = 'video/' . $file_ext['extension'];
         $file['filesize'] = filesize($uri);
         $file['uri'] = $uri;
         $file['status'] = 1;
-
+        $items_video[$file_ext['extension']] = $file;
+      }
         $file_poster['uri'] = (isset($attr['poster'])) ? $public_uri . $poster_dir . '/' . $attr['poster'] : $public_uri . $poster_dir . '/' . $poster_file;
         $file_ext = pathinfo($file_poster['uri']);
         $file_poster['filemime'] = 'image/' . $file_ext['extension'];
-
-        $items_video['mp4'] = $file;
         $items_video['poster'] = $file_poster;
 
-        $attributes['width']  = (isset($attr['width'] )) ?  $attr['width'] : $player_width;
-        $attributes['height'] = (isset($attr['height'])) ?  $attr['height'] : $player_height;
+      $attributes['width'] = (isset($attr['width'])) ? $attr['width'] : $player_width;
+      $attributes['height'] = (isset($attr['height'])) ? $attr['height'] : $player_height;
 
-        $html_code[] = '<div id="videojs-filter-wrapper-video-' . $i . '">'.theme('videojs', array('items' => $items_video, 'player_id' => 'videojs-header-' . $i, 'attributes' => $attributes)) . '</div>';
\ No newline at end of file
+      $html_code[] = '<div id="videojs-filter-wrapper-video-' . $i . '">' . theme('videojs', array('items' => $items_video, 'player_id' => 'videojs-header-' . $i, 'attributes' => $attributes)) . '</div>';
\ No newline at end of file
         $i++;
      } 
   } 
