vk.com - big Russian social network.
Including videos from there should also be possible by video_filter
Thanks for nice hooks, it did not make much time to write a hook adding this functionality:

function customsite_codec_info() {
    $codecs = array();
    $codecs['vk'] = array(
        'name' => t('VK'),
        'callback' => 'customsite_vk',
        'regexp' => '/vk\.com\/video([0-9]+)\_([0-9]+)\?hash=([a-z0-9]+)/i',
        'ratio' => 607 / 360,
    );
    return $codecs;
}

function customsite_vk($video) {
    $video['source'] = 'http://vk.com/video_ext.php?oid='.$video['codec']['matches'][1]."&id=".$video['codec']['matches'][2]."&hash=".$video['codec']['matches'][3]."&hd=1";
    return video_filter_iframe($video);
}

Transformation:
http://vk.com/video92267979_164947616?hash=bb7c2f9646236401
->
http://vk.com/video_ext.php?oid=92267979&id=164947616&hash=bb7c2f9646236...

However, I think this could be added to the main branch.

Comments

TheMystique’s picture

Issue summary:View changes

Hello __Sander_

Can you tell me how to add this to the video filter i mean wich files i need to edit and where

Note i am a 2 days user of drupal :) used only wp till now

ultimateboy’s picture

Version:6.x-3.x-dev» 7.x-3.x-dev

Moving to 7.x-3.x

OFF’s picture

Good News Guys!

OFF’s picture

How i can make it work?

I try to put this code:

[video:http://vk.com/video_ext.php?oid=92267979&id=164947616&hash=bb7c2f9646236...

But video is not show

Please help!

OFF’s picture

Any body here?

OFF’s picture

I am added 2 parts of code in the video_field.codecs.inc

line 227:

$codecs['vk'] = array(
'name' => t('VK'),
'sample_url' => 'http://vk.com/video92267979_164947616',
'callback' => 'video_filter_vk',
'regexp' => array(
'/vk\.com\/video([0-9]+)\_([0-9]+)\?hash=([a-z0-9]+)/i',
),
'ratio' => 16 / 9,
'control_bar_height' => 25,
);

line 244:

/**
* Callback for vk.com codec.
*
* @see video_filter_codec_info()
*/
function video_filter_vk($video) {
$video['source'] = 'http://vk.com/video_ext.php?oid='.$video['codec']['matches'][1]."&id=".$video['codec']['matches'][2]."&hash=".$video['codec']['matches'][3]."&hd=1";
return video_filter_iframe($video);
}

And it's working!

Please add to the dev version

ultimateboy’s picture

Please read the documentation on how to create and submit a patch : https://www.drupal.org/node/707484

With a working patch (that adheres to drupal coding standards), I'll gladly add this to the module.

OFF’s picture

But its not working without this part of url:

?hash=bb7c2f9646236401