# This patch file was generated by NetBeans IDE
# This patch can be applied using context Tools: Patch action on respective folder.
# It uses platform neutral UTF-8 encoding and \n newlines.
# Above lines and this line are ignored by the patching process.
Index: video_filter.codecs.inc
--- video_filter.codecs.inc Base (BASE)
+++ video_filter.codecs.inc Locally Modified (Based On LOCAL)
@@ -84,6 +84,13 @@
     'regexp' => '/metacafe\.com\/watch\/([a-z0-9\-_]+)\/([a-z0-9\-_]+)/i',
     'ratio' => 400 / 345,
   );
+  $codecs['streamhoster'] = array(
+    'name' => t('Streamhoster'),
+    'sample_url' => 'http://web26.streamhoster.com/username/filename.flv',
+    'callback' => 'video_filter_streamhoster',
+    'regexp' => '/([a-z0-9]+)\:\/\/([a-z0-9\-_]+)\.streamhoster\.com\/([a-z0-9\-_]+)\/([a-z0-9\-_\.]+)/i',
+    'ratio' => 480 / 360,
+  );
   $codecs['gametrailers'] = array(
     'name' => t('Game Trailers'),
     'sample_url' => 'http://www.gametrailers.com/video/some-title/12345',
@@ -228,6 +235,29 @@
   return video_filter_flash($video);
 }
 
+function video_filter_streamhoster($video) {
+  $video['source'] = 'http://public.streamhoster.com/Resources/Flash/JWFLVMediaPlayer/mediaplayer.swf';
+
+  $params = array('allowscriptaccess' => 'always');
+  $protocol = $video['codec']['matches'][1];
+
+  if ($protocol == 'rtmp') {
+    $params['flashvars'] = 'file=' . urlencode('/' . $video['codec']['matches'][4]);
+    $params['flashvars'] .= '&streamer=' . urlencode('rtmp://' . $video['codec']['matches'][2] . '.streamhoster.com/' . $video['codec']['matches'][3]);
+    $params['flashvars'] .= '&type=rtmp';
+  }
+  elseif ($protocol == 'http') {
+    $params[flashvars] = 'file=' . urlencode('http://' . $video['codec']['matches'][2] . '.streamhoster.com/' . $video['codec']['matches'][3] . '/' . $video['codec']['matches'][4]);
+    $params['flashvars'] .= '&type=video';
+  }
+
+  $params['flashvars'] .= '&width=' . $video['width'] ;
+  $params['flashvars'] .= '&height=' . $video['height'] ;
+  $params['flashvars'] .= !empty($video['autoplay']) ? '&autostart=true' : '&autostart=false';
+
+  return video_filter_flash($video, $params);
+}
+
 function video_filter_gametrailers($video) {
   if (is_numeric($video['codec']['matches'][1])) {
     $match = $video['codec']['matches'][1];
