You are here

function video_filter_streamhoster in Video Filter 6.2

Same name and namespace in other branches
  1. 5.2 video_filter.codecs.inc \video_filter_streamhoster()
  2. 6.3 video_filter.codecs.inc \video_filter_streamhoster()
  3. 7.3 video_filter.codecs.inc \video_filter_streamhoster()
1 string reference to 'video_filter_streamhoster'
video_filter_codec_info in ./video_filter.codecs.inc

File

./video_filter.codecs.inc, line 247

Code

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);
}