Add http://video.mail.ru/ and http://rutube.ru

<?php
function video_filter_codec_info()
{
//...........
//...........

          
$codecs['rutube'] = array(
       
'name' => t('Rutube'),
       
'callback' => 'video_filter_rutube',
       
// http://rutube.ru/tracks/813899.html?v=849b004fbf521e1a4420b18221c63d80
       
'regexp' => '#rutube\.ru\/.*?\?v=([a-z0-9\-_]+)#i',
       
'ratio' => 400 / 353,
    );
   
$codecs['mailru'] = array(
       
'name' => t('Mailru'),
       
'callback' => 'video_filter_mailru',
       
// http://video.mail.ru/mail/kutasov-a/mobile_video/4206.html?newbest_from_main=1
       
'regexp' => array(0 => '#video\.mail\.ru\/mail\/(.*?)\/([0-9]*?)\.html#i',
                      ),
       
'ratio' => 450 / 385,
    );
   
    return
$codecs;
}

function
video_filter_mailru($video) {
   
$video['source'] = 'http://img.mail.ru/r/video2/player_v2.swf?par=http://content.video.mail.ru/mail/'.$video['codec']['matches'][1].'/$'.$video['codec']['matches'][2].($video['autoplay'] ? '&autoplay=1' : '');
   
    return
video_filter_flash($video);
}

function
video_filter_rutube($video) {
   
$video['source'] = 'http://video.rutube.ru/'.$video['codec']['matches'][1].($video['autoplay'] ? '&autoplay=1' : '');
   
    return
video_filter_flash($video);
}
?>

Thank you for a module

Files: 
CommentFileSizeAuthor
#11 add_ru.patch1.42 KBRamir

Comments

blackdog’s picture

Category:task» feature

@mkonk64 - Can you roll a proper patch for this?

OFF’s picture

Support is not expected?

blackdog’s picture

If I get a proper patch I'll review it.

OFF’s picture

A you dont made proper patch?

I will help with testing

blackdog’s picture

No, but feel free to create a patch from the code in the first comment. Make sure it's up to coding standards though.

OFF’s picture

I'am not coder (

duke333’s picture

Hi all!

This code dasn`t works corectly
1. You don`t have image file (thumbnail)
2. you don`t have duration in seconds

some one have providers (file like rutube.inc or mailru.inc) ?

AlexanderPop’s picture

Ingumsky’s picture

I'll try to implement the code from original post on my website later and will roll a patch if it works.

blackdog’s picture

Version:6.x-2.4» 6.x-3.x-dev
Status:Active» Needs work
Ramir’s picture

StatusFileSize
new1.42 KB