|
@@ -16,7 +16,7 @@ function video_filter_codec_info() {
|
|
'sample_url' => 'http://www.archive.org/details/DrupalconBoston2008-TheStateOfDrupal',
|
|
'sample_url' => 'http://www.archive.org/details/DrupalconBoston2008-TheStateOfDrupal',
|
|
'callback' => 'video_filter_archive',
|
|
'callback' => 'video_filter_archive',
|
|
'html5_callback' => 'video_filter_archive',
|
|
'html5_callback' => 'video_filter_archive',
|
|
- 'regexp' => '/archive\.org\/details\/([\w-_]+)/i',
|
|
|
|
|
|
+ 'regexp' => '/archive\.org\/details\/([\w-_\.]+)/i',
|
|
'ratio' => 4 / 3,
|
|
'ratio' => 4 / 3,
|
|
);
|
|
);
|
|
|
|
|
|
@@ -60,15 +60,43 @@ function video_filter_codec_info() {
|
|
'control_bar_height' => 0,
|
|
'control_bar_height' => 0,
|
|
);
|
|
);
|
|
|
|
|
|
|
|
+ $codecs['coub'] = array(
|
|
|
|
+ 'name' => t('Coub'),
|
|
|
|
+ 'sample_url' => 'http://coub.com/view/b7ghv',
|
|
|
|
+ 'callback' => 'video_filter_coub',
|
|
|
|
+ 'html5_callback' => 'video_filter_coub',
|
|
|
|
+ 'regexp' => '/coub\.com\/view\/([a-z0-9]+)/i',
|
|
|
|
+ 'ratio' => 4 / 3,
|
|
|
|
+ );
|
|
|
|
+
|
|
$codecs['dailymotion'] = array(
|
|
$codecs['dailymotion'] = array(
|
|
'name' => t('DailyMotion'),
|
|
'name' => t('DailyMotion'),
|
|
'sample_url' => 'http://www.dailymotion.com/video/some_video_title',
|
|
'sample_url' => 'http://www.dailymotion.com/video/some_video_title',
|
|
'callback' => 'video_filter_dailymotion',
|
|
'callback' => 'video_filter_dailymotion',
|
|
|
|
+ 'html5_callback' => 'video_filter_dailymotion_html5',
|
|
'regexp' => '/dailymotion\.com\/video\/([a-z0-9\-_]+)/i',
|
|
'regexp' => '/dailymotion\.com\/video\/([a-z0-9\-_]+)/i',
|
|
'ratio' => 4 / 3,
|
|
'ratio' => 4 / 3,
|
|
'control_bar_height' => 20,
|
|
'control_bar_height' => 20,
|
|
);
|
|
);
|
|
|
|
|
|
|
|
+ $codecs['democracynow_fullshow'] = array(
|
|
|
|
+ 'name' => t('DemocracyNow Fullshow'),
|
|
|
|
+ 'sample_url' => 'http://www.democracynow.org/shows/2015/3/20',
|
|
|
|
+ 'callback' => 'video_filter_democracynow_fullshow',
|
|
|
|
+ 'regexp' => '/democracynow\.org\/shows\/([0-9]+)\/([0-9]+)\/([0-9]+)/',
|
|
|
|
+ 'ratio' => 16 / 9,
|
|
|
|
+ 'control_bar_height' => 0,
|
|
|
|
+ );
|
|
|
|
+
|
|
|
|
+ $codecs['democracynow_story'] = array(
|
|
|
|
+ 'name' => t('DemocracyNow Story'),
|
|
|
|
+ 'sample_url' => 'http://www.democracynow.org/2015/3/23/yemen_in_crisis_us_closes_key',
|
|
|
|
+ 'callback' => 'video_filter_democracynow_story',
|
|
|
|
+ 'regexp' => '/democracynow\.org\/([0-9]+)\/([0-9]+)\/([0-9]+)\/([a-zA-Z0-9\-_]+)/',
|
|
|
|
+ 'ratio' => 16 / 9,
|
|
|
|
+ 'control_bar_height' => 0,
|
|
|
|
+ );
|
|
|
|
+
|
|
$codecs['flickr_slideshows'] = array(
|
|
$codecs['flickr_slideshows'] = array(
|
|
'name' => t('Flickr Slideshows'),
|
|
'name' => t('Flickr Slideshows'),
|
|
'sample_url' => 'http://www.flickr.com/photos/username/sets/1234567890/show/',
|
|
'sample_url' => 'http://www.flickr.com/photos/username/sets/1234567890/show/',
|
|
@@ -87,6 +115,16 @@ function video_filter_codec_info() {
|
|
'control_bar_height' => 0,
|
|
'control_bar_height' => 0,
|
|
);
|
|
);
|
|
|
|
|
|
|
|
+ $codecs['foxnews'] = array(
|
|
|
|
+ 'name' => t('Fox News'),
|
|
|
|
+ 'sample_url' => 'http://video.foxnews.com/v/123456/the-title/',
|
|
|
|
+ 'callback' => 'video_filter_foxnews',
|
|
|
|
+ 'html5_callback' => 'video_filter_foxnews',
|
|
|
|
+ 'regexp' => '/video\.foxnews\.com\/v\/([0-9]+)\/([a-zA-Z0-9\-]+)/i',
|
|
|
|
+ 'ratio' => 466 / 263,
|
|
|
|
+ 'control_bar_height' => 0,
|
|
|
|
+ );
|
|
|
|
+
|
|
$codecs['gametrailers'] = array(
|
|
$codecs['gametrailers'] = array(
|
|
'name' => t('Game Trailers'),
|
|
'name' => t('Game Trailers'),
|
|
'sample_url' => 'http://www.gametrailers.com/video/some-title/12345',
|
|
'sample_url' => 'http://www.gametrailers.com/video/some-title/12345',
|
|
@@ -106,6 +144,15 @@ function video_filter_codec_info() {
|
|
'ratio' => 500 / 319,
|
|
'ratio' => 500 / 319,
|
|
);
|
|
);
|
|
|
|
|
|
|
|
+ $codecs['giphy'] = array(
|
|
|
|
+ 'name' => t('Giphy'),
|
|
|
|
+ 'sample_url' => 'http://giphy.com/gifs/disney-kids-peter-pan-[gif-id]',
|
|
|
|
+ 'callback' => 'video_filter_giphy',
|
|
|
|
+ 'html5_callback' => 'video_filter_giphy',
|
|
|
|
+ 'regexp' => '/giphy\.com\/gifs\/(([a-zA-Z0-9\-]+)\-|)([a-zA-Z0-9]+)/i',
|
|
|
|
+ 'ratio' => 16 / 9,
|
|
|
|
+ );
|
|
|
|
+
|
|
$codecs['godtube'] = array(
|
|
$codecs['godtube'] = array(
|
|
'name' => t('GodTube'),
|
|
'name' => t('GodTube'),
|
|
'sample_url' => 'http://www.godtube.com/watch/?v=123abc',
|
|
'sample_url' => 'http://www.godtube.com/watch/?v=123abc',
|
|
@@ -123,6 +170,17 @@ function video_filter_codec_info() {
|
|
'ratio' => 400 / 326,
|
|
'ratio' => 400 / 326,
|
|
);
|
|
);
|
|
|
|
|
|
|
|
+ $codecs['instagram'] = array(
|
|
|
|
+ 'name' => t('Instagram'),
|
|
|
|
+ 'callback' => 'video_filter_instagram',
|
|
|
|
+ 'sample_url' => 'http://instagram.com/p/uN1qUeId',
|
|
|
|
+ 'regexp' => array(
|
|
|
|
+ '/instagram\.com\/p\/([a-z0-9\-_]+)/i',
|
|
|
|
+ '/instagr.am\/p\/([a-z0-9\-_]+)/i',
|
|
|
|
+ ),
|
|
|
|
+ 'ratio' => 612 / 710,
|
|
|
|
+ );
|
|
|
|
+
|
|
$codecs['metacafe'] = array(
|
|
$codecs['metacafe'] = array(
|
|
'name' => t('Meta Cafe'),
|
|
'name' => t('Meta Cafe'),
|
|
'sample_url' => 'http://www.metacafe.com/watch/1234567890/some_title/',
|
|
'sample_url' => 'http://www.metacafe.com/watch/1234567890/some_title/',
|
|
@@ -132,6 +190,16 @@ function video_filter_codec_info() {
|
|
'control_bar_height' => 32,
|
|
'control_bar_height' => 32,
|
|
);
|
|
);
|
|
|
|
|
|
|
|
+ $codecs['mailru'] = array(
|
|
|
|
+ 'name' => t('Mail.Ru'),
|
|
|
|
+ 'sample_url' => 'https://my.mail.ru/v/semenikhin_denis/video/_groupvideo/[video-id].html',
|
|
|
|
+ 'callback' => 'video_filter_mailru',
|
|
|
|
+ 'html5_callback' => 'video_filter_mailru',
|
|
|
|
+ 'regexp' => '/my\.mail\.ru\/v\/(.*)\/([0-9]+)\.html/i',
|
|
|
|
+ 'ratio' => 16 / 9,
|
|
|
|
+ 'control_bar_height' => 0,
|
|
|
|
+ );
|
|
|
|
+
|
|
$codecs['myspace'] = array(
|
|
$codecs['myspace'] = array(
|
|
'name' => t('MySpace'),
|
|
'name' => t('MySpace'),
|
|
'sample_url' => 'http://myspace.com/video/vid/1234567890',
|
|
'sample_url' => 'http://myspace.com/video/vid/1234567890',
|
|
@@ -146,6 +214,17 @@ function video_filter_codec_info() {
|
|
'control_bar_height' => 40,
|
|
'control_bar_height' => 40,
|
|
);
|
|
);
|
|
|
|
|
|
|
|
+ $codecs['myvideo'] = array(
|
|
|
|
+ 'name' => t('MyVideo'),
|
|
|
|
+ 'sample_url' => 'http://www.myvideo.de/filme/story-title-1234567890',
|
|
|
|
+ 'html5_callback' => 'video_filter_myvideo',
|
|
|
|
+ 'callback' => 'video_filter_myvideo',
|
|
|
|
+ 'regexp' => array(
|
|
|
|
+ '/myvideo\.de\/(.+)\-([0-9]+)/i',
|
|
|
|
+ ),
|
|
|
|
+ 'ratio' => 400 / 283,
|
|
|
|
+ );
|
|
|
|
+
|
|
$codecs['picasa_slideshows'] = array(
|
|
$codecs['picasa_slideshows'] = array(
|
|
'name' => t('Picasa Slideshows'),
|
|
'name' => t('Picasa Slideshows'),
|
|
'sample_url' => 'http://picasaweb.google.com/data/feed/base/user/USER_NAME/albumid/5568104935784209834?alt=rss&kind=photo&hl=en_US',
|
|
'sample_url' => 'http://picasaweb.google.com/data/feed/base/user/USER_NAME/albumid/5568104935784209834?alt=rss&kind=photo&hl=en_US',
|
|
@@ -162,6 +241,17 @@ function video_filter_codec_info() {
|
|
'ratio' => 800 / 600,
|
|
'ratio' => 800 / 600,
|
|
);
|
|
);
|
|
|
|
|
|
|
|
+ $codecs['rutube'] = array(
|
|
|
|
+ 'name' => t('Rutube'),
|
|
|
|
+ 'sample_url' => 'http://rutube.ru/video/c80617086143e80ee08f760a2e9cbf43/?pl_type=source&pl_id=8188',
|
|
|
|
+ 'html5_callback' => 'video_filter_rutube',
|
|
|
|
+ 'callback' => 'video_filter_rutube',
|
|
|
|
+ 'regexp' => array(
|
|
|
|
+ '/rutube\.ru\/(.*)/i',
|
|
|
|
+ ),
|
|
|
|
+ 'ratio' => 16 / 9,
|
|
|
|
+ );
|
|
|
|
+
|
|
$codecs['slideshare'] = array(
|
|
$codecs['slideshare'] = array(
|
|
'name' => t('Slideshare'),
|
|
'name' => t('Slideshare'),
|
|
'sample_url' => 'http://slideshare.net/1759622',
|
|
'sample_url' => 'http://slideshare.net/1759622',
|
|
@@ -190,6 +280,41 @@ function video_filter_codec_info() {
|
|
'ratio' => 16 / 9,
|
|
'ratio' => 16 / 9,
|
|
);
|
|
);
|
|
|
|
|
|
|
|
+ $codecs['ted'] = array(
|
|
|
|
+ 'name' => t('TED'),
|
|
|
|
+ 'sample_url' => 'https://www.ted.com/talks/[story-title]',
|
|
|
|
+ 'instructions' => t('Click in Embed and copy the "Link to this talk" link and paste here.'),
|
|
|
|
+ 'callback' => 'video_filter_ted',
|
|
|
|
+ 'html5_callback' => 'video_filter_ted',
|
|
|
|
+ 'regexp' => '/ted\.com\/talks\/lang\/([a-zA-Z]+)\/([a-zA-Z0-9\-_]+)(\.html)?/',
|
|
|
|
+ 'ratio' => 4 / 3,
|
|
|
|
+ );
|
|
|
|
+
|
|
|
|
+ $codecs['twitch'] = array(
|
|
|
|
+ 'name' => t('Twitch'),
|
|
|
|
+ 'sample_url' => 'http://www.twitch.tv/uN1qUe-I_d',
|
|
|
|
+ 'callback' => 'video_filter_twitch',
|
|
|
|
+ 'regexp' => '/twitch\.tv\/([a-z0-9\-_]+)/i',
|
|
|
|
+ 'ratio' => 16 / 9,
|
|
|
|
+ );
|
|
|
|
+
|
|
|
|
+ $codecs['ustream'] = array(
|
|
|
|
+ 'name' => t('Ustream'),
|
|
|
|
+ 'sample_url' => 'http://www.ustream.tv/recorded/111212121212',
|
|
|
|
+ 'html5_callback' => 'video_filter_ustream',
|
|
|
|
+ 'callback' => 'video_filter_ustream',
|
|
|
|
+ 'regexp' => '/ustream\.tv\/recorded\/([0-9]+)/i',
|
|
|
|
+ 'ratio' => 16 / 9,
|
|
|
|
+ );
|
|
|
|
+
|
|
|
|
+ $codecs['vbox'] = array(
|
|
|
|
+ 'name' => t('Vbox7'),
|
|
|
|
+ 'sample_url' => 'http://vbox7.com/play:b4a7291f3d',
|
|
|
|
+ 'callback' => 'video_filter_vbox',
|
|
|
|
+ 'regexp' => '/vbox7\.com\/play\:([a-z0-9]+)/i',
|
|
|
|
+ 'ratio' => 400 / 345,
|
|
|
|
+ );
|
|
|
|
+
|
|
$codecs['vimeo'] = array(
|
|
$codecs['vimeo'] = array(
|
|
'name' => t('Vimeo'),
|
|
'name' => t('Vimeo'),
|
|
'sample_url' => 'http://www.vimeo.com/123456',
|
|
'sample_url' => 'http://www.vimeo.com/123456',
|
|
@@ -200,6 +325,24 @@ function video_filter_codec_info() {
|
|
'control_bar_height' => 0,
|
|
'control_bar_height' => 0,
|
|
);
|
|
);
|
|
|
|
|
|
|
|
+ $codecs['vine'] = array(
|
|
|
|
+ 'name' => t('Vine'),
|
|
|
|
+ 'sample_url' => 'https://www.vine.co/v/uN1qUeId',
|
|
|
|
+ 'callback' => 'video_filter_vine',
|
|
|
|
+ 'regexp' => '/vine\.co\/v\/([0-9a-z]+)/i',
|
|
|
|
+ 'ratio' => 4 / 3,
|
|
|
|
+ );
|
|
|
|
+
|
|
|
|
+ $codecs['whatchado'] = array(
|
|
|
|
+ 'name' => t('whatchado'),
|
|
|
|
+ 'sample_url' => 'https://www.whatchado.com/de/some-title',
|
|
|
|
+ 'callback' => 'video_filter_whatchado_whatchado',
|
|
|
|
+ 'regexp' => array(
|
|
|
|
+ '/whatchado\.com\/[a-z]{2}\/([\w-_]+)/i',
|
|
|
|
+ ),
|
|
|
|
+ 'ratio' => 960 / 540,
|
|
|
|
+ );
|
|
|
|
+
|
|
$codecs['wistia'] = array(
|
|
$codecs['wistia'] = array(
|
|
'name' => t('Wistia'),
|
|
'name' => t('Wistia'),
|
|
'sample_url' => 'http://wistia.com/medias/9pj9n6ftlk',
|
|
'sample_url' => 'http://wistia.com/medias/9pj9n6ftlk',
|
|
@@ -208,6 +351,19 @@ function video_filter_codec_info() {
|
|
'regexp' => '@https?://(.+\.)?(wistia\.(com|net)|wi\.st)/((m|medias|projects)|embed/(iframe|playlists))/([a-zA-Z0-9]+)@',
|
|
'regexp' => '@https?://(.+\.)?(wistia\.(com|net)|wi\.st)/((m|medias|projects)|embed/(iframe|playlists))/([a-zA-Z0-9]+)@',
|
|
);
|
|
);
|
|
|
|
|
|
|
|
+ $codecs['youku'] = array(
|
|
|
|
+ 'name' => t('YouKu'),
|
|
|
|
+ 'sample_url' => 'http://v.youku.com/v_show/id_XNjgzNDM4MzIw.html',
|
|
|
|
+ 'callback' => 'video_filter_youku_html5',
|
|
|
|
+ 'html5_callback' => 'video_filter_youku_html5',
|
|
|
|
+ 'regexp' => array(
|
|
|
|
+ '/youku\.com\/v_show\/id_([a-z0-9\-_=]+)\.html/i',
|
|
|
|
+ '/youku\.com\/player\.php\/sid\/([a-z0-9\-_=]+)/i',
|
|
|
|
+ ),
|
|
|
|
+ 'ratio' => 16 / 9,
|
|
|
|
+ 'control_bar_height' => 50,
|
|
|
|
+ );
|
|
|
|
+
|
|
$codecs['youtube'] = array(
|
|
$codecs['youtube'] = array(
|
|
'name' => t('YouTube'),
|
|
'name' => t('YouTube'),
|
|
'sample_url' => 'http://www.youtube.com/watch?v=uN1qUeId',
|
|
'sample_url' => 'http://www.youtube.com/watch?v=uN1qUeId',
|
|
@@ -220,7 +376,7 @@ function video_filter_codec_info() {
|
|
'/youtube\.com\/embed\/([a-z0-9\-_]+)/i',
|
|
'/youtube\.com\/embed\/([a-z0-9\-_]+)/i',
|
|
),
|
|
),
|
|
'ratio' => 16 / 9,
|
|
'ratio' => 16 / 9,
|
|
- 'control_bar_height' => 25,
|
|
|
|
|
|
+ 'control_bar_height' => 0,
|
|
);
|
|
);
|
|
|
|
|
|
$codecs['youtube_playlist'] = array(
|
|
$codecs['youtube_playlist'] = array(
|
|
@@ -231,7 +387,7 @@ function video_filter_codec_info() {
|
|
'/youtube\.com\/playlist\?list=([a-z0-9\-_]+)/i',
|
|
'/youtube\.com\/playlist\?list=([a-z0-9\-_]+)/i',
|
|
),
|
|
),
|
|
'ratio' => 16 / 9,
|
|
'ratio' => 16 / 9,
|
|
- 'control_bar_height' => 25,
|
|
|
|
|
|
+ 'control_bar_height' => 0,
|
|
);
|
|
);
|
|
|
|
|
|
return $codecs;
|
|
return $codecs;
|
|
@@ -344,17 +500,51 @@ function video_filter_collegehumor($video) {
|
|
return video_filter_flash($video);
|
|
return video_filter_flash($video);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+/**
|
|
|
|
+ * HTML5 callback for Coub codec.
|
|
|
|
+ *
|
|
|
|
+ * @see video_filter_codec_info()
|
|
|
|
+ */
|
|
|
|
+function video_filter_coub($video) {
|
|
|
|
+ $attributes = array(
|
|
|
|
+ 'autostart' => !empty($video['autoplay']) ? 'autoplay=true' : 'autoplay=false',
|
|
|
|
+ 'originalSize' => !empty($video['originalSize']) ? 'originalSize=true' : 'originalSize=false',
|
|
|
|
+ 'startWithHD' => !empty($video['startWithHD']) ? 'startWithHD=true' : 'startWithHD=false',
|
|
|
|
+ 'muted' => !empty($video['muted']) ? 'muted=true' : 'muted=false',
|
|
|
|
+ );
|
|
|
|
+ $video['source'] = '//coub.com/embed/' . $video['codec']['matches'][1] . '?' . implode('&', $attributes);
|
|
|
|
+
|
|
|
|
+ return video_filter_iframe($video);
|
|
|
|
+}
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* Callback for DailyMotion codec.
|
|
* Callback for DailyMotion codec.
|
|
*
|
|
*
|
|
* @see video_filter_codec_info()
|
|
* @see video_filter_codec_info()
|
|
*/
|
|
*/
|
|
function video_filter_dailymotion($video) {
|
|
function video_filter_dailymotion($video) {
|
|
- $video['source'] = '//www.dailymotion.com/swf/' . $video['codec']['matches'][1];
|
|
|
|
|
|
+ $attributes = array(
|
|
|
|
+ 'autoplay' => $video['autoplay'] ? 'autoplay=1' : 'autoplay=0',
|
|
|
|
+ );
|
|
|
|
+ $video['source'] = '//www.dailymotion.com/swf/' . $video['codec']['matches'][1] . '?' . implode('&', $attributes);
|
|
|
|
|
|
return video_filter_flash($video);
|
|
return video_filter_flash($video);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+/**
|
|
|
|
+ * HTML5 callback for DailyMotion codec.
|
|
|
|
+ *
|
|
|
|
+ * @see video_filter_codec_info()
|
|
|
|
+ */
|
|
|
|
+function video_filter_dailymotion_html5($video) {
|
|
|
|
+ $attributes = array(
|
|
|
|
+ 'autoplay' => $video['autoplay'] ? 'autoplay=1' : 'autoplay=0',
|
|
|
|
+ );
|
|
|
|
+ $video['source'] = '//www.dailymotion.com/embed/video/' . $video['codec']['matches'][1] . '?' . implode('&', $attributes);
|
|
|
|
+
|
|
|
|
+ return video_filter_iframe($video);
|
|
|
|
+}
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* Callback for Flickr Slideshows codec.
|
|
* Callback for Flickr Slideshows codec.
|
|
*
|
|
*
|
|
@@ -372,6 +562,50 @@ function video_filter_flickr_slideshows($video) {
|
|
return video_filter_flash($video, $params);
|
|
return video_filter_flash($video, $params);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+/**
|
|
|
|
+ * Callback for DemocracyNow Fullshow codec.
|
|
|
|
+ *
|
|
|
|
+ * @see video_filter_codec_info()
|
|
|
|
+ */
|
|
|
|
+function video_filter_democracynow_fullshow($video) {
|
|
|
|
+ $video['source'] = 'http://www.democracynow.org/embed/show/' . $video['codec']['matches'][0];
|
|
|
|
+ // The above is pulling in the url part of the regex, so we need to do a
|
|
|
|
+ // search and replace to remove it.
|
|
|
|
+ $toomuch = array("http://www.democracynow.org/embed/show/democracynow.org/shows/");
|
|
|
|
+ $justright = array("http://www.democracynow.org/embed/show/");
|
|
|
|
+ $replaced = str_replace($toomuch, $justright, $video);
|
|
|
|
+ $video = $replaced;
|
|
|
|
+
|
|
|
|
+ return video_filter_iframe($video);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * Callback for DemocracyNow story codec.
|
|
|
|
+ *
|
|
|
|
+ * @see video_filter_codec_info()
|
|
|
|
+ */
|
|
|
|
+function video_filter_democracynow_story($video) {
|
|
|
|
+ $video['source'] = 'http://www.democracynow.org/embed/story/' . $video['codec']['matches'][0];
|
|
|
|
+ // The above is pulling in the url part of the regex, so we need to do a
|
|
|
|
+ // search and replace to remove it.
|
|
|
|
+ $toomuch = array("http://www.democracynow.org/embed/story/democracynow.org/");
|
|
|
|
+ $justright = array("http://www.democracynow.org/embed/story/");
|
|
|
|
+ $replaced = str_replace($toomuch, $justright, $video);
|
|
|
|
+ $video = $replaced;
|
|
|
|
+
|
|
|
|
+ return video_filter_iframe($video);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * Callback for Ted.com codec.
|
|
|
|
+ *
|
|
|
|
+ * @see video_filter_codec_info()
|
|
|
|
+ */
|
|
|
|
+function video_filter_ted($video) {
|
|
|
|
+ $video['source'] = '//embed.ted.com/talks/' . $video['codec']['matches'][3] . '.html';
|
|
|
|
+ return video_filter_iframe($video);
|
|
|
|
+}
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* Callback for Flickr Video codec.
|
|
* Callback for Flickr Video codec.
|
|
*
|
|
*
|
|
@@ -385,6 +619,17 @@ function video_filter_flickr_video($video) {
|
|
return video_filter_flash($video, $params);
|
|
return video_filter_flash($video, $params);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+/**
|
|
|
|
+ * Callback for Fox News codec.
|
|
|
|
+ *
|
|
|
|
+ * @see video_filter_codec_info()
|
|
|
|
+ */
|
|
|
|
+function video_filter_foxnews($video) {
|
|
|
|
+ $video_id = $video['codec']['matches'][1];
|
|
|
|
+ $html = '<script type="text/javascript" src="http://video.foxnews.com/v/embed.js?id=' . $video_id . '&w=' . $video['width'] . '&h=' . $video['height'] . '"></script>';
|
|
|
|
+ return $html;
|
|
|
|
+}
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* Callback for Game Trailers codec.
|
|
* Callback for Game Trailers codec.
|
|
*
|
|
*
|
|
@@ -413,6 +658,17 @@ function video_filter_gamevideos($video) {
|
|
return video_filter_flash($video);
|
|
return video_filter_flash($video);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+/**
|
|
|
|
+ * Callback for Giphy codec.
|
|
|
|
+ *
|
|
|
|
+ * @see video_filter_codec_info()
|
|
|
|
+ */
|
|
|
|
+function video_filter_giphy($video) {
|
|
|
|
+ $video['source'] = '//giphy.com/embed/' . $video['codec']['matches'][3];
|
|
|
|
+
|
|
|
|
+ return video_filter_iframe($video);
|
|
|
|
+}
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* Callback for GodTube codec.
|
|
* Callback for GodTube codec.
|
|
*
|
|
*
|
|
@@ -435,6 +691,44 @@ function video_filter_google($video) {
|
|
return video_filter_flash($video);
|
|
return video_filter_flash($video);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+/**
|
|
|
|
+ * Callback for Instagram codec.
|
|
|
|
+ *
|
|
|
|
+ * @see video_filter_codec_info()
|
|
|
|
+ */
|
|
|
|
+function video_filter_instagram($video) {
|
|
|
|
+ $html = &drupal_static(__FUNCTION__);
|
|
|
|
+ $id = $video['codec']['matches'][1];
|
|
|
|
+ if ($cache = cache_get('video_filter_instagram:' . $id)) {
|
|
|
|
+ $html = $cache->data;
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ $endpoint = 'https://api.instagram.com/oembed';
|
|
|
|
+ $options = array(
|
|
|
|
+ 'url' => 'http://instagr.am/p/' . $id,
|
|
|
|
+ );
|
|
|
|
+ $data = video_filter_oembed_request($endpoint, $options);
|
|
|
|
+ if (!empty($data['html'])) {
|
|
|
|
+ $html = $data['html'];
|
|
|
|
+ }
|
|
|
|
+ cache_set('video_filter_instagram:' . $id, $html, 'cache');
|
|
|
|
+ }
|
|
|
|
+ return $html;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * Callback for Mail.Ru codec.
|
|
|
|
+ *
|
|
|
|
+ * @see video_filter_codec_info()
|
|
|
|
+ */
|
|
|
|
+function video_filter_mailru($video) {
|
|
|
|
+ $attributes = array(
|
|
|
|
+ 'autoplay' => !empty($video['autoplay']) ? 'autoplay=' . (int) $video['autoplay'] : '',
|
|
|
|
+ );
|
|
|
|
+ $video['source'] = 'https://videoapi.my.mail.ru/videos/embed/v/' . $video['codec']['matches'][1] . '/' . $video['codec']['matches'][2] . '.html?' . implode('&', $attributes);
|
|
|
|
+ return video_filter_iframe($video);
|
|
|
|
+}
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* Callback for Meta Cafe codec.
|
|
* Callback for Meta Cafe codec.
|
|
*
|
|
*
|
|
@@ -459,6 +753,16 @@ function video_filter_myspace($video) {
|
|
return video_filter_flash($video, $params);
|
|
return video_filter_flash($video, $params);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+/**
|
|
|
|
+ * Callback for MyVideo codec.
|
|
|
|
+ *
|
|
|
|
+ * @see video_filter_codec_info()
|
|
|
|
+ */
|
|
|
|
+function video_filter_myvideo($video) {
|
|
|
|
+ $video['source'] = 'http://www.myvideo.de/embedded/public/' . $video['codec']['matches'][2];
|
|
|
|
+ return video_filter_iframe($video);
|
|
|
|
+}
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* Callback for Picasa Slideshows codec.
|
|
* Callback for Picasa Slideshows codec.
|
|
*
|
|
*
|
|
@@ -475,6 +779,32 @@ function video_filter_picasa_slideshows($video) {
|
|
return video_filter_flash($video, $params);
|
|
return video_filter_flash($video, $params);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+/**
|
|
|
|
+ * Callback for Rutube codec.
|
|
|
|
+ *
|
|
|
|
+ * @see video_filter_codec_info()
|
|
|
|
+ */
|
|
|
|
+function video_filter_rutube($video) {
|
|
|
|
+ $attributes = array(
|
|
|
|
+ 'skinColor' => (isset($video['skinColor']) && !empty($video['standardColor'])) ? 'skinColor=' . (string) $video['skinColor'] : '',
|
|
|
|
+ 'sTitle' => (isset($video['sTitle']) && $video['sTitle'] == 1) ? 'sTitle=true' : 'sTitle=false',
|
|
|
|
+ 'sAuthor' => (isset($video['sAuthor']) && $video['sAuthor'] == 1) ? 'sAuthor=true' : 'sAuthor=false',
|
|
|
|
+ 'bmstart' => (isset($video['bmstart']) && $video['bmstart'] > 1) ? 'bmstart=' . (int) $video['bmstart'] : 'bmstart=false',
|
|
|
|
+ );
|
|
|
|
+ $endpoint = 'http://rutube.ru/api/oembed';
|
|
|
|
+ $options = array(
|
|
|
|
+ 'url' => $video['source'],
|
|
|
|
+ 'format' => 'json',
|
|
|
|
+ );
|
|
|
|
+ $data = video_filter_oembed_request($endpoint, $options);
|
|
|
|
+ if (!empty($data['html'])) {
|
|
|
|
+ if (preg_match('/src="([^"]+)"/', $data['html'], $match)) {
|
|
|
|
+ $video['source'] = $match[1] . '?' . implode('&', $attributes);
|
|
|
|
+ return video_filter_iframe($video);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* Callback for Slideshare codec.
|
|
* Callback for Slideshare codec.
|
|
*
|
|
*
|
|
@@ -514,6 +844,16 @@ function video_filter_streamhoster($video) {
|
|
return video_filter_flash($video, $params);
|
|
return video_filter_flash($video, $params);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+/**
|
|
|
|
+ * Callback for Twitch codec.
|
|
|
|
+ *
|
|
|
|
+ * @see video_filter_codec_info()
|
|
|
|
+ */
|
|
|
|
+function video_filter_twitch($video) {
|
|
|
|
+ $video['source'] = '//player.twitch.tv/?channel=' . $video['codec']['matches'][1] ;
|
|
|
|
+ return video_filter_iframe($video);
|
|
|
|
+}
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* Callback for Teachertube codec.
|
|
* Callback for Teachertube codec.
|
|
*
|
|
*
|
|
@@ -527,13 +867,51 @@ function video_filter_teachertube($video) {
|
|
return video_filter_flash($video, $params);
|
|
return video_filter_flash($video, $params);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+/**
|
|
|
|
+ * Callback for Ustream codec.
|
|
|
|
+ *
|
|
|
|
+ * @see video_filter_codec_info()
|
|
|
|
+ */
|
|
|
|
+function video_filter_ustream($video) {
|
|
|
|
+ $attributes = array(
|
|
|
|
+ 'html5ui' => 'html5ui',
|
|
|
|
+ 'autoplay' => isset($video['autoplay']) ? 'autoplay=' . (int) $video['autoplay'] : 'autoplay=0',
|
|
|
|
+ );
|
|
|
|
+ $video['source'] = 'http://www.ustream.tv/embed/recorded/' . $video['codec']['matches'][1] . '?' . implode('&', $attributes);
|
|
|
|
+ return video_filter_iframe($video);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * Callback for VBox7 codec.
|
|
|
|
+ *
|
|
|
|
+ * @see video_filter_codec_info()
|
|
|
|
+ */
|
|
|
|
+function video_filter_vbox($video) {
|
|
|
|
+ $video['source'] = '//vbox7.com/emb/external.php?vid=' . $video['codec']['matches'][1];
|
|
|
|
+
|
|
|
|
+ return video_filter_flash($video);
|
|
|
|
+}
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* Callback for Vimeo codec.
|
|
* Callback for Vimeo codec.
|
|
*
|
|
*
|
|
* @see video_filter_codec_info()
|
|
* @see video_filter_codec_info()
|
|
*/
|
|
*/
|
|
function video_filter_vimeo($video) {
|
|
function video_filter_vimeo($video) {
|
|
- $video['source'] = '//www.vimeo.com/moogaloop.swf?clip_id=' . $video['codec']['matches'][1] . '&server=www.vimeo.com&fullscreen=1&show_title=1&show_byline=1&show_portrait=0&color=&autoplay=' . $video['autoplay'];
|
|
|
|
|
|
+ $attributes = array(
|
|
|
|
+ 'autopause' => isset($video['autopause']) ? 'autopause=' . (int) $video['autopause'] : 'autopause=1',
|
|
|
|
+ 'autoplay' => isset($video['autoplay']) ? 'autoplay=' . (int) $video['autoplay'] : 'autoplay=0',
|
|
|
|
+ 'badge' => isset($video['badge']) ? 'badge=' . (int) $video['badge'] : 'badge=1',
|
|
|
|
+ 'byline' => isset($video['byline']) ? 'byline=' . (int) $video['byline'] : 'byline=1',
|
|
|
|
+ 'loop' => isset($video['loop']) ? 'loop=' . (int) $video['loop'] : 'loop=0',
|
|
|
|
+ 'portrait' => isset($video['portrait']) ? 'portrait=' . (int) $video['portrait'] : 'portrait=1',
|
|
|
|
+ 'title' => isset($video['title']) ? 'autopause=' . (int) $video['title'] : 'autopause=1',
|
|
|
|
+ 'fullscreen' => isset($video['fullscreen']) ? 'fullscreen=' . (int) $video['fullscreen'] : 'fullscreen=1',
|
|
|
|
+ );
|
|
|
|
+ if (!empty($video['color'])) {
|
|
|
|
+ $attributes['color'] = (string) $video['color'];
|
|
|
|
+ }
|
|
|
|
+ $video['source'] = '//www.vimeo.com/moogaloop.swf?clip_id=' . $video['codec']['matches'][1] . '&server=www.vimeo.com&' . implode('&', $attributes);
|
|
|
|
|
|
return video_filter_flash($video);
|
|
return video_filter_flash($video);
|
|
}
|
|
}
|
|
@@ -544,7 +922,43 @@ function video_filter_vimeo($video) {
|
|
* @see video_filter_codec_info()
|
|
* @see video_filter_codec_info()
|
|
*/
|
|
*/
|
|
function video_filter_vimeo_html5($video) {
|
|
function video_filter_vimeo_html5($video) {
|
|
- $video['source'] = '//player.vimeo.com/video/' . $video['codec']['matches'][1] . ($video['autoplay'] ? '?autoplay=1' : '');
|
|
|
|
|
|
+ $attributes = array(
|
|
|
|
+ 'autopause' => isset($video['autopause']) ? 'autopause=' . (int) $video['autopause'] : 'autopause=1',
|
|
|
|
+ 'autoplay' => isset($video['autoplay']) ? 'autoplay=' . (int) $video['autoplay'] : 'autoplay=0',
|
|
|
|
+ 'badge' => isset($video['badge']) ? 'badge=' . (int) $video['badge'] : 'badge=1',
|
|
|
|
+ 'byline' => isset($video['byline']) ? 'byline=' . (int) $video['byline'] : 'byline=1',
|
|
|
|
+ 'loop' => isset($video['loop']) ? 'loop=' . (int) $video['loop'] : 'loop=0',
|
|
|
|
+ 'portrait' => isset($video['portrait']) ? 'portrait=' . (int) $video['portrait'] : 'portrait=1',
|
|
|
|
+ 'title' => isset($video['title']) ? 'autopause=' . (int) $video['title'] : 'autopause=1',
|
|
|
|
+ 'fullscreen' => isset($video['fullscreen']) ? 'fullscreen=' . (int) $video['fullscreen'] : 'fullscreen=1',
|
|
|
|
+ );
|
|
|
|
+ if (!empty($video['color'])) {
|
|
|
|
+ $attributes['color'] = (string) $video['color'];
|
|
|
|
+ }
|
|
|
|
+ $video['source'] = '//player.vimeo.com/video/' . $video['codec']['matches'][1] . '?' . implode('&', $attributes);
|
|
|
|
+
|
|
|
|
+ return video_filter_iframe($video);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * Callback for Whatchadoo codec.
|
|
|
|
+ *
|
|
|
|
+ * @see video_filter_codec_info()
|
|
|
|
+ */
|
|
|
|
+function video_filter_whatchado($video) {
|
|
|
|
+ $video['source'] = '//www.whatchado.com/embed/player/' . $video['codec']['matches'][1];
|
|
|
|
+
|
|
|
|
+ return video_filter_iframe($video);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * HTML5 callback for YouKu codec.
|
|
|
|
+ *
|
|
|
|
+ * @see video_filter_codec_info()
|
|
|
|
+ */
|
|
|
|
+function video_filter_youku_html5($video) {
|
|
|
|
+ $attributes = array();
|
|
|
|
+ $video['source'] = 'http://player.youku.com/embed/' . $video['codec']['matches'][1] . '?' . implode('&', $attributes);
|
|
|
|
|
|
return video_filter_iframe($video);
|
|
return video_filter_iframe($video);
|
|
}
|
|
}
|
|
@@ -556,18 +970,50 @@ function video_filter_vimeo_html5($video) {
|
|
*/
|
|
*/
|
|
function video_filter_youtube($video) {
|
|
function video_filter_youtube($video) {
|
|
$attributes = array(
|
|
$attributes = array(
|
|
- 'rel' => $video['related'] ? 'rel=1' : 'rel=0',
|
|
|
|
- 'autoplay' => $video['autoplay'] ? 'autoplay=1' : 'autoplay=0',
|
|
|
|
|
|
+ 'modestbranding' => !empty($video['modestbranding']) ? 'modestbranding=1' : 'modestbranding=0',
|
|
|
|
+ 'rel' => !empty($video['related']) ? 'rel=1' : 'rel=0',
|
|
|
|
+ 'autoplay' => !empty($video['autoplay']) ? 'autoplay=1' : 'autoplay=0',
|
|
'fs' => 'fs=1',
|
|
'fs' => 'fs=1',
|
|
|
|
+ 'loop' => !empty($video['loop']) ? 'loop=1' : 'loop=0',
|
|
|
|
+ 'controls' => !empty($video['controls']) ? 'controls=1' : (!isset($video['controls']) ? 'controls=1' : 'controls=0'),
|
|
|
|
+ 'autohide' => !empty($video['autohide']) ? 'autohide=1' : 'autohide=0',
|
|
|
|
+ 'showinfo' => !empty($video['showinfo']) ? 'showinfo=1' : 'showinfo=0',
|
|
|
|
+ 'theme' => !empty($video['theme']) ? 'theme=' . $video['theme'] : 'theme=dark',
|
|
|
|
+ 'color' => !empty($video['color']) ? 'color=' . $video['color'] : 'color=red',
|
|
|
|
+ 'enablejsapi' => !empty($video['enablejsapi']) ? 'enablejsapi=' . (int) $video['enablejsapi'] : 'enablejsapi=0',
|
|
);
|
|
);
|
|
|
|
|
|
- $video['source'] = '//www.youtube.com/v/' . $video['codec']['matches'][1] . '?' . implode('&', $attributes);
|
|
|
|
|
|
+ if (!empty($video['loop'])) {
|
|
|
|
+ $attributes['playlist'] = 'playlist=' . $video['codec']['matches'][1];
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (preg_match('/t=((\d+[m|s])?(\d+[s]?)?)/', $video['source'], $matches)) {
|
|
|
|
+ $attributes['start'] = 'start=' . (preg_replace("/[^0-9]/", "", $matches[2]) * 60 + (preg_replace("/[^0-9]/", "", $matches[3])));
|
|
|
|
+ }
|
|
|
|
+ if (!empty($video['start'])) {
|
|
|
|
+ if (preg_match('/((\d+[m|s])?(\d+[s]?)?)/', $video['start'], $matches)) {
|
|
|
|
+ $attributes['start'] = 'start=' . (preg_replace("/[^0-9]/", "", $matches[2]) * 60 + (preg_replace("/[^0-9]/", "", $matches[3])));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ $video['source'] = '//www.youtube.com/embed/' . $video['codec']['matches'][1] . '?' . implode('&', $attributes);
|
|
|
|
|
|
$params['wmode'] = 'opaque';
|
|
$params['wmode'] = 'opaque';
|
|
|
|
|
|
return video_filter_flash($video, $params);
|
|
return video_filter_flash($video, $params);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+/**
|
|
|
|
+ * Callback for Vine codec.
|
|
|
|
+ *
|
|
|
|
+ * @see video_filter_codec_info()
|
|
|
|
+ */
|
|
|
|
+function video_filter_vine($video) {
|
|
|
|
+ $video['source'] = '//vine.co/v/' . $video['codec']['matches'][1] . '/embed/simple';
|
|
|
|
+
|
|
|
|
+ return video_filter_iframe($video);
|
|
|
|
+}
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* HTML5 callback for YouTube codec.
|
|
* HTML5 callback for YouTube codec.
|
|
*
|
|
*
|
|
@@ -575,11 +1021,33 @@ function video_filter_youtube($video) {
|
|
*/
|
|
*/
|
|
function video_filter_youtube_html5($video) {
|
|
function video_filter_youtube_html5($video) {
|
|
$attributes = array(
|
|
$attributes = array(
|
|
|
|
+ 'modestbranding' => !empty($video['modestbranding']) ? 'modestbranding=1' : 'modestbranding=0',
|
|
'html5' => 'html5=1',
|
|
'html5' => 'html5=1',
|
|
'rel' => $video['related'] ? 'rel=1' : 'rel=0',
|
|
'rel' => $video['related'] ? 'rel=1' : 'rel=0',
|
|
'autoplay' => $video['autoplay'] ? 'autoplay=1' : 'autoplay=0',
|
|
'autoplay' => $video['autoplay'] ? 'autoplay=1' : 'autoplay=0',
|
|
'wmode' => 'wmode=opaque',
|
|
'wmode' => 'wmode=opaque',
|
|
|
|
+ 'loop' => !empty($video['loop']) ? 'loop=1' : 'loop=0',
|
|
|
|
+ 'controls' => !empty($video['controls']) ? 'controls=1' : (!isset($video['controls']) ? 'controls=1' : 'controls=0'),
|
|
|
|
+ 'autohide' => !empty($video['autohide']) ? 'autohide=1' : 'autohide=0',
|
|
|
|
+ 'showinfo' => !empty($video['showinfo']) ? 'showinfo=1' : 'showinfo=0',
|
|
|
|
+ 'theme' => !empty($video['theme']) ? 'theme=' . $video['theme'] : 'theme=dark',
|
|
|
|
+ 'color' => !empty($video['color']) ? 'color=' . $video['color'] : 'color=red',
|
|
|
|
+ 'enablejsapi' => !empty($video['enablejsapi']) ? 'enablejsapi=' . (int) $video['enablejsapi'] : 'enablejsapi=0',
|
|
);
|
|
);
|
|
|
|
+
|
|
|
|
+ if (!empty($video['loop'])) {
|
|
|
|
+ $attributes['playlist'] = 'playlist=' . $video['codec']['matches'][1];
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (preg_match('/t=((\d+[m|s])?(\d+[s]?)?)/', $video['source'], $matches)) {
|
|
|
|
+ $attributes['start'] = 'start=' . (preg_replace("/[^0-9]/", "", $matches[2]) * 60 + (preg_replace("/[^0-9]/", "", $matches[3])));
|
|
|
|
+ }
|
|
|
|
+ if (!empty($video['start'])) {
|
|
|
|
+ if (preg_match('/((\d+[m|s])?(\d+[s]?)?)/', $video['start'], $matches)) {
|
|
|
|
+ $attributes['start'] = 'start=' . (preg_replace("/[^0-9]/", "", $matches[2]) * 60 + (preg_replace("/[^0-9]/", "", $matches[3])));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
$video['source'] = '//www.youtube.com/embed/' . $video['codec']['matches'][1] . '?' . implode('&', $attributes);
|
|
$video['source'] = '//www.youtube.com/embed/' . $video['codec']['matches'][1] . '?' . implode('&', $attributes);
|
|
|
|
|
|
return video_filter_iframe($video);
|
|
return video_filter_iframe($video);
|