function video_filter_streamhoster in Video Filter 7.3
Same name and namespace in other branches
- 5.2 video_filter.codecs.inc \video_filter_streamhoster()
- 6.3 video_filter.codecs.inc \video_filter_streamhoster()
- 6.2 video_filter.codecs.inc \video_filter_streamhoster()
Callback for Streamhoster codec.
See also
1 string reference to 'video_filter_streamhoster'
- video_filter_codec_info in ./
video_filter.codecs.inc - Implements hook_codec_info().
File
- ./
video_filter.codecs.inc, line 863 - This file contains all codecs provided by Video Filter.
Code
function video_filter_streamhoster($video) {
$video['source'] = '//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('//' . $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);
}