Модуль позволяет конвертировать видео-файлы, которые загружаются на сайт, если на сервере установлена библиотека ffmpeg. Также модуль выводит плейер и обеспечивает всю работу с видео.
В файле .htaccess включить следующие параметры:
php_value post_max_size 100M
php_value upload_max_filesize 100M
php_value max_execution_time 1000
php_value max_input_time 1000
</IfModule>
Модуль получает файлы с помощью одного из этих модулей:
- ССК FileField
- Upload
В режиме Upload
Нужно загрузить FLV-файл и миниатюру. Они будут храниться в $node->files.
К миниатюре НЕ БУДУТ применяться правила модуля ImageCache при показе. То есть миниатюра должна быть полностью готова и нужного размера.
Модуль FlashVideo подхватывает видео, но не конвертирует его.
Видео в полях ССК в этом режиме игнорируется.
В режиме ССК
Файлы пропукаются через ffmpeg и, если конвертация не удалась, то видео (даже в FLV) не показывается.
Для работы создаётся 2 поля (для загруженного видео и для финального - после конвертации).
И 1 поле для загрузки миниатюры. Для этого поля работает ImageCache!
if (!$thumbnail_file) {
if ($node->field_image[0]['filepath']) {
//Загруженная картинка:
$thumbnail_file = imagecache_create_url('video_thumb_front', $node->field_image[0]['filepath']);
} else {
$thumbnail_file = $base_url . base_path() . path_to_theme() .'/images/no_thumbnail.jpg';
}
}
Автоматизация вставки видео и превью
В шаблоне ноды нужного типа заменить
на
<?php print flashvideo_get_thumbnail($node);?>
<?php else : ?>
<?php print flashvideo_get_video($node);?>
<?php endif; ?>
<div class="content"><?php print $content ?></div>
Также нужно отключить использование тега [video] в тексте ноды.
Отображение thumbnail
$thumbnail = flashvideo_get_thumbnail($node);
} else {
$thumbnail = theme('imagecache', 'video_thumb_front', $node->field_image[0]['filepath']);
}
'video_thumb_front' - название правила ImageCache
'field_image' - название поля ССК, в котором хранится картинка. Если просто загружается картинка вместе с видео, то нужно использовать другой код.
Прямая загрузка FLV
Если не нужно конвертировать видео на сервере, то нужно настроить модуль так:
- Включить модуль Upload
- Открыть страницу настроек FlashVideo (admin/settings/flashvideo)
- Выключить параметр "Use the CCK FileField module for uploads"
- Создать поле ССК для загрузки картинки предпросмотра с машинным именем "image"
- На странице "Показывать поля" настроить вывод или сокрытие полей с предпросмотром и загруженным видео-файлом.
- После сохранения ноды нужно запустить cron, чтобы видео стало доступным или включите параметр "Convert videos immediately"
FlashVideo is a complete video solution that expands Drupal's upload capabilities to allow web developers and users to upload video files, automatically convert those videos to the popular Flash format, and then embed their video in any node type using the simple [video] tag. This module allows more than one video to be attached to any node, and then referenced through the use of parameters passed to the tag [video]. It also includes an automatic conversion of video files to the Flash format using FFMPEG technology.
Use this module if you...
- Would like a complete video solution for any user-generated-content video website.
- Wish to have the power to embed your video anywhere in the body of a node using a simple [video] tag
- Wish to link as many videos as you like to a node.
- Would like a built in automatic Flash conversion.
Features
- Streaming Video — Version 6.x-1.5 adds the new capability to have your videos streamed to the user via either xmoov-php pseudo-streaming or via RTMP true streaming on a separate server such as a Flash Media Server or Red5 server.
- CCK FileField Support — Version 6.x-1.5 adds the new capability to have your videos attached to nodes by specifying individual FileField fields that should contain your videos and thumbnails.
- Amazon S3 Support — FlashVideo Module can be easily configured to integrate video on your site with the incredible Amazon S3 server. This provides large video sites the ability to host their videos on a completely separate server than their own so that the videos will not bog down their server. For more details on how to install and use this plugin, simply open up the README.txt file within the included "drivers" directory.
- Content Construction Kit (CCK) Integration — This module works very well with the Content Construction Kit, simply because it treats an uploaded video as a file instead of a node. Any CCK node type that you create can then enable the FlashVideo module to work with that node type. Because of this, this module can be treated as a CCK video solution. You can see this in action in the tutorial mentioned below.
- CCK Override Capabilities — The FlashVideo module includes a plugin called FlashVideo CCK which provides node-specific parameters to create or regenerate the thumbnail or video. This method allows for any node creator or updater to override the parameters specified by the FlashVideo Settings to create custom functionality out of their specific node. For more information regarding how to utilize this plugin, please go to http://www.travistidwell.com/flashvideo_cck.
Note: To use this plugin, you must enable it individually in the "Modules" section of your Drupal site. - Importing Videos — FlashVideo module includes a way for someone to import a large number of videos by just placing them in a directory (using FTP or some other means). Here is how it works. First thing you will need to do is go to the Flashvideo Settings page and decide which node type you would like to create with each imported video. Then, within the files directory, simply create a new directory and name it video_import (or use an alternate name that you define within the FlashVideo Settings page). Then, whatever video files you place within that directory will not only be added to the Drupal files table, but also be added to the FlashVideo cron cycle conversion queue. This makes it VERY simple for a site administrator to add MANY videos to their site without having to upload them all individually to nodes.
- Playlist Support — You can use the FlashVideo module to create dynamic playlists of your videos. For more information, please go to http://www.travistidwell.com/node/59.
- FlashVideo API for Developers — This module contains an API to allow module developers to tie into the powers of this module. For more information on what hooks and functions are available, please go to http://www.travistidwell.com/flashvideo_api.
FlashVideo Tutorials
- Walk-through tutorial by travist - http://www.travistidwell.com/flashvideo
- Screencast presentation by attheshow - http://fleetthought.com/blog-post/using-flashvideo-user-contributed-video
Installing a Media Player (Required Step)
Important Note: — For this module to work, you will need to download a media player to go along with it. Some of the media players that have been tested to work the FlashVideo are as follows:
Due to licensing, a media player is currently not included with the module, so you will need to download either one of these. This is covered in the tutorial mentioned above.
Troubleshooting FlashVideo
Are you having problems getting FlashVideo operational? If so, check out the troubleshooting guide available at: http://www.travistidwell.com/troubleshooting_flashvideo.
Special Thanks To:
Although Travis Tidwell is the primary creator and maintainer of this module, it would not be what it is today without the help and contributions of the incredible Drupal Community. This section is to give special thanks to these contributors.
If we have forgotten anyone who has contributed, then please contact one of the module developers to get your username added to the list.







