Video Filter is a highly flexible and easy extendable filter module to embed any type of video in your site using a simple tag. Other modules can add video sites/formats (called codecs) using an easy plug-in architecture.
Installation
Enable the module on the modules page. By default all codecs will work. You may enable/disable individual codecs on the text formats settings page.
Drupal 7, 8:
Go to admin/config/content/formats and configure the text format(s) that should be allowed to use this filter. Check the box to enable Video Filter and save. Some simple settings are available if you configure the text format. There you can change the default size and auto play settings.
All:
Make sure that Video Filter is processed before "Convert URLs to links". You can do this by dragging and dropping Video Filter to the top of the processing order list. Do this even if it's already on top, just to make sure!
If you're using the "Limit allowed HTML tags" filter, make sure Video Filter is processed after that filter.
To enable WYSIWYG support, go to the WYSIWYG settings for each input format and enable the Video Filter button. If you use CKeditor without the Wysiwyg module you need to take some extra steps. See the README in video_filter/editors/ckeditor.
Usage
Single video:
[video:url]
This will output the video using the default settings.
Random video from multiple URL's:
[video:url,url,url]
This will output one of the specified videos each time. This can be disable in each text format settings.
With parameters:
[video:url width:X height:Y align:left/right autoplay:1/0]
This will override the default settings for this video. More options provided by codecs and plugins (Drupal 8).
Included codecs
- Archive.org D7, D8
- Blip.tv D7
- Candid Career D7
- Capped.tv D7, D8
- College Humor D7, D8
- Coub D8
- DailyMotion D7, D8
- DemocracyNow Fullshow D7, D8
- DemocracyNow Story D7, D8
- Facebook D8
- Flickr Slideshows D7, D8
- Flickr Video D7, D8
- Mail.Ru D7, D8
- MyVideo D7, D8
|
- Gametrailers D7, D8
- Gamevideos D7, D8
- Giphy D8
- GodTube D7, D8
- Google Video D7, D8
- Instagram D7, D8
- MakerTV D8
- Metacafe D7, D8
- Myspace D7 D8
- Picasa Slideshows D7, D8
- Slideshare D7, D8
- Streamhoster D7
- Rutube D7, D8
- FoxNews D7, D8
|
- Teachertube D7, D8
- TED D7, D8
- Twitch D7, D8
- Twitter D8
- Vbox D7, D8
- Vimeo D7, D8
- Vine D7, D8
- Whatchado D7, D8
- Wistia D7, D8
- YouKu D7, D8
- YouTube D7, D8
- YouTube (Playlist) D7, D8
- Vevo D8
- Ustream D7, D8
|
Developers
Drupal 8
See video_filter/modules/video_filter_example module to see how to add your own plugins and extend Video Filter module.
Drupal 7
This module calls hook_codec_info(), so you can add your own codecs.
Example:
function MODULE_codec_info() {
$codecs = array();
// You can offer multiple video formats in one module.
$codecs['youtube'] = array(
// Will be used some day in user information.
'name' => t('YouTube'),
// The callback that will output the right embed code.
'callback' => 'MODULE_youtube',
// Regexp can be an array. $video['codec']['delta'] will be set to the key.
'regexp' => '/youtube\.com\/watch\?v=([a-z0-9]+)/i',
// Ratio for resizing within user-given width and height (ratio = width / height)
'ratio' => 425 / 355,
);
return $codecs;
}
And this will be your callback function:
function MODULE_youtube($video) {
// $video contains the video URL in source, the codec (as above) and also [code][matches] with the result of the regexp and [codec][delta] with the key of the matched regexp.
$video['source'] = 'http://www.youtube.com/v/'.$video['codec']['matches'][1].($video['autoplay'] ? '&autoplay=1' : '');
// Outputs a general <object...> for embedding flash players. Needs width, height, source and optionally align (left or right) and params (a list of <param...> attributes)
return video_filter_flash($video);
}