1

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 smile ) here: http://www.dehnsucht.info/v2/member/2/v … w/32-Test/

Last edited by jensrenner (2011-09-05 13:39:17)

2

Re: Embed adultism.com, xhamster.com videos

Based on the above mod, this goes for embedding XHamster videos:
Changes are in ext.metavideo.php, starting with function vldext_metavideo(). Add:

    elseif ( $params['type'] == 'xhamster' )
    {
        $width = ( isset($params['width']) ? $params['width'] : 510 );
        $height = ( isset($params['height']) ? $params['height'] : 400 );

        if ( $media == 'preview' )
        {
            return $preview;
        }
        else
        {
            return '<iframe width="' . $width . '" height="' . $height . '" src="http://xhamster.com/xembed.php?video=' . $video_id . '" frameborder="0" scrolling="no"></iframe>';
        }
    }

In function vld_parse_video_url() add:

    elseif ( $type == 'xhamster' )
    {
        preg_match('/\/movies\/([\d]+)\//', $url, $matches);
        if ( $matches )
        {
            $data = send_remote_request($url);
            preg_match("/'image':\s*'(http.*)'/siU", $data, $tmatches);
            return array($matches[1], ($tmatches[1] ? $tmatches[1] : ''));
        }
        else
        {
            return 'http://www.xhamster.com/movies/123456/foo_bar.html';
        }
    }

In function vld_vendors_list() add:

        'xhamster' => 'XHamster',

3

Re: Embed adultism.com, xhamster.com videos

Thanks for these great sources of adult video.

www.vldMagic.com - first choice customizations store and help desk

4

Re: Embed adultism.com, xhamster.com videos

Who has the code for other adult video sites?
thanks