I tried to add a codec for Shoutfile.com and I almost succeeded:
I just added this code in video_filter.codecs:
(...)
$codecs['godtube'] = array(
'name' => t('GodTube'),
'callback' => 'video_filter_godtube',
'regexp' => '/godtube\.com\/view_video\.php\?viewkey=([a-z0-9]+)/',
'ratio' => 300 / 270,
);
$codecs['shoutfile'] = array(
'name' => t('Shoutfile'),
'callback' => 'video_filter_shoutfile',
'regexp' => '/www\.shoutfile\.com\/v\/([a-z0-9]+)/i',
'ratio' => 400 / 300,
);
return $codecs;
}
(...)
function video_filter_godtube($video) {
$video['source'] = 'http://www.godtube.com/flvplayer.swf?viewkey='.$video['codec']['matches'][1];
return video_filter_flash($video);
}
function video_filter_shoutfile($video) {
$video['source'] = 'http://www.shoutfile.com/emb/'.$video['codec']['matches'][1].($video['autoplay'] ? '&autoplay=1' : '');
return video_filter_flash($video);
}
?>
It works, but the ratio is not correct yet, I do not know how to handle that properly. It almost seems like the codec is not used by the module, and is still using youtube codecs. How can I make the module use my codec? How do I add a module and use it? Just use the template and name it (in this example) shoutfile_MODULE ?
Comments
Comment #1
Oceria commentedSorry, was not version 1.6, but 2.0
Comment #2
fokkezb commented(removed:double post)
Comment #3
fokkezb commentedSorry I can't help you. My internetfilter doesn't let me view shoutfile.com
Are you sure that 400x300 is the default size for a shoutfile embed code? Just drop the embed code shoutfile.com offers here and I will look.
Comment #4
Oceria commentedI can't blame your filter to reject Shoutfile. I found a suitable one for here (warning: heavy metal and dogs)
The url of a video on Shoutfile is like this:
http://www.shoutfile.com/v/6dv233kA/Death_Metal_Puppy_is_AWESOMEbut
http://www.shoutfile.com/v/6dv233kA/will also work.
The embed code is
<embed allowScriptAccess="always" src="http://www.shoutfile.com/emb/6dv233kA" allowFullScreen="true" width="400" height="300" border="0" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />Comment #5
blackdog commentedPlease re-open if this is still an issue.