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

Oceria’s picture

Version: 5.x-1.6 » 5.x-2.0

Sorry, was not version 1.6, but 2.0

fokkezb’s picture

Status: Postponed (maintainer needs more info) » Active

(removed:double post)

fokkezb’s picture

Status: Active » Postponed (maintainer needs more info)

Sorry 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.

Oceria’s picture

Status: Active » Postponed (maintainer needs more info)

I 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_AWESOME
but
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" />

blackdog’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)

Please re-open if this is still an issue.