Topic: Embed adultism.com, xhamster.com videos
For embedding adultism.com videos, 3 files have to be modded plus adding another swf-player.
Most changes are in ext.metavideo.php:
In function vldext_metavideo(), append
elseif ( $params['type'] == 'adultism' )
{
$width = ( isset($params['width']) ? $params['width'] : 550 );
$height = ( isset($params['height']) ? $params['height'] : 432 );
if ( $media == 'preview' )
{
return $preview;
}
else
{
return '<script type="text/javascript">swfobject.embedSWF("/media/utils/jw_player.swf", "flashcontent", "' . $width . '", "' . $height . '", "10", false, {file: "' . $video_id . '", image: "' . $preview . '"}, {allowfullscreen: "true"}, false);</script><div id="flashcontent">Embed Fail</div>';
}
}In function vld_parse_video_url() append
elseif ( $type == 'adultism' )
{
preg_match('/\/watch\/([\d]+)\//', $url, $matches);
if ( $matches )
{
$data = send_remote_request('http://www.adultism.com', '/watch/'.$matches[1].'/');
if (preg_match("/file:\s*\"(http.*)\"/siU", $data, $fmatches)) {
preg_match("/image:\s*\"(http.*)\"/siU", $data, $tmatches);
return array($fmatches[1], $tmatches[1]);
}
}
else
{
return 'http://www.adultism.com/watch/123456/';
}
}In function vld_vendors_list() add
'adultism' => 'Adultism',To have the preview picture showing also in the player (before starting the video), change in member_videos_view.tpl
{metavideo:video_id=meta_id,type=video_type}to
{metavideo:video_id=meta_id,type=video_type,media="",preview=video_preview}Since the video_preview variable is not assigned there, change in file lib.member_videos.php in function show_video()
if ( !$obj->type )
{
$TEMPLATE->assign("video_filename", 'video_' . $obj->filename);
}
else
{
$TEMPLATE->assign("meta_id", $obj->meta_id);
$TEMPLATE->assign("meta_url", $obj->meta_url);
}to
if ( !$obj->type )
{
$TEMPLATE->assign("video_filename", 'video_' . $obj->filename);
}
else
{
$TEMPLATE->assign("video_preview", 'video_preview_' . $obj->preview);
$TEMPLATE->assign("meta_id", $obj->meta_id);
$TEMPLATE->assign("meta_url", $obj->meta_url);
}Last, get jw_player.swf from http://www.adultism.com/flash/jw_player.swf and upload it to your /media/utils directory. (Existing mediaplayer.swf seems to have some problems with the code ...)
For me, it works like a charm!
You can see an example (not x-rated
) here: http://www.dehnsucht.info/v2/member/2/v
w/32-Test/
Last edited by jensrenner (2011-09-05 13:39:17)