aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHeshan <heshan@heidisoft.com>2011-03-19 00:33:50 +0530
committerHeshan <heshan@heidisoft.com>2011-03-19 00:33:50 +0530
commita43b5f2f08002e47bc575f5a4a4618ebebc3d9c6 (patch)
tree6552d0f616ed4680797a4f67829bc5e556359e32
parent797aef53344791c484e5568a1a4a639301ed262f (diff)
downloadvideo-a43b5f2f08002e47bc575f5a4a4618ebebc3d9c6.tar.gz
video-a43b5f2f08002e47bc575f5a4a4618ebebc3d9c6.tar.bz2
Updated the hook_theme and video themes, remove theme funcations to video.theme.inc and added HTML5 with Flash fallback with Flowplayer
-rw-r--r--css/video.css6
-rw-r--r--filesystem/.cvsignore1
-rw-r--r--filesystem/drupal.inc69
-rw-r--r--includes/video_helper.inc3
-rw-r--r--theme/video-play-flv.tpl.php2
-rw-r--r--theme/video-play-html5.tpl.php2
-rw-r--r--video.module77
-rw-r--r--video.theme.inc248
-rw-r--r--video_formatter.inc309
9 files changed, 170 insertions, 547 deletions
diff --git a/css/video.css b/css/video.css
index 6964312..db6b585 100644
--- a/css/video.css
+++ b/css/video.css
@@ -49,7 +49,11 @@ br.video_image_clear {
/* inser here rules for node page image */
}
-.video-ffmpeg-helper-inprogress {
+.video-inprogress {
+ border: 1px solid red;
+ padding: .5em;
+}
+.video-conversion-failed{
border: 1px solid red;
padding: .5em;
}
diff --git a/filesystem/.cvsignore b/filesystem/.cvsignore
deleted file mode 100644
index e43b0f9..0000000
--- a/filesystem/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-.DS_Store
diff --git a/filesystem/drupal.inc b/filesystem/drupal.inc
deleted file mode 100644
index 2f79c8b..0000000
--- a/filesystem/drupal.inc
+++ /dev/null
@@ -1,69 +0,0 @@
-<?php
-
-/*
- * @file
- * Class file used to store filesystem on the video.
- *
- */
-class drupal extends video_filesystem {
-
- protected $params = array();
- protected $name = 'Drupal File System';
- protected $value = 'drupal';
-
- public function __construct() {
-
- }
-
- public function save_file($video) {
-
- }
-
- public function prepare_file($video) {
-
- }
-
- public function load_file(&$video) {
-
- }
-
- /**
- * Interface Implementations
- * @see sites/all/modules/video/includes/filesystem_interface#get_name()
- */
- public function get_name() {
- return $this->name;
- }
-
- /**
- * Interface Implementations
- * @see sites/all/modules/video/includes/filesystem_interface#get_help()
- */
- public function get_help() {
- return t('Drupal filesystem', array());
- }
-
- /**
- * Interface Implementations
- * @see sites/all/modules/video/includes/filesystem_interface#get_value()
- */
- public function get_value() {
- return $this->value;
- }
-
- public function run_command($options) {
- return;
- }
-
- public function admin_settings() {
- $form = array();
- return $form;
- }
-
- public function admin_settings_validate($form, $form_state) {
- return;
- }
-
-}
-
-?>
diff --git a/includes/video_helper.inc b/includes/video_helper.inc
index 9f3ae2e..dfbb29f 100644
--- a/includes/video_helper.inc
+++ b/includes/video_helper.inc
@@ -64,9 +64,6 @@ class video_helper {
$conversion->load_completed_job($video);
}
}
- // Let othere module to load the video files by referance
- // Moved to last to recheck incase we changed our extension above.
- $video->flash_player = variable_get('video_extension_' . $video->player . '_flash_player', '');
// Return our object
return $video;
}
diff --git a/theme/video-play-flv.tpl.php b/theme/video-play-flv.tpl.php
index 418fec2..5779eae 100644
--- a/theme/video-play-flv.tpl.php
+++ b/theme/video-play-flv.tpl.php
@@ -10,5 +10,5 @@
* $themed_output is the rendered html.
*
*/
-echo ($variables['themed_output']->themed_output);
+print $themed_output;
?> \ No newline at end of file
diff --git a/theme/video-play-html5.tpl.php b/theme/video-play-html5.tpl.php
index 62a474e..78c5f8c 100644
--- a/theme/video-play-html5.tpl.php
+++ b/theme/video-play-html5.tpl.php
@@ -28,5 +28,7 @@
<?php endforeach; ?>
<?php print $videojs_sources; ?>
<!-- Flash Fallback. Use any flash video player here. Make sure to keep the vjs-flash-fallback class. -->
+ <?php $video->player = 'flv'; ?>
+ <?php $video->files->flv->url = $flash; ?>
<?php echo theme('video_flv', array('video' => $video)); ?>
</video> \ No newline at end of file
diff --git a/video.module b/video.module
index 52391cb..58e8925 100644
--- a/video.module
+++ b/video.module
@@ -67,49 +67,23 @@ function video_theme() {
$theme = array();
$theme['video'] = array(
'variables' => array('item' => NULL, 'path' => NULL, 'video_style' => NULL, 'entity' => NULL, 'field' => NULL, 'instance' => NULL),
- 'file' => 'video_formatter.inc',
+ 'file' => 'video.theme.inc',
);
$theme['video_thumbnail'] = array(
'variables' => array('item' => NULL, 'path' => NULL, 'video_style' => NULL, 'entity' => NULL, 'field' => NULL, 'instance' => NULL),
- 'file' => 'video_formatter.inc',
- );
-
- $theme['video_thumbnails'] = array(
- 'variables' => array('file' => NULL, 'alt' => '', 'title' => '', 'attributes' => NULL, 'getsize' => TRUE),
'file' => 'video.theme.inc',
);
$theme['video_widget'] = array(
'render element' => 'element',
'file' => 'video.theme.inc',
);
- $theme['video_widget_preview'] = array(
- 'variables' => array('item' => TRUE),
- 'file' => 'video.theme.inc',
- );
- $theme['video_image'] = array(
- 'variables' => array('file' => NULL, 'alt' => '', 'title' => '', 'attributes' => NULL, 'getsize' => TRUE, 'imagecache' => NULL),
- 'file' => 'video.theme.inc',
- );
- $theme['video_widget_video_thumb'] = array(
- 'variables' => array('item' => TRUE),
- 'file' => 'video.theme.inc',
- );
-
- //$theme['video_formatter_video_colorbox'] = array(
- // 'arguments' => array('element' => NULL, 'imagecache' => NULL),
- // 'file' => 'video_formatter.inc',
- //);
- $theme['video_formatter_video_media_js'] = array(
- 'variables' => array('element' => NULL),
- 'file' => 'video_formatter.inc',
- );
- $theme['video_encoding_failed'] = array(
+ $theme['video_conversion_failed'] = array(
'variables' => array(),
- 'file' => 'video_formatter.inc',
+ 'file' => 'video.theme.inc',
);
$theme['video_inprogress'] = array(
'variables' => array(),
- 'file' => 'video_formatter.inc',
+ 'file' => 'video.theme.inc',
);
$path = drupal_get_path('module', 'video') . '/theme';
@@ -125,13 +99,8 @@ function video_theme() {
//We need to add an flv theme buffer to allow users to override in their own module to add in extra parameters before
//calling our flv template file.
$theme['video_flv'] = array(
- 'variables' => array('video' => NULL, 'node' => NULL),
- 'file' => 'video_formatter.inc'
- );
- // @TODO : check is there any other optimal way to do this?
- $theme['video_formatter'] = array(
- 'variables' => array('item' => NULL, 'path' => NULL, 'video_style' => NULL, 'entity' => NULL, 'field' => NULL, 'instance' => NULL),
- 'file' => 'video_formatter.inc'
+ 'variables' => array('video' => NULL),
+ 'file' => 'video.theme.inc'
);
return $theme;
}
@@ -391,6 +360,11 @@ function video_widget_element_settings(&$element, &$form_state) {
'#description' => t('This will bypass your auto conversion of videos.'),
'#attributes' => array('class' => array('video-bypass-auto-conversion')),
);
+ } else if (variable_get('video_bypass_conversion', FALSE)) {
+ $element['bypass_autoconversion'] = array(
+ '#type' => 'value',
+ '#value' => variable_get('video_bypass_conversion', FALSE),
+ );
}
// check this to convert the video on save
$convert = isset($file['convert_video_on_save']) ? $file['convert_video_on_save'] : variable_get('video_convert_on_save', FALSE);
@@ -402,6 +376,11 @@ function video_widget_element_settings(&$element, &$form_state) {
'#description' => t('This will convert your video to flv format when you save, instead of scheduling it for cron.'),
'#attributes' => array('class' => array('video-convert-video-on-save')),
);
+ } else if (variable_get('video_convert_on_save', FALSE)) {
+ $element['convert_video_on_save'] = array(
+ '#type' => 'value',
+ '#value' => variable_get('video_convert_on_save', FALSE),
+ );
}
}
@@ -543,29 +522,11 @@ function video_video_flv_players() {
}
return $options;
}
-
/**
- * Get the object for the suitable player for the parameter resource
+ * Field instances settings
+ * @param <type> $widget
+ * @return <type>
*/
-function video_get_player($variables) {
- // Setup our node object to be passed along with the player.
-// $node = $variables['entity'];
- // Setup our video object
- module_load_include('inc', 'video', '/includes/video_helper');
- $video_helper = new video_helper;
- $video = $video_helper->video_object($variables);
- // Lets spit out our theme based on the extension
- $defaults = video_video_extensions();
- $theme_function = variable_get('video_extension_' . $video->player, $defaults[$video->player]);
-
- // Lets do some special handling for our flv files to accomdate multiple players.
- if ($theme_function == 'video_play_flv') {
- return theme('video_flv', (array) $video);
- } else {
- return theme($theme_function, (array) $video);
- }
-}
-
function video_default_instance_settings($widget) {
$form = array();
// Default video settings.
diff --git a/video.theme.inc b/video.theme.inc
index 9b3f4e9..41ab5e0 100644
--- a/video.theme.inc
+++ b/video.theme.inc
@@ -1,111 +1,6 @@
<?php
/**
- *
- * @file
- * Theme functions for the video module.
- *
- */
-function theme_video_thumbnails($file, $alt = '', $title = '', $attributes = NULL, $getsize = TRUE) {
- $file = (array) $file;
- // return $file['filepath'];
- if (!is_file($file['filepath'])) {
- return '<!-- File not found: ' . $file['filepath'] . ' -->';
- }
-
- if ($getsize) {
- // Use cached width and height if available.
- if (!empty($file['data']['width']) && !empty($file['data']['height'])) {
- $attributes['width'] = $file['data']['width'];
- $attributes['height'] = $file['data']['height'];
- }
- // Otherwise pull the width and height from the file.
- elseif (list($width, $height, $type, $image_attributes) = @getimagesize($file['filepath'])) {
- $attributes['width'] = $width;
- $attributes['height'] = $height;
- }
- }
-
- if (!empty($title)) {
- $attributes['title'] = $title;
- }
-
- // Alt text should be added even if it is an empty string.
- $attributes['alt'] = $alt;
-
- // Add a timestamp to the URL to ensure it is immediately updated after editing.
- $query_string = '';
- if (isset($file['timestamp'])) {
- $query_character = (variable_get('file_downloads', FILE_DOWNLOADS_PUBLIC) == FILE_DOWNLOADS_PRIVATE && variable_get('clean_url', '0') == '0') ? '&' : '?';
- $query_string = $query_character . $file['timestamp'];
- }
-
- $url = file_create_url($file['filepath']) . $query_string;
- $attributes['src'] = $url;
- $attributes = drupal_attributes($attributes);
- return '<span></span><img ' . $attributes . ' />';
-}
-
-function theme_video_widget_preview($item) {
- $output .= '<div class="image-preview">';
- $output .= drupal_render($item['preview']);
- $output .= '</div>';
- return $item;
-}
-
-function theme_video_widget_video_thumb($item = NULL) {
- return '<div class="video-thumb">' . theme('video_image', $item, '', '', '', FALSE) . '</div>';
-}
-
-/**
- * @defgroup "Theme Callbacks"
- * @{
- * @see uploadfield_theme().
- */
-function theme_video_image($file, $alt = '', $title = '', $attributes = NULL, $getsize = TRUE, $imagecache = FALSE) {
- $file = (array) $file;
- //if this is imagecache skip this as the file might not be created yet
- if (!$imagecache && !is_file($file['filepath'])) {
- return '<!-- File not found: ' . str_replace("--", "-", $file['filepath']) . '" -->';
- }
-
- if ($getsize && $imagecache && ($image = image_get_info($file['filepath']))) {
- $attributes['width'] = $image['width'];
- $attributes['height'] = $image['height'];
- } elseif ($getsize) {
- // Use cached width and height if available.
- if (!empty($file['data']['width']) && !empty($file['data']['height'])) {
- $attributes['width'] = $file['data']['width'];
- $attributes['height'] = $file['data']['height'];
- }
- // Otherwise pull the width and height from the file.
- elseif (list($width, $height, $type, $image_attributes) = @getimagesize($file['filepath'])) {
- $attributes['width'] = $width;
- $attributes['height'] = $height;
- }
- }
-
- if (!empty($title)) {
- $attributes['title'] = $title;
- }
-
- // Alt text should be added even if it is an empty string.
- $attributes['alt'] = $alt;
-
- // Add a timestamp to the URL to ensure it is immediately updated after editing.
- $query_string = '';
- if (isset($file['timestamp'])) {
- $query_character = (variable_get('file_downloads', FILE_DOWNLOADS_PUBLIC) == FILE_DOWNLOADS_PRIVATE && variable_get('clean_url', '0') == '0') ? '&' : '?';
- $query_string = $query_character . $file['timestamp'];
- }
-
- $url = file_create_url($file['filepath']) . $query_string;
- $attributes['src'] = $url;
- $attributes = drupal_attributes($attributes);
- return '<img ' . $attributes . ' />';
-}
-
-/**
* Returns HTML for an video field widget.
*
* @param $variables
@@ -136,6 +31,91 @@ function theme_video_widget($variables) {
return $output;
}
+/*
+ * Default video cck formatter. Makes sure the video being displayed exists, has been converted (if in que).
+ * If not or the video is processed, then it will get the default player for the specific video type for output.
+ */
+
+function theme_video($variables) {
+ $themed_output = '';
+ if (empty($variables['item']['fid']))
+ return '';
+ $field_settings = $variables['field']['settings'];
+ $instance_settings = $variables['instance']['settings'];
+ // Only needs to be ran if they are converting videos
+ if (isset($field_settings['autoconversion']) && $field_settings['autoconversion']) {
+ module_load_include('inc', 'video', '/includes/conversion');
+ $conversion = new video_conversion;
+ if ($video = $conversion->load_job($variables['item']['fid'])) {
+ if ($video->video_status == VIDEO_RENDERING_ACTIVE || $video->video_status == VIDEO_RENDERING_PENDING) {
+ return theme('video_inprogress');
+ } else if ($video->video_status == VIDEO_RENDERING_FAILED) {
+ return theme('video_conversion_failed');
+ }
+ }
+ }
+ // Setup our video object
+ module_load_include('inc', 'video', '/includes/video_helper');
+ $video_helper = new video_helper;
+ $video = $video_helper->video_object($variables);
+ // Lets spit out our theme based on the extension
+ $defaults = video_video_extensions();
+ $theme_function = variable_get('video_extension_' . $video->player, $defaults[$video->player]);
+
+ // Lets do some special handling for our flv files to accomdate multiple players.
+ if ($theme_function == 'video_play_flv') {
+ return theme('video_flv', array('video' => $video, 'themed_output' => $themed_output));
+ } else {
+ return theme($theme_function, array('video' => $video, 'themed_output' => $themed_output));
+ }
+}
+
+/*
+ * Renders the video thumbnail as a link to the node page.
+ */
+
+function theme_video_thumbnail($variables) {
+ // Inside a view $variables may contain null data. In that case, just return.
+ if (empty($variables['item']['fid']))
+ return '<!-- File not found: ' . $variables['item']['fid'] . ' -->';
+
+ //setup our thumbnail object
+ module_load_include('inc', 'video', '/includes/video_helper');
+ $video_helper = new video_helper;
+ // @TODO : change the object to an array
+ $thumbnail = (array) $video_helper->thumbnail_object($variables);
+ // return if no file path found for the video thumbnails and add log message
+ if (empty($thumbnail['filepath'])) {
+ watchdog('video', 'Unable to find the video thumbnail for the %node.', array('%node' => $variables['entity']->title), WATCHDOG_ERROR);
+ return '<!-- File not found: ' . $thumbnail['filepath'] . ' -->';
+ }
+ $image = array(
+ 'path' => $thumbnail['filepath'],
+ 'alt' => $thumbnail['alt'],
+ );
+ // Do not output an empty 'title' attribute.
+ if (drupal_strlen($thumbnail['title']) > 0) {
+ $image['title'] = $thumbnail['title'];
+ }
+
+ if ($variables['video_style']) {
+ $image['style_name'] = $variables['video_style'];
+ $output = theme('image_style', $image);
+ } else {
+ $output = theme('image', $image);
+ }
+
+ if ($variables['path']) {
+ $path = $variables['path']['path'];
+ $options = $variables['path']['options'];
+ // When displaying an image inside a link, the html option must be TRUE.
+ $options['html'] = TRUE;
+ $output = l($output, $path, $options);
+ }
+
+ return $output;
+}
+
/**
* Returns HTML for an image using a specific image style.
*
@@ -167,4 +147,62 @@ function theme_video_thumb_style($variables) {
}
$variables['path'] = $style_path;
return theme('image', $variables);
+}
+
+/**
+ * Displays a "encoding in progress message"
+ */
+function theme_video_inprogress() {
+ return '<div class="video-inprogress">' . t('This video is currently being processed. Please wait.') . '</div>';
+}
+
+/**
+ * Display an "encoding failed" message"
+ */
+function theme_video_conversion_failed() {
+ return '<div class="video-conversion-failed">' . t('The video conversion process has failed. You might want to submit a simpler video format like <em>mpeg</em> or <em>divx avi</em>.<br />If the problem persists please contact website administrators.') . '</div>';
+}
+
+/*
+ * Theme wraper on Flahs play on 3rd party
+ */
+
+function theme_video_flv($variables) {
+ $video = $variables['video'];
+ // set the video flash player
+ // Moved to last to recheck incase we changed our extension above.
+ $video->flash_player = variable_get('video_extension_' . $video->player . '_flash_player', '');
+ if ($video->flash_player == 'swftools') {
+ $options = array(
+ 'params' => array(
+ 'width' => $video->player_width,
+ 'height' => $video->player_height,
+ ),
+ 'othervars' => array(
+ //@todo: swftools bug, can't enable this until they fix their pathing for the images.
+ 'image' => $video->thumbnail->swfthumb,
+ ),
+ );
+ $themed_output = swf($video->files->{$video->player}->url, $options);
+ } elseif ($video->flash_player == 'flowplayer') {
+ // kjh: use a playlist to display the thumbnail if not auto playing
+ if (isset($video->autoplay) && isset($video->thumbnail->url)) {
+ $options = array(
+ 'playlist' => array($video->thumbnail->url,
+ array('url' => urlencode($video->files->{$video->player}->url),
+ 'autoPlay' => $video->autoplay,
+ 'autoBuffering' => $video->autobuffering,
+ ),),);
+ } else {
+ $options = array(
+ 'clip' => array('url' => urlencode($video->files->{$video->player}->url),
+ 'autoPlay' => $video->autoplay,
+ 'autoBuffering' => $video->autobuffering,
+ ),);
+ }
+ $themed_output = theme('flowplayer', array('config' => $options, 'id' => 'flowplayer-' . $video->formatter, 'attributes' => array('style' => 'width:' . $video->player_width . 'px;height:' . ($video->player_height + 24) . 'px;')));
+ } else {
+ $themed_output = t('No flash player has been setup. ' . l(t('Please select a player to play Flash videos.'), 'admin/settings/video/players'));
+ }
+ return theme('video_play_flv', array('video' => $video, 'themed_output' => $themed_output));
} \ No newline at end of file
diff --git a/video_formatter.inc b/video_formatter.inc
deleted file mode 100644
index f29edd4..0000000
--- a/video_formatter.inc
+++ /dev/null
@@ -1,309 +0,0 @@
-<?php
-
-/**
- * @file
- * Video formatter hooks and callbacks.
- */
-/*
- * Default video cck formatter. Makes sure the video being displayed exists, has been converted (if in que).
- * If not or the video is processed, then it will get the default player for the specific video type for output.
- */
-function theme_video($variables) {
- if (empty($variables['item']['fid']))
- return '';
- $field_settings = $variables['field']['settings'];
- $instance_settings = $variables['instance']['settings'];
- // Only needs to be ran if they are converting videos
- if (isset($field_settings['autoconversion']) && $field_settings['autoconversion']) {
- module_load_include('inc', 'video', '/includes/conversion');
- $conversion = new video_conversion;
- if ($video = $conversion->load_job($variables['item']['fid'])) {
- if ($video->video_status == VIDEO_RENDERING_ACTIVE || $video->video_status == VIDEO_RENDERING_PENDING) {
- return theme('video_inprogress');
- } else if ($video->video_status == VIDEO_RENDERING_FAILED) {
- return theme('video_encoding_failed');
- }
- }
- }
- return video_get_player($variables);
-}
-
-/*
- * Renders the video thumbnail as a link to the node page.
- */
-
-function theme_video_thumbnail($variables) {
- // Inside a view $variables may contain null data. In that case, just return.
- if (empty($variables['item']['fid']))
- return '';
- //setup our thumbnail object
- module_load_include('inc', 'video', '/includes/video_helper');
- $video_helper = new video_helper;
- // @TODO : change the object to an array
- $thumbnail = (array) $video_helper->thumbnail_object($variables);
- // return if no file path found for the video thumbnails and add log message
- if (empty($thumbnail['filepath'])) {
- watchdog('video', 'Unable to find the video thumbnail for the %node.', array('%node' => $variables['entity']->title), WATCHDOG_ERROR);
- return '';
- }
- $image = array(
- 'path' => $thumbnail['filepath'],
- 'alt' => $thumbnail['alt'],
- );
- // Do not output an empty 'title' attribute.
- if (drupal_strlen($thumbnail['title']) > 0) {
- $image['title'] = $thumbnail['title'];
- }
-
- if ($variables['video_style']) {
- $image['style_name'] = $variables['video_style'];
- $output = theme('image_style', $image);
- } else {
- $output = theme('image', $image);
- }
-
- if ($variables['path']) {
- $path = $variables['path']['path'];
- $options = $variables['path']['options'];
- // When displaying an image inside a link, the html option must be TRUE.
- $options['html'] = TRUE;
- $output = l($output, $path, $options);
- }
-
- return $output;
-}
-
-/*
- * Renders the video thumbnail linked to the absolute filepath of the video. Colorbox is introduced to handle
- * the video in an overlay.
- *
- * @todo Very unstable, need better methods of integration. Seems hackish right now to find out what flv player is being
- * used. We are also using jmedia for all other filetypes.
- */
-
-function theme_video_colorbox($variables, $imagecache = FALSE) {
- global $base_path;
- if (!module_exists('colorbox')) {
- drupal_set_message(t('You must download and enable !colorbox for this formatter.', array('!colorbox' => l(t('Colorbox'), 'http://www.drupal.org/project/colorbox'))), 'error');
- return theme('video_formatter_video_nodelink', $variables);
- }
-
- // Inside a view $variables may contain null data. In that case, just return.
- if (empty($variables['#item']['fid']))
- return '';
-
- //load up our media plugins
- drupal_add_js(drupal_get_path('module', 'video') . '/js/jquery.media.js');
- drupal_add_js(drupal_get_path('module', 'video') . '/js/jquery.metadata.js');
- drupal_add_js(drupal_get_path('module', 'video') . '/js/flowplayer-3.2.0.min.js');
-
- //setup our video object
- module_load_include('inc', 'video', '/includes/video_helper');
- $video_helper = new video_helper;
- $video = $video_helper->video_object($variables);
-
- $action = swftools_get_action($video->filepath);
- $player = swftools_get_player($action);
- $path = explode("_", $player);
- $player_url = $base_path . swftools_get_player_path() . '/' . $path[0] . '/' . variable_get($player . '_file', '');
- if (stristr($player, 'flowplayer')) {
- $player = 'flowplayer';
- }
- //add our default settings to the Drupal.settings object
- $settings = array('video' => array(
- 'flvplayer' => $player_url,
- 'autoplay' => $video->autoplay,
- 'autobuffer' => $video->autobuffering,
- 'player' => $player,
- ));
- drupal_add_js($settings, 'setting');
- $image = theme('video_image', $video->thumbnail, $video->thumbnail->alt, $video->thumbnail->title, '', TRUE, $imagecache);
- $class = 'video-box video-' . $variables['#field_name'] . '{width:\'' . $video->player_width . 'px\', height:\'' . $video->player_height . 'px\', player:\'' . $player . '\'}';
- return l($image, $video->files->{$video->player}->url, array('attributes' => array('class' => $class), 'html' => TRUE));
-}
-
-/*
- * We are using the jMedia library to output our video files.
- *
- * @todo Does not work with flv files as this requires an actual flv player. Need to figure out how to best integrate the player
- * into this function.
- *
- * We are outputing an anchor to the videofile. The jMedia functions will overtake this anchor and setup our object/embed tags.
- */
-
-function theme_video_media_js($variables) {
- //#913928
- $field = content_fields($variables['#field_name'], $variables['#type_name']);
- if (!empty($field['list_field']) && !$variables['#item']['list'])
- return '';
-
- drupal_add_js(drupal_get_path('module', 'video') . '/js/jquery.media.js');
- drupal_add_js(drupal_get_path('module', 'video') . '/js/jquery.metadata.js');
- //setup our video object
- module_load_include('inc', 'video', '/includes/video_helper');
- $video_helper = new video_helper;
- $video = $video_helper->video_object($variables);
- //lets output the link to be overtaken by jmedia
- $link = l($video->filename, $video->files->{$video->player}->url, array('attributes' => array('class' => 'jmedia {width: ' . $video->player_width . ', height: ' . $video->player_height . ', autoplay: ' . $video->autoplay . '}')));
- return $link;
-}
-
-/**
- * Displays a "encoding in progress message"
- */
-function theme_video_inprogress() {
- return '<div class="video-ffmpeg-helper-inprogress">' . t('This video is currently being processed. Please wait.') . '</div>';
-}
-
-/**
- * Display an "encoding failed" message"
- */
-function theme_video_encoding_failed() {
- return '<div class="video-ffmpeg-helper-encoding-failed">' . t('The video conversion process has failed. You might want to submit a simpler video format like <em>mpeg</em> or <em>divx avi</em>.<br />If the problem persists please contact website administrators.') . '</div>';
-}
-
-function theme_video_flv($video) {
- $video = (object) $video;
- if ($video->flash_player == 'swftools') {
- $options = array(
- 'params' => array(
- 'width' => $video->player_width,
- 'height' => $video->player_height,
- ),
- 'othervars' => array(
- //@todo: swftools bug, can't enable this until they fix their pathing for the images.
- 'image' => $video->thumbnail->swfthumb,
- ),
- );
- $themed_output = swf($video->files->{$video->player}->url, $options);
- } elseif ($video->flash_player == 'flowplayer') {
- // kjh: use a playlist to display the thumbnail if not auto playing
- if (isset($video->autoplay) && isset($video->thumbnail->url)) {
- $options = array(
- 'playlist' => array($video->thumbnail->url,
- array('url' => urlencode($video->files->{$video->player}->url),
- 'autoPlay' => $video->autoplay,
- 'autoBuffering' => $video->autobuffering,
- ),),);
- } else {
- $options = array(
- 'clip' => array('url' => urlencode($video->files->{$video->player}->url),
- 'autoPlay' => $video->autoplay,
- 'autoBuffering' => $video->autobuffering,
- ),);
- }
- $themed_output = theme('flowplayer', array('config' => $options, 'id' => 'flowplayer-' . $video->formatter, 'attributes' => array('style' => 'width:' . $video->player_width . 'px;height:' . ($video->player_height + 24) . 'px;')));
- } else {
- $themed_output = t('No flash player has been setup. ' . l(t('Please select a player to play Flash videos.'), 'admin/settings/video/players'));
- }
- return theme('video_play_flv', array('video' => $video, 'themed_output' => $themed_output));
-}
-
-/**
- * Process variables for video-play-quicktime.tpl.php.
- *
- * The $variables array contains the following arguments:
- * - $video
- *
- * @see video-play-quicktime.tpl.php
- */
-function template_preprocess_video_play_quicktime(&$variables) {
- $variables['video'] = (object) $variables;
-}
-
-/**
- * Process variables for video-play-dcr.tpl.php
- *
- * The $variables array contains the following arguments:
- * - $video
- *
- * @see video-play-dcr.tpl.php
- */
-function template_preprocess_video_play_dcr(&$variables) {
- $variables['video'] = (object) $variables;
-}
-
-/**
- * Process variables for video-play-divx.tpl.php
- *
- * The $variables array contains the following arguments:
- * - $video
- *
- * @see video-play-divx.tpl.php
- */
-function template_preprocess_video_play_divx(&$variables) {
- $variables['video'] = (object) $variables;
-}
-
-/**
- * Process variables for video-play-flash.tpl.php
- *
- * The $variables array contains the following arguments:
- * - $video
- *
- * @see video-play-flash.tpl.php
- */
-function template_preprocess_video_play_flash(&$variables) {
- $variables['video'] = (object) $variables;
-}
-
-/**
- * Process variables for video-play-flv.tpl.php
- *
- * The $variables array contains the following arguments:
- * - $video
- *
- * @see video-play-flv.tpl.php
- */
-function template_preprocess_video_play_flv(&$variables) {
- $variables['video'] = (object) $variables;
- $variables['themed_output'] = (object) $variables;
-}
-
-/**
- * Process variables for video-play-html5.tpl.php
- *
- * The $variables array contains the following arguments:
- * - $video
- *
- * @see video-play-html5.tpl.php
- */
-function template_preprocess_video_play_html5(&$variables) {
- $variables['video'] = (object) $variables;
-}
-
-/**
- * Process variables for video-play-realmedia.tpl.php
- *
- * The $variables array contains the following arguments:
- * - $video
- *
- * @see video-play-realmedia.tpl.php
- */
-function template_preprocess_video_play_realmedia(&$variables) {
- $variables['video'] = (object) $variables;
-}
-
-/**
- * Process variables for video-play-theora.tpl.php
- *
- * The $variables array contains the following arguments:
- * - $video
- *
- * @see video-play-theora.tpl.php
- */
-function template_preprocess_video_play_theora(&$variables) {
- $variables['video'] = (object) $variables;
-}
-
-/**
- * Process variables for video-play-windowsmedia.tpl.php
- *
- * The $variables array contains the following arguments:
- * - $video
- *
- * @see video-play-windowsmedia.tpl.php
- */
-function template_preprocess_video_play_windowsmedia(&$variables) {
- $variables['video'] = (object) $variables;
-} \ No newline at end of file