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

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

CommentFileSizeAuthor
#11 add_ru.patch1.42 KBRamir
Support from Acquia helps fund testing for Drupal Acquia logo

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

FileSize
1.42 KB
minnur’s picture

Issue summary: View changes

Is this still relevant ? Please review and provide a patch and I will add this to both D7 and D8 versions.

minnur’s picture

Version: 6.x-3.x-dev » 7.x-3.x-dev
minnur’s picture

Status: Needs work » Patch (to be ported)

This has been added to D8 version with some modifications .

minnur’s picture

Title: Add http://video.mail.ru/ and http://rutube.ru » Add support for Rutube and Mail.ru
minnur’s picture

Status: Patch (to be ported) » Fixed

  • minnur committed 551f544 on 8.x-1.x
    Issue #278604 by Ramir, minnur: Add support for Mail.ru.
    

  • minnur committed e7635c4 on 7.x-3.x
    Issue #278604 by Ramir, minnur: Add Mail.Ru and Rutube support.
    
minnur’s picture

Status: Fixed » Closed (fixed)